ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/proj/workflow/scripts/status-dsds_daily.csh
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

File Contents

# Content
1 #! /bin/csh -f
2
3 # status for DSDS 1-day 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
26 set low = `cat low`
27 set low_t = `time_convert time=$low`
28 set low = `time_convert zone=TAI s=$low_t`
29 set high = `cat high`
30 set high_t = `time_convert time=$high`
31 set high = `time_convert zone=TAI s=$high_t`
32
33 set nancount = 0
34
35 if ($low == "NaN") then
36 set nancount = 1
37 set low = `show_info -q $product'[^]' key=$key`
38 if ($?) then
39 echo $0 $* FAILED
40 exit 1
41 endif
42 time_index day=$low -t > low
43 else
44 set low = `time_index -d time=$low`
45 endif
46
47 if ($high == "NaN") @ nancount = $nancount + 1
48
49 set high = `show_info -q $product'[$]' key=$key`
50 if ($?) then
51 echo $0 $* FAILED
52 exit 1
53 endif
54 time_index day=$high -t > high
55
56 # now low and high are hour numbers and file low and file high are matching times.
57
58 if ($#argv > 1) then # get coverage map
59 set minlow = $low
60 set maxhigh = $high
61 set miscargs
62 shift
63 while ($#argv > 0)
64 if ($1 =~ "low=*") then
65 set $1
66 else if ($1 =~ "high=*") then
67 set $1
68 else
69 set miscargs = "$miscargs $1"
70 endif
71 shift
72 end
73 set low = `time_index time=$low -d`
74 set high = `time_index time=$high -d`
75 if ($nancount == 2) then
76 show_coverage ds=$product low=$minlow high=$maxhigh -iq > coverage
77 else
78 show_coverage ds=$product low=$low high=$high -iq
79 endif
80
81 endif
82
83 set nowtxt = `date -u +%Y.%m.%d_%H:%M:%S`
84 echo $nowtxt > lastupdate
85
86 rm -f statusbusy