#!/bin/bash

# For use on MBARI's internal network with appropriate credentials

mkdir raw
rsync -rv mccann@elvis.shore.mbari.org:/mbari/ProjectLibrary/901006.BEDS/BEDS.Data/2013_07_18_Carson/raw/*.EVT raw

# Events  1 -  50: --lat 36.793458 --lon -121.845703 --depth 340
# Events 51 - 248: --lat 36.785428 --lon -121.903602 --depth 530
for f in raw/BED000[0-4][0-9].EVT raw/BED00050.EVT
do
    ./bed2netcdf.py --input $f --lat 36.793458 --lon -121.845703 --depth 340
done

for f in raw/BED0005[1-9].EVT raw/BED000[6-9][0-9].EVT raw/BED00[1-2][0-9][0-9].EVT
do
    ./bed2netcdf.py --input $f --lat 36.785428 --lon -121.903602 --depth 530
done

# Put netcdf files in ProjectLibrary
scp raw/*.nc mccann@elvis.shore.mbari.org:/mbari/ProjectLibrary/901006.BEDS/BEDS.Data/2013_07_18_Carson/netcdf

# Also copy to odss-staging thredds
scp raw/*.nc mccann@odss-test.shore.mbari.org:data/BEDS2013

# Clean up 
##rm -r raw

