Skip to content
This repository has been archived by the owner on May 18, 2023. It is now read-only.

Address time zone issues for run duration calculations #1012

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

raffaelladevita
Copy link
Collaborator

@raffaelladevita raffaelladevita commented Dec 9, 2022

Switch to using ZonedDateTime to build a date-time from the RCDB run start time and remove the dependence on the time zone that was making the FCup conversion from counts to nC dependent on the local time of the machine where the code is running.
Since the RCDB Java API doesn't provide a date but only the local time, the assumption that remains is that the run start time is within a day from the current time. However, using ZonedDateTime.minusDays method ensures the start time date is set correctly al in case of transition from or to day-light saving.

Tests on the last file from run 6419 that was recorded across a transition from EST to EDT show also the 1h time change is handled correctly in the calculation of the scaler integration time:

(printouts from two FCup scaler readouts

Run start time:	2019-03-10T00:24:49-05:00[America/New_York]
Current time:	        2019-03-10T05:15:16-04:00[America/New_York]
Integrated charge (nC):    566821.729 
Integrated time (s):       13827 
Average beam current (nA): 40.994

Run start time:	2019-03-10T00:24:49-05:00[America/New_York]
Current time:	        2019-03-10T05:15:17-04:00[America/New_York]
Integrated charge (nC):    566818.661 
Integrated time (s):       13828 
Average beam current (nA): 40.991

@baltzell baltzell removed their request for review December 9, 2022 21:50
baltzell
baltzell previously approved these changes Dec 12, 2022
@baltzell baltzell added this to the Pass3 milestone Jan 19, 2023
…un start local time, retrieved from RCDB, to a date time and compare to current time with no dependence on time zone or day-light saving time. Changes propagated to both the decoder and rebuil-scalers. Added command line option to set the timestamp for CCDB access to rebuild-scalers tool
@baltzell baltzell force-pushed the iss1011-scalerTimeZone branch from e73bff5 to ef1cb54 Compare March 18, 2023 21:25
@baltzell baltzell changed the title Iss1011 scaler time zone Address time zone issues for run duration calculations Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FCup conversion from counts to charge depends on local time
2 participants