Skip to content

Commit

Permalink
Add agency and observer in information that com from sitelog
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbapt committed Sep 23, 2022
1 parent fef45c7 commit 6cd09ac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
16 changes: 12 additions & 4 deletions CODE/shells/gnss_make_rinex
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ for station in $NODES; do
anttype=$($PROGDIR/sitelog2json "$SITELOG" $FID $ymd|jq '.at' | tr -d '"')
antnum=$($PROGDIR/sitelog2json "$SITELOG" $FID $ymd|jq '.an' | tr -d '"')
posxyz=$($PROGDIR/sitelog2json "$SITELOG" $FID $ymd|jq '.px' | tr -d '"')
alertheader=" $DAYLYMSG sitelog: receiver = '$receiver' - antenna type = '$anttype' - antenna s/n = '$antnum' (will use rinex header if empty)"
observer=$($PROGDIR/sitelog2json "$SITELOG" $FID $ymd|jq '.op' | tr -d '"')
agency=$($PROGDIR/sitelog2json "$SITELOG" $FID $ymd|jq '.ag' | tr -d '"')
alertheader=" $DAYLYMSG sitelog: receiver='$receiver' - antenna type='$anttype' - antenna s/n='$antnum' - observer='$observer' - agency='$agency' (will use rinex header if empty)"
else
echo " $DAYLYMSG - Warning - sitelog : SITELOG is empty in .rc file !!!"
fi
Expand All @@ -178,7 +180,7 @@ for station in $NODES; do
echo " $DAYLYMSG - Warning - bad site information source "
esac
fi
if [[ ! -z "$receiver$anttype$antnum$posxyz" ]]; then
if [[ ! -z "$receiver$anttype$antnum$posxyz$observer$agency" ]]; then
echo "$alertheader"
# transform site imformation in teqc option
if [ ! -z "$receiver" ]; then
Expand All @@ -193,16 +195,22 @@ for station in $NODES; do
if [ ! -z "$posxyz" ]; then
posxyz=" -O.px $posxyz"
fi
if [ ! -z "$observer" ]; then
observer=" -O.op $observer"
fi
if [ ! -z "$agency" ]; then
agency=" -O.ag $agency"
fi
else
echo " $DAYLYMSG - Warning - No site information fond in $INFOSRC, Rinex will be generated whithout overwriting headers if empty"
fi


# makes Rinex daily file from raw data (see raw2rinex script)
mkdir -p $RINEX
$PROGDIR/raw2rinex "$RAW" $RINEX $TEQCOPTIONS -O.mn \"$FID\" -O.mo \"$FID\" $receiver $anttype $antnum $posxyz
$PROGDIR/raw2rinex "$RAW" $RINEX $TEQCOPTIONS -O.mn \"$FID\" -O.mo \"$FID\" $receiver $anttype $antnum $posxyz $observer $agency
if [[ ! -z $VERBOSE || $? != 0 ]]; then
echo " $PROGDIR/raw2rinex \"$RAW\" $RINEX $TEQCOPTIONS -O.mn \"$FID\" -O.mo \"$FID\" $receiver $anttype $antnum $posxyz"
echo " $PROGDIR/raw2rinex \"$RAW\" $RINEX $TEQCOPTIONS -O.mn \"$FID\" -O.mo \"$FID\" $receiver $anttype $antnum $posxyz $observer $agency"
fi
else
echo " $DAYLYMSG no data to process in $RAW."
Expand Down
4 changes: 2 additions & 2 deletions CODE/shells/gnss_make_rinex.rc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NODEROOT=/etc/webobs.d/GRID2NODES/$GRID.
# it can be a site_log file, a station.info file (Gamit), or the webobs node informations
# this option can be also pass in parameters with "-i"
# valid variables are : SITELOG (recommended) / WEBOBS / STATION_INFO
INFOSRC=WEBOBS
INFOSRC=SITELOG

# site information source parameters :
# - sitelog directory, must be filled to use SITELOG as INFOSRC
Expand All @@ -37,5 +37,5 @@ FMT='$FROM/$FID/$yyyy/$mm/$dd'
DEST=/opt/webobs/rawdata

# teqc options: Please take a deep look at www.unavco.org TEQC tutorial!
TEQCOPTIONS="+quiet -O.ag 'IPGP' -O.op 'WO' -O.pe 0 0 0 -C2 -O.-obs C2 -O.-obs C5 -O.dec 30s -max_rx_SVs 50 -n_GLONASS 27"
TEQCOPTIONS='+quiet -O.pe 0 0 0 -C2 -O.-obs C2 -O.-obs C5 -O.dec 30s -max_rx_SVs 50 -n_GLONASS 27'

3 changes: 3 additions & 0 deletions CODE/shells/sitelog2json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ fi
if [ ! -z "$FILE" ]; then
#******************* site *******************
JSON={\"mo\":\"${SITE}\"
#******************* Serial number *******************
JSON=$JSON,\"sn\":\"$(sed -n "/^1\. /,/Site Name/p" ${FILE} | tail -n1 | sed -e 's/^.*: //g')\"
#******************* Approximative position *******************
JSON=$JSON,\"px\":\"$(sed -n "/^2\. /,/Z coordinate/p" ${FILE} | tail -n3 | sed -e 's/^.*: //g')\"
Expand All @@ -67,7 +68,9 @@ if [ ! -z "$FILE" ]; then
awk -F '\t' -v date="${DATE}" '{ if (date >= $12 && date <= $13) \
printf ",\"at\":\"%s\",\"an\":\"%s\",\"pe\":\"%1.4f %1.4f %1.4f\"", $1, $2, $4, $5, $6 }'
)
#******************* Observer *******************
JSON=$JSON,\"op\":\"$(sed -n "/^11\. /,/Abbreviation/p" ${FILE} | tail -n1 | sed -e 's/^.*: //g')\"
#******************* Agency ******************
JSON=$JSON,\"ag\":\"$(sed -n "/^12\. /,/Abbreviation/p" ${FILE} | tail -n1 | sed -e 's/^.*: //g')\"}
echo $JSON
fi

0 comments on commit 6cd09ac

Please sign in to comment.