Revision: | 1.1 |
Committed: | Sun Jan 2 22:13:25 2011 UTC (12 years, 8 months ago) by phil |
Content type: | application/x-csh |
Branch: | MAIN |
CVS Tags: | Ver_6-0, Ver_6-1, Ver_6-2, Ver_6-3, Ver_6-4, Ver_9-1, Ver_5-14, Ver_5-13, Ver_LATEST, Ver_9-3, Ver_9-41, Ver_9-2, Ver_8-8, Ver_8-2, Ver_8-3, Ver_8-0, Ver_8-1, Ver_8-6, Ver_8-7, Ver_8-4, Ver_8-5, Ver_7-1, Ver_7-0, Ver_9-5, Ver_9-4, Ver_8-10, Ver_8-11, Ver_8-12, Ver_9-0, HEAD |
Log Message: | Initial commit, copied from ~phil/workflow/scripts |
# | Content |
---|---|
1 | #! /bin/csh -f |
2 | |
3 | # status for DSDS 6-hour datasets. |
4 | # keyword is DSDS index value, not a time. |
5 | # but low and high are stored as time. |
6 | |
7 | # echo starting $0 $* |
8 | # set echo |
9 | |
10 | if ($?WORKFLOW_ROOT) then |
11 | set WFDIR = $WORKFLOW_DATA |
12 | set WFCODE = $WORKFLOW_ROOT |
13 | else |
14 | echo Need WORKFLOW_ROOT variable to be set. |
15 | exit 1 |
16 | endif |
17 | |
18 | cd $WFDIR/gates |
19 | set gate = $1 |
20 | cd $gate |
21 | # ignore already in the gate dir |
22 | |
23 | set product = `cat product` |
24 | set key = `cat key` |
25 | set low = `cat low` |
26 | set low_t = `time_convert time=$low` |
27 | set low = `time_convert zone=TAI s=$low_t` |
28 | set high = `cat high` |
29 | set high_t = `time_convert time=$high` |
30 | set high = `time_convert zone=TAI s=$high_t` |
31 | |
32 | set nancount = 0 |
33 | |
34 | if ($low == "NaN") then |
35 | set nancount = 1 |
36 | set low = `show_info -q $product'[^]' key=$key` |
37 | if ($?) then |
38 | echo $0 $* FAILED |
39 | exit 1 |
40 | endif |
41 | time_index six=$low -t > low |
42 | else |
43 | set low = `time_index -6 time=$low` |
44 | endif |
45 | |
46 | if ($high == "NaN") @ nancount = $nancount + 1 |
47 | |
48 | set high = `show_info -q $product'[$]' key=$key` |
49 | if ($?) then |
50 | echo $0 $* FAILED |
51 | exit 1 |
52 | endif |
53 | time_index six=$high -t > high |
54 | |
55 | # now low and high are hour numbers and file low and file high are matching times. |
56 | |
57 | if ($#argv > 1) then # get coverage map |
58 | set minlow = $low |
59 | set maxhigh = $high |
60 | set miscargs |
61 | shift |
62 | while ($#argv > 0) |
63 | if ($1 =~ "low=*") then |
64 | set $1 |
65 | else if ($1 =~ "high=*") then |
66 | set $1 |
67 | else |
68 | set miscargs = "$miscargs $1" |
69 | endif |
70 | shift |
71 | end |
72 | set low = `time_index time=$low -6` |
73 | set high = `time_index time=$high -6` |
74 | if ($nancount == 2) then |
75 | show_coverage ds=$product low=$minlow high=$maxhigh -iq > coverage |
76 | else |
77 | show_coverage ds=$product low=$low high=$high -iq |
78 | endif |
79 | |
80 | endif |
81 | |
82 | set nowtxt = `date -u +%Y.%m.%d_%H:%M:%S` |
83 | echo $nowtxt > lastupdate |
84 | |
85 | rm -f statusbusy |