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

Add option to reproject non-EBD images in WorkUnit #772

Open
jeremykubica opened this issue Jan 11, 2025 · 5 comments · May be fixed by #775
Open

Add option to reproject non-EBD images in WorkUnit #772

jeremykubica opened this issue Jan 11, 2025 · 5 comments · May be fixed by #775
Assignees

Comments

@jeremykubica
Copy link
Contributor

WorkUnit's image_positions_to_original_icrs assumes that the images have been reprojected into EBD space and uses that information to convert the coordinates. In the future we might have cases where we have reprojected the images to a common WCS that is not in EBD space (for example if we are just combining chips into a mosaic or correcting rotation). We should have functionality to extract the correct per-image (RA, dec).

I'm guessing this can be done by: First checking hecking if we have all the EBD information if not np.any(self.org_img_meta["per_image_wcs"] is None) and so forth. If we have the EBD information, use that as in the current function. Otherwise, if we don't have the EBD information, do a reprojection without it.

@maxwest-uw
Copy link
Collaborator

pretty sure that image_positions_to_original_icrs is the only method that would be broken by a non ebd reprojection, but I'll go through WorkUnit to confirm and make the necessary changes :)

@maxwest-uw
Copy link
Collaborator

just to confirm:

  • in the reprojection code, we already have the frame="original" option which won't use the ebd correction.
  • in the WorkUnit, the only part of the code that has a problem with a non-ebd correction would be the image_positions_to_original_icrs method.

I think the approach above works pretty well for most cases (i.e. checking to see if the WorkUnit is reprojected and has ebd_wcs values, with the only wrinkle being if someone were to correct the wcs into ebd and then decide not to reproject using those at a later point. We could also just add an extra variable to WorkUnit like reprojection_frame that can be the canonical source for the reprojection method.

@jeremykubica
Copy link
Contributor Author

If I wanted to extend the code from #770 to include non-EBD projection, what specifically would I call? Is it the general reprojection code with frame="original"?

@maxwest-uw
Copy link
Collaborator

assuming that your WorkUnit was run with reprojection and frame="original" then we could just add a check to the code in #770 to check what the reprojection frame was and then not create a global_ra or dec value and just put the first radec values you have into the img_ra and img_dec. I'm also working on image_positions_to_original_icrs to make it handle the non-ebd reprojection case better.

@maxwest-uw maxwest-uw linked a pull request Jan 15, 2025 that will close this issue
@jeremykubica
Copy link
Contributor Author

I agreed with that approach for ra, dec. I think we will need to do something more if we want to get back original x, y though.

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

Successfully merging a pull request may close this issue.

2 participants