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

rcal-949 Update file naming and asn header coords #1505

Merged
merged 11 commits into from
Nov 14, 2024

Conversation

ddavis-stsci
Copy link
Collaborator

Resolves RCAL-949

Closes #1501

This PR updates the the file naming conventions and adds the orientation to the wcs keywords in the asn header.

Tasks

news fragment change types...
  • changes/<PR#>.general.rst: infrastructure or miscellaneous change
  • changes/<PR#>.docs.rst
  • changes/<PR#>.stpipe.rst
  • changes/<PR#>.associations.rst
  • changes/<PR#>.scripts.rst
  • changes/<PR#>.mosaic_pipeline.rst
  • changes/<PR#>.patch_match.rst

steps

  • changes/<PR#>.dq_init.rst
  • changes/<PR#>.saturation.rst
  • changes/<PR#>.refpix.rst
  • changes/<PR#>.linearity.rst
  • changes/<PR#>.dark_current.rst
  • changes/<PR#>.jump_detection.rst
  • changes/<PR#>.ramp_fitting.rst
  • changes/<PR#>.assign_wcs.rst
  • changes/<PR#>.flatfield.rst
  • changes/<PR#>.photom.rst
  • changes/<PR#>.flux.rst
  • changes/<PR#>.source_detection.rst
  • changes/<PR#>.tweakreg.rst
  • changes/<PR#>.skymatch.rst
  • changes/<PR#>.outlier_detection.rst
  • changes/<PR#>.resample.rst
  • changes/<PR#>.source_catalog.rst

@ddavis-stsci ddavis-stsci added this to the 25Q1_B16 milestone Nov 11, 2024
@ddavis-stsci ddavis-stsci self-assigned this Nov 11, 2024
@ddavis-stsci ddavis-stsci requested a review from a team as a code owner November 11, 2024 18:18
@ddavis-stsci ddavis-stsci force-pushed the rcal-949_dsd branch 2 times, most recently from f7addf1 to 05c23b5 Compare November 11, 2024 18:34
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 36.36364% with 7 lines in your changes missing coverage. Please review.

Project coverage is 76.24%. Comparing base (0579dac) to head (6043bf6).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
romancal/associations/skycell_asn.py 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1505      +/-   ##
==========================================
- Coverage   76.26%   76.24%   -0.02%     
==========================================
  Files         115      115              
  Lines        7643     7650       +7     
==========================================
+ Hits         5829     5833       +4     
- Misses       1814     1817       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@schlafly schlafly left a comment

Choose a reason for hiding this comment

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

Thanks Dave. This looks good. Harry made a further update to the file names to remove the wfi string from the L3 products.
e.g.
rPPPPP_p_v0102010001001_274p63x31y81_f106_coadd.asdf
https://innerspace.stsci.edu/pages/viewpage.action?spaceKey=RDMSDOC&title=Roman+Science+File+Naming+Conventions+for+Files+in+the+Archive+Catalog
I think this just means re-removing the +instrument and a +sep.

@ddavis-stsci ddavis-stsci force-pushed the rcal-949_dsd branch 2 times, most recently from be22fec to 70e2c71 Compare November 13, 2024 21:28
Copy link
Collaborator

@mairanteodoro mairanteodoro 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 to me.
I only left one suggestion that would make the code more maintainable.

Comment on lines 67 to 74
if product_type == "visit":
pr_name = (
"v"
+ parsed_visit_id["Execution"]
+ parsed_visit_id["Pass"]
+ parsed_visit_id["Segment"]
+ parsed_visit_id["Observation"]
)
elif product_type == "daily":
pr_name = (
"d"
+ parsed_visit_id["Execution"]
+ parsed_visit_id["Pass"]
+ parsed_visit_id["Segment"]
)
elif product_type == "pass":
pr_name = "p" + parsed_visit_id["Execution"] + parsed_visit_id["Pass"]
elif product_type == "full":
pr_name = "full"
elif product_type == "user":
pr_name = "user"
else:
pr_name = "unknown"

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the code would be more concise and easier to maintain if we used a mapping instead of a conditional block here. Something along the lines of:

product_name_mapping = {
    "visit": "v" + parsed_visit_id[1] + parsed_visit_id[...] + parsed_visit_id[n],
    "daily": "d" + parsed_visit_id[1] + parsed_visit_id[...] + parsed_visit_id[n],
    "pass": "p" + parsed_visit_id[1] + parsed_visit_id[...] + parsed_visit_id[n],
    "full": "full",
    "user": "user"
}

pr_name = product_name_mapping.get(product_type, "unknown")

Copy link
Collaborator

@mairanteodoro mairanteodoro 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! Thanks.

@ddavis-stsci ddavis-stsci merged commit 74f6ab8 into spacetelescope:main Nov 14, 2024
30 of 31 checks passed
@ddavis-stsci ddavis-stsci deleted the rcal-949_dsd branch November 14, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add extra info the asn header for skycell mosaics
3 participants