Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing modf files with the gray filter #710

Closed
lucabaldini opened this issue Sep 14, 2023 · 8 comments
Closed

Missing modf files with the gray filter #710

lucabaldini opened this issue Sep 14, 2023 · 8 comments

Comments

@lucabaldini
Copy link
Owner

Originally reported by Michal:

Dear Luca,

I have tried unweighted and weighted with irfname='ixpe:obssim_gray:v12' and irfname='ixpe:obssim_gray_alpha075:v12', respectively and it did not work

Input file /usr/local/share/IXPEobssim/ixpeobssim/caldb/ixpe/gpd/cpf/modfact/ixpe_d1_obssim_gray_mfact_v012.fits does not exists
and
Input file /usr/local/share/IXPEobssim/ixpeobssim/caldb/ixpe/gpd/cpf/modfact/ixpe_d1_obssim_gray_alpha075_mfact_v012.fits does not exists

In the directory modfact there are no gray filter responses. I am using ixpeobssim v.30.5.0.

Cheers,

Michal.

@lucabaldini
Copy link
Owner Author

You are right.

I only created the arf and mrf files for the gray filter, not the modf. We have all we need for fitting in xspec but, sadly, I overlokked the fact that the modulation factor is necessary for the pcubes.

*** Quick fix: just copy the ixpe:obssim_gray:v12 files for the three DUs in the same folder adding the _gray suffix in the name. The gray filter does not change the modulation factor and this will work fine, modulo the fact that some of the header keyword will be inconsistent.

This is not a big deal---probably one hour worth of work on my side. I will be in meetings most of the day, today, but I'll do my best to fix this and tag a new version of ixpeobssim by tomorrow night. I opened
#710
to track this.

My apologies for the inconvenience, and thanks for helping debug this!

@lucabaldini
Copy link
Owner Author

It worked in unweighted case giving larger PD below 4keV.

It did not work in weighted case giving me the following error:

Traceback (most recent call last):
...
File "/usr/local/share/IXPEobssim/ixpeobssim/core/pipeline.py", line 378, in xpbin
return xpbin(**parse_args(XPBIN_PARSER, *args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/share/IXPEobssim/ixpeobssim/bin/xpbin.py", line 121, in xpbin
event_binning.bin
()
File "/usr/local/share/IXPEobssim/ixpeobssim/binning/polarization.py", line 324, in bin

aeff = self.load_aeff_for_polarization_analysis()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/share/IXPEobssim/ixpeobssim/binning/base.py", line 228, in load_aeff_for_polarization_analysis
aeff = load_arf(self.irf_name, self.event_file.du_id(), simple_weighting=self.get('weights'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/share/IXPEobssim/ixpeobssim/irf/init.py", line 137, in load_arf
return _load_irf_base(xEffectiveArea, 'arf', irf_name, du_id, caldb_path,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/share/IXPEobssim/ixpeobssim/irf/init.py", line 119, in _load_irf_base
raise RuntimeError('No simple weightig available for %s intent.', intent)
RuntimeError: ('No simple weightig available for %s intent.', 'obssim_gray_alpha075')
...

Cheers,

Michal.

@lucabaldini
Copy link
Owner Author

And this is correct, as well.

For the PCUBE you want to use the weighted file with the SIMPLE prescription. (When I said "leave it alone" yesterday I was referring to the spectro-polarimetric fit in XSPEC only. The PCUBE is the very reason we have files with the simple prescription in the first place.)

So for a weighted PCUBE you need to specify
--irfname 'ixpe:obssim_gray_alpha075simple:v12'
and, until I tag a new version of the package, you need yet another copy of the modf files
cp ixpe_d1_obssim_alpha075_mfact_v012.fits ixpe_d1_obssim_gray_alpha075simple_mfact_v012.fits

I know this sounds overly complicated---I have presented this multiple times at the SASWG telecons and I keep getting confused myself. Good that we have a sensible book-keeping in place within the response files and that xpbin is equipped with a check preventing people to do the wrong thing 😄

Luca

@lucabaldini
Copy link
Owner Author

...no, still the same error... M.

File "/usr/local/share/IXPEobssim/ixpeobssim/core/pipeline.py", line 378, in xpbin
return xpbin(**parse_args(XPBIN_PARSER, *args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/share/IXPEobssim/ixpeobssim/bin/xpbin.py", line 121, in xpbin
event_binning.bin
()
File "/usr/local/share/IXPEobssim/ixpeobssim/binning/polarization.py", line 324, in bin

aeff = self.load_aeff_for_polarization_analysis()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/share/IXPEobssim/ixpeobssim/binning/base.py", line 228, in load_aeff_for_polarization_analysis
aeff = load_arf(self.irf_name, self.event_file.du_id(), simple_weighting=self.get('weights'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/share/IXPEobssim/ixpeobssim/irf/init.py", line 137, in load_arf
return _load_irf_base(xEffectiveArea, 'arf', irf_name, du_id, caldb_path,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/share/IXPEobssim/ixpeobssim/irf/init.py", line 119, in _load_irf_base
raise RuntimeError('No simple weightig available for %s intent.', intent)
RuntimeError: ('No simple weightig available for %s intent.', 'obssim_gray_alpha075simple')

@lucabaldini
Copy link
Owner Author

And I now believe we really need a code change. The culprit appears to be

SUPPORTED_SIMPLE_INTENTS = ('obssim_alpha075', )

in ixpeobssim/irf/init.py

@lucabaldini
Copy link
Owner Author

And I now think we should not add more file, and handle the gray filter via a command-line option in the proper place, see issue #712

@lucabaldini
Copy link
Owner Author

Pull request #716

@lucabaldini
Copy link
Owner Author

Shipped in 30.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant