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
Use sky_to_fov() also for RADEC FoVAlignment in make_map_background_irf #4667
base: main
Are you sure you want to change the base?
Use sky_to_fov() also for RADEC FoVAlignment in make_map_background_irf #4667
Conversation
Hello @SimoneMender , |
Unfortunayley, there are no official CTAO celestial coordinate definitions yet |
1 similar comment
Unfortunayley, there are no official CTAO celestial coordinate definitions yet |
It was my fear... And do you think that, at least temporary in Gammapy&pyirf, this definition from astropy could be used? At least for testing purposes.... |
From my point of view, the issue is that according to the GADF definition (https://gamma-astro-data-formats.readthedocs.io/en/latest/general/coordinates.html#coords-fov), "FOV LON should increase with decreasing OTHER LON". As this is the coordinate system in which a background model has to be stored, it is mandatory to switch the sign of longitude angle when creating a background map. This is exactly covered by the |
I think that CTA(O) definitions are not relevant here. As of now, Gammapy only supports GADF as input format. So what applies are the definitions of the field of view coordinate system of GADF. And GADF defines the FOV longitude to have the opposite sign to the system ot is aligned with, for both alignments (ALTAZ / RADEC). We should probably implement this using astropy coordinate frames like |
Isn't the parameter gammapy/gammapy/makers/utils.py Line 191 in 0a9323a
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @SimoneMender .
As far as I know, sky_to_fov
does the same thing as what was done here (except for the sign of fov_lon). But it does not check the input systems of the coordinates.
The issue lies probably in the sky_to_fov
implementation, taking ra and dec instead of a full SkyCoord.
fov_lon = pseudo_fov_coord.lon | ||
fov_lat = pseudo_fov_coord.lat | ||
fov_lon, fov_lat = sky_to_fov( | ||
sky_coord.ra, sky_coord.dec, pointing_icrs.ra, pointing_icrs.dec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, it is not guaranteed that pointing_icrs
is actually a SkyCoord
in RADEC system if the input is not a FixedPointingInfo
. This must be fixed before calling the ra
and dec
attributes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also is it guaranteed that sky_coord
is in RADEC system?
@SimoneMender can you update your code from the main, such that the CI tests can pass successfully? |
Suggestion to fix issue #3510