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

pypeit_chk_flexure #1844

Merged
merged 6 commits into from
Aug 26, 2024
Merged

pypeit_chk_flexure #1844

merged 6 commits into from
Aug 26, 2024

Conversation

debora-pe
Copy link
Collaborator

@debora-pe debora-pe commented Aug 24, 2024

As title. New simple script to check the flexure (both spatial and spectral) applied to the science data.

Some examples of how the script works:

pypeit_chk_flexure spec1d_DE.20141021.3*.fits --spec
[INFO]    :: Checking fluxure for file: spec1d_DE.20141021.34721-GOODSS_DEIMOS_20141021T093833.706.fits
          NAME          global_spec_shift local_spec_shift total_spec_shift
----------------------- ----------------- ---------------- ----------------
SPAT0038-SLIT0052-MSC01             0.137            0.000            0.137
SPAT0172-SLIT0162-MSC01             0.070            0.000            0.070
SPAT0231-SLIT0224-MSC01             0.073            0.000            0.073
(...)

[INFO]    :: Checking fluxure for file: spec1d_DE.20141021.35719-GOODSS_DEIMOS_20141021T095514.045.fits
          NAME          global_spec_shift local_spec_shift total_spec_shift
----------------------- ----------------- ---------------- ----------------
SPAT0162-SLIT0162-MSC01             0.032            0.000            0.032
SPAT0221-SLIT0224-MSC01             0.037            0.000            0.037
SPAT0249-SLIT0265-MSC01             0.151            0.000            0.151
(...)
pypeit_chk_flexure spec2d_DE.20141021.34721-GOODSS_DEIMOS_20141021T093833.706.fits --spec
[INFO]    :: Checking fluxure for file: spec2d_DE.20141021.34721-GOODSS_DEIMOS_20141021T093833.706.fits

================================================== MSC01 ================================================
spat_id global_spec_shift
------- -----------------
     52             0.137
    103             0.000
    162             0.070
(...)

================================================== MSC02 ================================================
spat_id global_spec_shift
------- -----------------
     25             0.102
     70             0.075
    210             0.130
(...)
 pypeit_chk_flexure spec2d_DE.20141021.34721-GOODSS_DEIMOS_20141021T093833.706.fits --spat
[INFO]    :: Checking fluxure for file: spec2d_DE.20141021.34721-GOODSS_DEIMOS_20141021T093833.706.fits

================================================== MSC01 ================================================
Spat shift: None

================================================== MSC02 ================================================
Spat shift: None

================================================== MSC03 ================================================
Spat shift: None

================================================== MSC04 ================================================
Spat shift: None

@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 14.49275% with 59 lines in your changes missing coverage. Please review.

Project coverage is 38.18%. Comparing base (df30133) to head (2388003).

Files Patch % Lines
pypeit/core/flexure.py 7.89% 35 Missing ⚠️
pypeit/scripts/chk_flexure.py 20.00% 24 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1844      +/-   ##
===========================================
- Coverage    38.21%   38.18%   -0.03%     
===========================================
  Files          208      209       +1     
  Lines        48419    48487      +68     
===========================================
+ Hits         18504    18516      +12     
- Misses       29915    29971      +56     

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

Copy link
Collaborator

@kbwestfall kbwestfall 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! Three requests/questions:

  • Add a comment in the release doc
  • Can we use msgs.info instead of print?
  • Is it necessary to collect and return the tables from all the input files?

@debora-pe
Copy link
Collaborator Author

Looks good! Three requests/questions:

  • Add a comment in the release doc
  • Can we use msgs.info instead of print?
  • Is it necessary to collect and return the tables from all the input files?

-Thanks @kbwestfall for the reminder to add to the release doc (I always forget!)
-I changed one print to msgs.info for one information message, but in general, I prefer to leave print, since it not a really a PypeIt message, it's just printing something. And also, most of them are table, so I think they look better.

  • Well, yes, I am envisioning using the script to make checks for the ADAP data and returning the table will help with that.

@debora-pe
Copy link
Collaborator Author

@kbwestfall I followed your suggestion to move the flexure checking code to a function that is then called by pypeit_chk_flexure. Let me know what you think.

Copy link
Collaborator

@kbwestfall kbwestfall left a comment

Choose a reason for hiding this comment

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

Thanks for these updates!

@debora-pe
Copy link
Collaborator Author

Thanks @badpandabear and @kbwestfall for the quick reviews. I'm merging now.

@debora-pe debora-pe merged commit f864562 into develop Aug 26, 2024
23 checks passed
@debora-pe debora-pe deleted the chk_flexure branch August 26, 2024 23:57
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.

4 participants