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

Create WCS Header and Apply Distortion Correction to L3 #299

Merged
merged 12 commits into from
Feb 26, 2025

Conversation

manduhmia
Copy link
Contributor

Describe your changes

Functionality and unit tests for creating the wcs header information (l2b_to_l3) and applying distortion solution to the dataset (l3_to_l4).

Type of change

Please delete options that are not relevant (and this line).

  • New feature (non-breaking change which adds functionality)

Reference any relevant issues (don't forget the #)

#234
#5

Checklist before requesting a review

  • I have linted my code
  • I have verified that all unit tests pass in a clean environment and added new unit tests, as needed
  • I have verified that all docstrings are properly formatted and added new documentation, as needed
  • I have filled out the Unit Test Definition Table on confluence, as needed

@manduhmia manduhmia requested a review from semaphoreP February 11, 2025 21:40

def boresight_calibration(input_dataset, field_path='JWST_CALFIELD2020.csv', field_matches=None, find_threshold=10, fwhm=7, mask_rad=1,
comparison_threshold=50, search_rad=0.0075, platescale_guess=21.8, platescale_tol=0.1, center_radius=0.9,
frames_to_combine=None, find_distortion=False, fitorder=3, position_error=None, initial_dist_guess=None):
"""
Perform the boresight calibration of a dataset.

Args:
input_dataset (corgidrp.data.Dataset): Dataset containing a images for astrometric calibration
field_path (str): Full path to file with search field data (ra, dec, vmag, etc.) (default: 'JWST_CALFIELD2020.csv')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to have this as a missable keyword argument set by default to 'JWST_CALFIELD2020.csv', or would it be better just to have it be another required argument?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file is packaged into corgidrp, so the default should always work.

@@ -178,7 +177,7 @@ def test_astrom_e2e(tvacdata_path, e2eoutput_path):
assert dec == pytest.approx(target[1], abs=8.333e-7)

if __name__ == "__main__":
tvacdata_dir = "/Users/macuser/Roman/corgi_contributions/Callibration_Notebooks/TVAC"
tvacdata_dir = "/Users/macuser/Roman/corgidrp_develop/calibration_notebooks/TVAC"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a standardized solution for what filepath to use for the data in the end-to-end tests so that it can be run on any machine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is used only for debugging. the way the e2e tests are run (see README), don't use these lines of code.

@semaphoreP semaphoreP changed the base branch from main to astrom_e2e February 25, 2025 20:45
Copy link
Contributor

@semaphoreP semaphoreP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. very minor comments. There's some merge conflicts with main, but you can merge into astrom_e2e if that's easier (I changed it to merge into astrom_e2e because it made review easier).

@@ -1056,9 +1056,12 @@ def create_astrom_data(field_path, filedir=None, image_shape=(1024, 1024), subfi
prihdr['VISTYPE'] = 'BORESITE'
prihdr['RA'] = target[0]
prihdr['DEC'] = target[1]
prihdr['ROLL'] = 0 ## assume a telescope roll = 0 for now
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this will be covered by this upcoming PR: https://github.com/roman-corgi/corgidrp/pull/306/files#diff-02971e9165951439a9a69d418600747c90eb4612e412cd077fdab3655c0343eaR150. No action now, but we can remove it in the future.

@manduhmia manduhmia merged commit 4ee1bb7 into astrom_e2e Feb 26, 2025
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 this pull request may close these issues.

3 participants