# /bin/csh -f # Synopsis: # set_PCU_by_fsn Date # Where Date is a UT day in the form yyyy.mm.dd # Get list of FSN for this time. set echo set noglob set DATE = $1 set NOW = `date "+%Y%m%d"` set TMP = /tmp/pcufsn.$NOW.$$ set INTERVAL = 1d # if there are too many we may need to do this by hour instead of day show_keys "ds=su_karen.GroundTestFrame[][$DATE/$INTERVAL]" key=HSQFGSN -q | sort -n >$TMP # Loop through available images to get PCU keywords. cat $TMP foreach FSN (`cat $TMP`) show_keys "ds=hmi_ground.PCU_config[? recnum = (select recnum from hmi_ground.PCU_config where date <= (select observationtime from su_karen.groundtestframe where HSQFGSN = $FSN) order by date desc limit 1)?]" -k >$TMP cat $TMP if (`wc -l <$TMP` == 0) then echo Problem, no PCU data found for $TIME cat $TMP exit endif # now add these to series by FSN cat $TMP set_keys ds=hmi_ground.lev0_config fsn=$FSN -c @$TMP @ FSN = $FSN + 1 end