-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add basic sky coordinates (WCS) to ScopeSim output #307
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev_master #307 +/- ##
==============================================
+ Coverage 80.07% 80.28% +0.20%
==============================================
Files 147 147
Lines 14819 14844 +25
==============================================
+ Hits 11866 11917 +51
+ Misses 2953 2927 -26 ☔ View full report in Codecov by Sentry. |
Signed-off-by: teutoburg <[email protected]>
This should not happen here at all. Either this is done in apply_to anyway, or need to do it somewhere else, but not here.
Because why not...
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.
Great work @teutoburg !
Did you test the IRDB against this branch? I'm a bit worried that this change might break some expectations in the IRDB. But nevertheless I think it is okay to merge this and tackle the problems afterwards. We should be ready for that though.
What still is missing is that the WCS coordinates are not yet added to the headers if any fits header Effects are defined. That is fine for now, as we haven't really defined how to proceed, but all options require this cleanup first and we shouldn't put everything in one PR.
Didn't do that yet, but planning to. As you say, should be fine to do it after merging (but before any new release).
Yes, that was intentional, to keep things separate that are technically separate. If one or the other ends up breaking something, it'll be easier to deal with it I guess. |
Small correction, the WCS should be included anyway, as it's created directly in the |
optics/image_plane_utils
:det_wcs_from_sky_wcs()
andsky_wcs_from_det_wcs()
, which convert detector (mm) WCS into on-sky (arcsec or deg) WCS and vice versa using the pixel and plate scales. Both in turn use the functioncreate_wcs_from_points()
, which has been slightly modified as well. There used to be a bit of a less-than-ideal state because a sky WCS could use either arcsec or deg and ScopeSim is not fully consistent with that, which may lead to bugs if one or the other is incorrectly assumed. All three functions now use astropy units, which is also not ideal for performance, but acceptable for now until we can be certain our units are consistent. If a non-quantity (i.e. float) is passed, a reasonable (documented) unit is assumed. The functionheader_from_list_of_xy()
, which internally also callscreate_wcs_from_points()
, is unchanged in its parameters and still uses thearcsec
flag. This function might be phased out mostly in favor of direct calls tocreate_wcs_from_points()
.FOVManager.generate_fov_list()
, which now usesdet_wcs_from_sky_wcs()
. The code previously there was the main inspiration for the two new functions.Detector.hdu
, which was the main motivation to do all of this. This will be collected byDetectorArray.readout()
and thus also included in the output fromOpticalTrain.readout()
. In the process, some minor changes toDetectorArray
as a whole, mostly documentation, some comments, and everyone's favorite: formatting and linting 🙃OpticalTrain.write_header()
, notably the WCS and some input file names, see also Deal with header keywords #305 .sky
➡️detector
➡️sky
works.