-
Notifications
You must be signed in to change notification settings - Fork 5
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
Crop Step Function #278
Crop Step Function #278
Conversation
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.
Some quick change requests/comments
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 for the changes!
|
||
# Require that mode is HLC for now | ||
if not prihdr['MODE'] == 'HLC': | ||
raise UserWarning('Crop function is currently only configured for mode HLC.') |
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.
I think we should make use the FSAMNAME keyword to define the crop region. I'm not sure what the header keyword value we want is, but the definition is "easily understand PAM configuration.", as seen on this page.
Describe your changes
Adds a new step function
l3_to_l4.crop()
to crop data and update relevant header values.sizexy
is the desired data shape in xy order. Currently required to be even. If a single value is provided we assume a square data shape. Defaults to 60 (a little bigger than the dark hole region).centerxy
is the pixel location to center the cropping on, should be the intersection of 4 pixels since we want an even data shape. Raises a warning if the provided center is not a half-integer, and centers on the nearest pixel intersection. Defaults to the star location in the extension header ("STARLOCX"
/"STARLOCY"
) and will raise an exception if no value is provided but the location is missing from the header.Possible future additions (low priority):
Example:


Input dataset with a square "PSF" at the position of "STARLOCX/Y" in the header:
cropped_dataset = crop(input_dataset)
automatically crops to 60 pixels around "STARLOCX/Y":Type of change
Reference any relevant issues (don't forget the #)
Issue #261: Need a step function to crop data
Checklist before requesting a review