(file) Return to ingestsecs CVS log (file) (dir) Up to [Development] / JSOC / proj / globalhs / scripts

File: [Development] / JSOC / proj / globalhs / scripts / ingestsecs (download)
Revision: 1.3, Tue Jul 2 19:07:07 2013 UTC (5 years ago) by tplarson
Branch: MAIN
CVS Tags: Ver_LATEST, Ver_9-2, Ver_9-1, Ver_9-0, Ver_8-8, Ver_8-7, Ver_8-6, Ver_8-5, Ver_8-4, Ver_8-3, Ver_8-2, Ver_8-12, Ver_8-11, Ver_8-10, Ver_8-1, HEAD
Changes since 1.2: +5 -2 lines
added setting of PATH and checking of data VERSION to scripts

#! /bin/tcsh

# this script requires the following arguments:
# in    = text file defining sections to be ingested
# out   = name of dataseries to ingest file into
# day   = day number of first day of timeseries
# ndays = number of days in the timeseries

setenv PATH $JSOCROOT/bin/$JSOC_MACHINE':'$PATH

@ i = 1
while ($i <= $#argv )
  set $argv[$i]
@ i++
end

set epoch = `show_info -j $out | grep -i '^keyword:t_start_epoch' | cut -d, -f5`
set epochsecs = `time_convert o=jsoc time=$epoch`
set tstep = `show_info -j $out | grep -i '^keyword:t_step' | cut -d, -f5`

set startsecs = `echo "$epochsecs + ($day * 86400)" | bc`
set tstart = `time_convert s=$startsecs zone=TAI`
set stopsecs = `echo "$epochsecs + (($day + $ndays) * 86400)" | bc`
set tstop = `time_convert s=$stopsecs zone=TAI`
set midsecs = `echo "$epochsecs + (($day + ($ndays / 2)) * 86400)" | bc`
set tobs = `time_convert s=$midsecs zone=TAI`
set now = `date -u  +%Y.%m.%d_%T`

set ndt = `echo "($ndays * 86400) / $tstep" | bc`
set curdir = $PWD

set nsecs = `head -1 $in`
set secs = `tail -$nsecs $in`
set i=3
set string="$secs[1] $secs[2]"
while ($i <= $#secs)
@ j = $i + 1
  set string="$string\n$secs[$i] $secs[$j]"
@ i = $i + 2
end

set_info -c ds=$out T_START=$tstart T_STOP=$tstop T_OBS=$tobs DATE=$now NSECS=$nsecs SECS="$string" NDT=$ndt PATH="$curdir" FILE="$in"
exit $status

Karen Tian
Powered by
ViewCVS 0.9.4