slotutcfix – Correct UTC times in slotmode data headers
slotutcfix images update (outfile) (ampperccd) (ignorexp) (droplimit) (inter) (plotdata) (logfile) (verbose) (debug)
SLOTUTCFIX corrects the UTC values in the slotmode imaging data. The SCAM software was producing incorrect UTC values for three reasons: (1) An additional 47 ms dwell time in the original DSP software, (2) The computer losing time during readout, and (3) the number of frames between observation and readout was assumed to be 6, when for practically purposes, it is 8 frames. All three issues have been corrected in versions of SCAM software at SCAM-7.08 and above. Earlier version prior to SCAM-4.42 unfortunately maintain a slightly different header structure and cannot be corrected for these issues although they are present. SLOTUTCFIX is supplied to provide a fix for SCAM software between versions SCAM-4.42 and SCAM-4.78.
To calculate the correct times for the images, two aspects of the SCAM readout were verified in the lab. All exposures have the same dwell time (dead time plus exposure time) and the exposure closest to the turn of the second can be considered a fiducial time. The latter is due to an independent pulse feed to SCAM to update the timing once a second.
With these two assumptions, we can calculate the correct dwell time by minimizing the following equation:
Y(t_dwell) =sum [ abs( (dt_i/t_dwell)-int(dt_i/t_dwell))]
In this equation, dt_i is the difference between the UTC time of exposure i and the firt post-second exposure. It is assumed that there should be an integer number of frames between the first post-second exposure and all other post-second exopures. The value of t_dwell that minimizes the equation will be calculated and can be used to update the UTC value in the image headers. Alternatively, SLOTUTCFIX can be run manual and the user can enter in their desired value for t_dwell.
Once the correct dwell time has been calculated, a new UTC is calculated for every exposure. The first exposure after the turn of a second is assumed to be a fiducial exposure. Then the UTC is calculated by multiplying the dwell time by the number of observed and dropped frames between a given exposure and this fiducial one. Exposures are dropped when data that has been readout has not been recorded when another exposure has finished reading out.
The final correction is to correct for the wrong number of exposures assumed to have been readout. The correct time is found by taking the UTC from the exposure 6 recorded exposures ahead and then correcting that time by 8 times the dwell time. Frames at the end of the run may not have the correct exposure time as it is difficult to determine if any frames may have been dropped, so the last 8 exposures of any track should be ignored.
If the data are updated, UTC-OBS and TIME-OBS will be both replaced with the correct time. Two additional keywords will also be added: DWETIME is the total exposure plus dead time for each image, and DUTC is the change in UTC-OBS in seconds.
When running the task, the user has several options. If update is selected, the UTC values in the headers will be corrected along with the addition of keywords with information on the change in UTC and the dwell time. If plotdata is selected, the relationship between the fit and the range in t_dwell will be plotted for the user to examine. inter allows the user to interactively approve the value of t_dwell or enter in a value of their choice.
When running the task, the user should take care to only run it on data from the same set of SCAM observations. If a subset of observations from a track has been restarted, then the program should be run separately on each group of observations.
From investigation of a number of observations, it has generally been found that the dwell time is given by the exposure time (or the minimum exposure time for that binning) plus 47 milliseconds. In the end, the relative accuracy of the timing is, at best, approximately 0.01 seconds.
A fix to the SCAM software for this problem will be installed at some point. At that time, this software will no longer be needed.
To automatically correct the UTC values in the image``:
--> slotutcfix images="*.fits" update=y outfile='out'
amperccd=2 ignorexp=0 plotdat=y inter=y droplimit=100
logfile=salt.log verbose=y
A linux machine with 2 GB of RAM and a 2.8 Ghz processer was able to process 12 SALTICAM slotmode exposures with 200 extensions in 16 seconds.
The current version of SLOTUTCFIX does not check for the SCAM software version being used.
Send feedback and bug reports to salthelp@saao.ac.za