Changeset 17354


Ignore:
Timestamp:
11/23/13 13:07:51 (11 years ago)
Author:
tbretz
Message:
Use more accurate information to restore the last DRS calib.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/scripts/CheckUnderflow.js

    r16851 r17354  
    164164    if (nn>0)
    165165    {
    166         dim.log("Trying to restore last DRS calibration #"+nn+"  ["+runs.time+"]");
    167 
    168         var night;
    169         if (Sun.horizon(null, runs.time).isUp)
    170             night = new Date(runs.time);
    171         else
    172             night = new Date(runs.time-1000*60*60*12);
    173 
    174         var yy = night.getUTCFullYear();
    175         var mm = night.getUTCMonth()+1;
    176         var dd = night.getUTCDate();
    177 
    178         var filefmt = "/loc_data/raw/%d/%02d/%02d/%4d%02d%02d_%03d.drs.fits";
     166        var night = runs.obj['night'];
     167
     168        var yy =  night/10000;
     169        var mm = (night/100)%100;
     170        var dd =  night%100;
     171
     172        var filefmt = "/loc_data/raw/%d/%02d/%02d/%8d_%03d.drs.fits";
     173
     174        dim.log("Trying to restore last DRS calibration #"+nn+"  ["+runs.time+"; "+night+"]");
    179175
    180176        // FIXME: Timeout
    181177        var drs_counter = service_drs.get(0, false).counter;
    182         dim.send("FAD_CONTROL/LOAD_DRS_CALIBRATION", filefmt.$(yy, mm, dd, yy, mm, dd, nn));
     178        dim.send("FAD_CONTROL/LOAD_DRS_CALIBRATION", filefmt.$(yy, mm, dd, night, nn));
    183179
    184180        var now = new Date();
Note: See TracChangeset for help on using the changeset viewer.