Problem extracting spectral data from multiple regions

produce source-level products (spectra, light curves and corresponding instrumental correction vectors/matrices).
Post Reply
zhupeng
Posts: 8
Joined: Sat Oct 08, 2022 7:52 am

Problem extracting spectral data from multiple regions

Post by zhupeng »

Hello everyone,
I encountered the following error while trying to extract spectral data from multiple small regions in an extended source:

srctool/srctool_prepare_extent_model: ERROR2 I cannot handle this class of extent model: MAP
srctool/srctool_setup_extended_source_h: ERROR2 Problem preparing extent model parameters
srctool/srctool: STOP Error setting up extended source handling
srctool: FAILED

Below is the command I used for extraction:

srctool eventfiles="A3266.fits"
srccoord="./A3266/contbin_reg/xaf_0.reg"
todo="SPEC ARF RMF"
insts="1 2 3 4 6"
backreg=NONE
exttype=MAP
extmap="image_soft_corr.fits"
tstep=5.0
xgrid="1"
gtitype="GTI"
clobber="yes"

Could you please help me identify the problem? Thank you in advance for your assistance.

Peng
JeremySanders
Posts: 32
Joined: Mon Jun 28, 2021 7:24 am

Re: Problem extracting spectral data from multiple regions

Post by JeremySanders »

Hi Peng -

It would be helpful to give some more information, such as the contents of the xaf_0.reg file. I have some comments below:

* You don't seem to be supplying an extraction region (srcreg).

* If you're using some contour binning style map regions, I suggest using the "srcreg=mask image.fits" (see the srctool documentation for this option).

* As stated in the manual, if you use extmap=MAP, you need to use psftype=NONE. This is probably the cause of your error.

* Probably you'll need to extract the sources by calling srctool for each source separately.

Cheers

Jeremy
zhupeng
Posts: 8
Joined: Sat Oct 08, 2022 7:52 am

Re: Problem extracting spectral data from multiple regions

Post by zhupeng »

Dear Jeremy Sanders,

Thank you very much for your help in solving the issue I encountered in extracting spectra from multiple small regions of an extended source. With your guidance, I was able to identify the problem and make the necessary changes to my command line.

* Regarding the binning style map regions, I understand that they are composed of a series of box regions. If I choose to provide this region in the srcreg parameter, should I write my srccoord parameter as a list of the center positions of these box regions?

* If I use maskimage to select the extraction regions, how should I choose the srccoord parameter?

* Also, I have a question about the psftype parameter. Some of the regions I selected are very small in size, and the W90 and hpd of the psf in the central region of the CCD are also a few pixels large. Why do I need to turn off the psf effect in this case?

Thank you again for your assistance.

Best regards,
Peng
JeremySanders
Posts: 32
Joined: Mon Jun 28, 2021 7:24 am

Re: Problem extracting spectral data from multiple regions

Post by JeremySanders »

zhupeng wrote: Mon Apr 17, 2023 2:58 am * Regarding the binning style map regions, I understand that they are composed of a series of box regions. If I choose to provide this region in the srcreg parameter, should I write my srccoord parameter as a list of the center positions of these box regions?
For efficiency, a source coordinate close to the centre of the bin would be preferred.
zhupeng wrote: Mon Apr 17, 2023 2:58 am * If I use maskimage to select the extraction regions, how should I choose the srccoord parameter?
Again, probably some average coordinate would be best.
zhupeng wrote: Mon Apr 17, 2023 2:58 am * Also, I have a question about the psftype parameter. Some of the regions I selected are very small in size, and the W90 and hpd of the psf in the central region of the CCD are also a few pixels large. Why do I need to turn off the psf effect in this case?
The srctool code which handles the map source model does not calculate the effect of the PSF, so it cannot be used here. You'll have to correct the results yourself for PSF unfortunately, if it is important. Alternatively, you could use a top hat source model for these small regions (though srctool cannot model the flux scattered into the region by external regions).

Best wishes

Jeremy
zhupeng
Posts: 8
Joined: Sat Oct 08, 2022 7:52 am

Re: Problem extracting spectral data from multiple regions

Post by zhupeng »

Dear Jeremy,

Thank you very much for your help. Your comments were very helpful, and I now have a better understanding of these parameters.I am currently using the contbin program to generate a temperature map and hope to achieve good results.
Once again, thank you for your time and assistance.

Best regards,

Zhupeng
Post Reply