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

Fix comparison of timestamps in calibration code #1002

Merged
merged 1 commit into from
Jul 5, 2022

Conversation

maxnoe
Copy link
Member

@maxnoe maxnoe commented Jul 1, 2022

This code was comparing an astropy TimeDelta object to a plain number,
which was supposed to be in seconds. However, astropy treats plain
numbers as days, not seconds. Since astropy 5.1, this creates a warning
and made me find this bug. See
astropy/astropy#12887.

This means that in when calculating calibration coefficients, the condition for the sample duration was never met, only the number of events condition was used effectively.

I don't know if that has any consequences, since we right now analyze subrun by subrun and these are shorter than the default 60s sample duration value.

This code was comparing an astropy `TimeDelta` object to a plain number,
which was supposed to be in seconds. However, astropy treats plain
numbers as days, not seconds. Since astropy 5.1, this creates a warning
and made me find this bug. See
astropy/astropy#12887.
@codecov
Copy link

codecov bot commented Jul 1, 2022

Codecov Report

Merging #1002 (4023b83) into master (2b24522) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1002   +/-   ##
=======================================
  Coverage   85.88%   85.88%           
=======================================
  Files          78       78           
  Lines        6645     6645           
=======================================
  Hits         5707     5707           
  Misses        938      938           
Impacted Files Coverage Δ
lstchain/calib/camera/flatfield.py 96.29% <100.00%> (ø)
lstchain/calib/camera/pedestals.py 95.69% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b24522...4023b83. Read the comment docs.

@maxnoe maxnoe requested a review from FrancaCassol July 1, 2022 17:30
@maxnoe maxnoe merged commit 90fc41a into master Jul 5, 2022
@maxnoe maxnoe deleted the fix_time_comparisons branch July 5, 2022 13:11
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.

2 participants