<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/bin/csh
alias julian /users/rsg/panorama/panorama.svn/bin/julian

set execdir = /users/rsg/observatory/buoy/pml/bin
set downloaddir = /data/datasets/Buoys/E1/download/ODAS51/
set wavedir = /data/datasets/Buoys/E1/download/waves/
set finaldir = /data/datasets/Buoys/E1/download/
set wavecodedir = /users/rsg/observatory/buoy/pml/bin/AMOS2XBinaryCoder-1.0

set base = 144
set HH = `date --utc +%k`
@ base = $base + $HH

# 2023 - two units for redundancy
set UnitID_atm1 = '300025010712790'
set UnitID_atm2 = '300025010534820'

# From 2022 the wave files are encoded in binary
pushd $wavecodedir
set waveheader = `cat $wavecodedir/bf-128.csv | head -1`
echo $waveheader &gt; /tmp/E1buoy_waves_wave_only.csv
foreach infile ( `find $wavedir -name ${UnitID_atm1}\*.sbd -size +300c` )
   echo $infile
   /bin/scp $infile $wavecodedir/dataoutput.sbd
   set outputdata = `$wavecodedir/DataformatDecoder.py`
   echo $outputdata | sed 's/\[//' | sed 's/\]//' &gt;&gt; /tmp/E1buoy_waves_wave_only.csv
end
popd
/bin/mv /tmp/E1buoy_waves_wave_only.csv $finaldir/E1buoy_waves_wave_only.csv

pushd $wavecodedir
set waveheader = `cat $wavecodedir/bf-128.csv | head -1`
echo $waveheader &gt; /tmp/E1buoy_waves_wave_only.csv
foreach infile ( `find $wavedir -name ${UnitID_atm2}\*.sbd -size +300c` )
   echo $infile
   /bin/scp $infile $wavecodedir/dataoutput.sbd
   set outputdata = `$wavecodedir/DataformatDecoder.py`
   echo $outputdata | sed 's/\[//' | sed 's/\]//' &gt;&gt; /tmp/E1buoy_waves_wave_only.csv
end
popd
/bin/mv /tmp/E1buoy_waves_wave_only.csv $finaldir/E1buoy_waves2_wave_only.csv

exit(0)
</pre></body></html>