Sometimes the instrument specialists give us new calibrations. Usually just a dead strip list for TKR, 3 (asym, MeV/DAC, peds) at a time for CAL. They need to be put in a standard place, registered in the calibration DB, and set active. This requires picking a time when validity switches from the previous set to the new one. We want this to happen between runs. The gaps between non-SAA runs are short, and CALDB doesn't do leap seconds, so I put the transitions near the middle of an SAA passage - the first one after the last run that we have data for.
If there is not already an existing issue for the update, start one in the JIRA PII tracker. Here is an example that can be used as a template: - PII-454Getting issue details... STATUS based off the ones they use for on-board hot strip masking updates (e.g., - OBCONF-204Getting issue details... STATUS ).
We have adopted the workflow that one person (the primary) will do the update and another (the secondary) will check it and sign off after verifying that the start time is valid and the file names in the database are correct. They can either work on it together or have the secondary check later but before the calibration is scheduled to take effect. Hopefully, this will avoid situations in the past where updates were done incorrectly (e.g., the file names were mistyped) that resulted in having to cleanup the processing afterwards.
In general, it is probably better to do the updates early in the week rather than later.
source /afs/slac.stanford.edu/g/glast/ground/scripts/group.sh
source /afs/slac.stanford.edu/g/glast/ground/scripts/group.cshrc
rdbGUI
: type "rdbGUI" at the command prompt./afs/slac/g/glast/applications/dbSchemas/calib
File Name
box. NOTE: to "paste" from clipboard into a Qt GUI window, using a Mac: ctrl-click-vmetadata_v2r1
under the Tables box.Session
menu, click on "Open connection". This will open a pop up box.For easier reference, here's a table with some example files and the calib_type for them.
file name example | calib_type | Notes |
---|---|---|
fit_gcrhists_lkhd_568m_572m_bigsum.gcr_asym_hist.xml | CAL_Asym | the "568m_572m" should increment by 6m for each new calibration |
fit_proton_calib_568m_572m_bigsum.calMPD.xml | CAL_MevPerDac | the "568m_572m" should increment by 6m for each new calibration |
pedavr_568m_572m.xml | CAL_Ped | the "568m_572m" should increment by 6m for each new calibration |
LAT_BadStrips_45.xml | TKR_DeadChan | the "45" should increment by 1 for each new calibration |
SELECT ser_no FROM metadata_v2r1 WHERE ((completion="OK") AND (instrument="LAT") AND (calib_type="TKR_DeadChan") AND (flavor="L1current")
AND ("2021-05-22 12:57:20">=vstart) AND ("2021-05-22 12:57:20"<vend) AND ("PROD"=PROC_LEVEL)) ORDER BY update_time desc
so in the event that the "vend" field of the previous record does not update, then the XML file might be selected by the "update_time" value. So you might want to confirm that the desired new XML calibration file has the latest "update_time".
This section is to help troubleshoot any errors.
If the L1Proc deliveries start to fail after the calibration change takes effect, look at the logs mentioned above and search for any errors. If you see something like:
XmlBaseCnv FATAL Unable to parse document $(LATCalibRoot)/CAL/p7repro/fit_proton_calib_634m_638m_bigsum.calMPD.xml aka /afs/slac/g/glast/ground/releases/calibrations//CAL/p7repro/fit_proton_calib_634m_638m_bigsum.calMPD.xml
then that calibration file was not actually copied to the TKR or CAL directories described above. Copy it there and then either contact someone to rollback the process or do it yourself following the instructions in Things to know while on-call for Data Processing. In this case, a command line rollback of delivery 210427007:
/afs/slac.stanford.edu/u/gl/glast/pipeline-II/prod/pipeline -m PROD rollbackStream --minimum 'L1Proc[210427007]'
was all that was needed to successfully process the delivery.
During one update, step 20 was done twice creating two rows in the database, and the vend value was not updated for the "old" calibration file. The calibrator uses does not have permission to delete rows. What you can do is edit the value in the table to manually set either using the rdbGUI (like in step 20) or logging into the database on the command line.
Here's what was done on the command line. First, log into the mysql database. I think this works from pretty much any SLAC machine. The password is the same as the one used for rdbGUI given above:
mysql -h glastCalibDB.slac.stanford.edu -u calibrator -p
Then change to the calib database and look at the table. Below are the last few entries for the TKR calibration files:
MySQL [(none)]> use calib; MySQL [calib]> select ser_no,flavor,data_ident,vstart,vend,update_time from metadata_v2r1 where calib_type = 'TKR_DeadChan' and ser_no > 1256; +--------+-----------+------------------------------------------+---------------------+---------------------+---------------------+ | ser_no | flavor | data_ident | vstart | vend | update_time | +--------+-----------+------------------------------------------+---------------------+---------------------+---------------------+ | 1263 | L1current | $(LATCalibRoot)/TKR/LAT_BadStrips_58.xml | 2020-08-03 15:30:00 | 2020-11-05 04:23:00 | 2020-11-05 02:28:20 | | 1267 | L1current | $(LATCalibRoot)/TKR/LAT_BadStrips_59.xml | 2020-11-05 04:23:00 | 2021-02-03 15:41:00 | 2021-02-03 20:28:28 | | 1271 | L1current | $(LATCalibRoot)/TKR/LAT_BadStrips_60.xml | 2021-02-03 15:41:00 | 2037-01-01 00:00:00 | 2021-02-03 20:28:28 | | 1278 | L1current | $(LATCalibRoot)/TKR/LAT_BadStrips_61.xml | 2021-05-04 18:29:00 | 2037-01-01 00:00:00 | 2021-05-04 22:09:54 | | 1279 | L1current | $(LATCalibRoot)/TKR/LAT_BadStrips_61.xml | 2021-05-04 18:30:00 | 2037-01-01 00:00:00 | 2021-05-04 21:45:51 | +--------+-----------+------------------------------------------+---------------------+---------------------+---------------------
I then updated the vend times the "old" one and the initial duplicate. For good measure, I also changed the flavor of the 1278 row to "test" from "L1current" since the pipeline selects only "L1current" files (see the note in step 25e).
MySQL [calib]> update metadata_v2r1 set vend = '2021-05-04 18:30:00' where ser_no = 1271; MySQL [calib]> update metadata_v2r1 set vend = '2021-05-04 18:30:00' where ser_no = 1278; MySQL [calib]> update metadata_v2r1 set flavor='test' where ser_no = 1278; MySQL [calib]> select ser_no,flavor,data_ident,vstart,vend,update_time from metadata_v2r1 where calib_type = 'TKR_DeadChan' and ser_no > 1256; +--------+-----------+------------------------------------------+---------------------+---------------------+---------------------+ | ser_no | flavor | data_ident | vstart | vend | update_time | +--------+-----------+------------------------------------------+---------------------+---------------------+---------------------+ | 1263 | L1current | $(LATCalibRoot)/TKR/LAT_BadStrips_58.xml | 2020-08-03 15:30:00 | 2020-11-05 04:23:00 | 2020-11-05 02:28:20 | | 1267 | L1current | $(LATCalibRoot)/TKR/LAT_BadStrips_59.xml | 2020-11-05 04:23:00 | 2021-02-03 15:41:00 | 2021-02-03 20:28:28 | | 1271 | L1current | $(LATCalibRoot)/TKR/LAT_BadStrips_60.xml | 2021-02-03 15:41:00 | 2021-05-04 18:30:00 | 2021-05-25 07:00:51 | | 1278 | test | $(LATCalibRoot)/TKR/LAT_BadStrips_61.xml | 2021-05-04 18:29:00 | 2021-05-04 18:30:00 | 2021-05-25 07:01:55 | | 1279 | L1current | $(LATCalibRoot)/TKR/LAT_BadStrips_61.xml | 2021-05-04 18:30:00 | 2037-01-01 00:00:00 | 2021-05-04 21:45:51 | +--------+-----------+------------------------------------------+---------------------+---------------------+---------------------
A later check of the pipeline confirmed that it is using the 1279 entry.
Further troubleshooting instructions will be added as issues come up.