Page 1 of 1

Regarding mask command in srctool

Posted: Wed May 04, 2022 1:58 pm
by Kalyani
Dear eROSITA help desk,

I am familiarizing with the eROSITA analysis, srctool for extracting the background spectrum by masking the sources using ds9 software. 
I have tried extraction of the spectrum with two of the files event files where one is having image = yes for image and with image = no. 

srctool eventfiles="image_gti.fits" prefix="bkg_spectra_" srccoord="fk5;130.6065,2.8809" srcreg='fk5; mask ds9.fits' exttype="POINT" todo="SPEC ARF RMF" insts="1 2 3 4 6"

 srctool/srctool: Initialising data structures
 srctool: eSASS4EDR Jul 27 10:17:48 2021
 srctool/srctool: Interpreting input parameters
 srctool/srctool_extmap_read_from_file: **ERROR3** FITSIO error (status=252): 1st key not SIMPLE or XTENSION
 srctool/srctool_regions_load_mask: **ERROR3** Error: loading region mask
 srctool/srctool_param_interpret_region_: **ERROR3** Problem interpretting region description
 srctool/srctool_param_interpret_src_par: **ERROR3** Error when interpreting SRC region descriptions
 srctool/srctool_param_interpret_pars: **STOP** Error interpreting source and/or region parameters
 srctool: FAILED

I hope you may help me with the following issues. Thank you. 
Best regards, 
Kalyani Mehta. 

Re: Regarding mask command in srctool

Posted: Wed May 04, 2022 3:06 pm
by JeremySanders
Dear Kalyani

You are likely supplying a fits mask file which is not of the right format. This should be a simple fits image which a simple world coordinate system. You can try to make sure the file has the mask in the first (primary) HDU, and defines keywords CDELT1, CRPIX1, CUNIT1, CRVAL1, CDELT2, CRPIX2, CUNIT2, CRVAL2. The mask should be a 2D array with positive values to include, and zero or negative values to exclude.

Best wishes

Jeremy