Date: Mon, 8 Apr 2002 18:00:18 -0400 (EDT) From: Joseph DePasquale To: Paul P. Plucinsky , Shanil N. Virani , Yousaf M. Butt , Dan Schwartz Subject: History files script Hello ACIS Team, Given the multitude of TOO's and vicious radiation storms recently, I've decided to write a script that completely automates the process of updating the ACIS history files in the event of a load interruption. I'm sorry to inform you that you will no longer have to painstakingly examine each line of the 5 history files to remove everything after the load interrupt, add a line with a future date on it, and then copy them over to PSICORP. As much fun as this was, it left a large margin for human error and in this case we all know that error would be a bad thing. The script will work for any type of interruption to the regular schedule, (TOO's, SCS107's). Here are the details: As you all know, there are two directories where we keep our 5 history files; the two directories are redundant: backup: /proj/sot/acis/FLU-MON primary (PSICORP): /export/acis-flight/FLU-MON These are the 5 files in each directory: FPHIST-2001.dat GRATHIST-2001.dat OBSHIST.dat TLMHIST.dat TSCHIST.dat The script resides in: /data/acis0/LoadReviews/script and is aptly titled: history-files.pl ** When there is an interruption to the load you can use this script to delete all entries in each history file after the time that the loads stopped, as well as add a line that projects the current state of the instrument well into the future (9999:999:99:99:99.999 to be exact) - this keeps other scripts from crashing because there is no future in the history file (that sounds strange doesn't it?). Once the recovery loads, or TOO loads have been approved and AFTER you've run ACE-update.ksh, you can re-run the script with a different switch to remove the "9999" line. Here are some examples: 1. Let's say there was an SCS107 trip at 2002:090:01:43:57.095 and the current state of the instrument at that time was ACIS-S,HETG-OUT,LETG-OUT,2118,OORMPEN,CSELFMT2 (this information can be obatained from ACIS-LoadReview.txt generated by Shanil's script). To update the history files you would run: history-files.pl -stop 2002:090:01:43:57.095 HRC-S,HETG-OUT,LETG-OUT,2118,OORMPDS,CSELFMT2 So, basically, you give the script the switch "-stop" which means you intend to remove entries from the history files, the exact time of load interruption and the current state of the instrument. When you hit return you will be prompted for your password 5 times as the updated history files are copied to PSICORP. If you check the new history files you will see that they stop right at the point of the load interruption and that there is an additional line with a lot of "9's" that projects the current state into the future. Time drags on and you participate in many radiation telecons agonizing over the turtle-like speed at which the proton levels are declining. Finally, the rates are such that we can resume science and the recovery loads are approved for uplink. It is extremely important that you run ACE-update.ksh BEFORE you re-run history-files.pl to remove the "9999" line. This ensures that other scripts will not crash. So, you have just run ACE-update.ksh and now you are ready to delete the extra line in the history file. You simply run: history-files.pl -go The "-go" switch tells the script that you want to remove the "9999" line and again you will be prompted for your password as the files are copied over to PSICORP. Then, you are done! The history files are now continuous and will not need any further updating until the next load. 2. You can follow this same method for TOO's as well. Just a quick example from today: history-files.pl -stop 2002:100:00:38:45.000 ACIS-S,HETG-IN,LETG-OUT,3455,OORMPEN,CSELFMT2 Shanil ran this when the TOO load was approved. He later ran ACE-update.ksh to update the history files and then ran history-files.pl -go to remove the extra line. I realize that this is a lot of information and you probably don't want to have to refer to some archived email from ages ago when you want to run the script so simply run it at the command line with no arguments and it will provide you with some examples: acis-21: history-files.pl ERROR! USAGE: There are two ways to use this script... 1. if loads just stopped and you need to update the history files, run: history-files.pl [-stop] [time of load stop] [current state] 2. if new loads have been created and approved and you have already run ACE-update and need to remove the extra 9999 entry, run: history-files.pl [-go] EXAMPLES: 1. Load stopped at 2002:090:01:43:57.095 history-files.pl -stop 2002:090:01:43:57.095 HRC-S,HETG-OUT,LETG-OUT,2118,OORMPDS,CSELFMT2 2. Need to remove the extra line in each history file (only AFTER ACE-update has been run) history-files.pl -go I hope this all makes sense, if anyone has any questions or comments please let me know. Thanks! Joe [_][_] [_][_] ACIS [_][_][_][_][_][_] Operations _______________________________________________________________ Joseph DePasquale - Harvard-Smithsonian Center for Astrophysics phone:617-496-7316 60 Garden Street MS 34 cell: 617-872-3731 Cambridge, MA 02138 USA fax: 617-496-7067 page:1800-946-4646 pin 1742268 1742268@archwireless.net jdepasquale@head-cfa.harvard.edu ---------------------------------------------------------------