-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_PacificGyre.sh
executable file
·36 lines (25 loc) · 1.23 KB
/
get_PacificGyre.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
#
# As was used for Greenland2011. Has now been superceeded by get_PacificGyre.py
#
# ELD
# 7/27/2012
#
cd /home/dobbins/drifters/test_microstar
# API as of Dec 2011 (includes salinity sensors)
# Use this to get the command: http://api.pacificgyre.com/pgapi/
# brute
# wget --quiet -O SFOS-I-0001_v2.csv "http://api.pacificgyre.com/pgapi/getData.aspx?userName=SFOS&password=*****&format=CSV&deviceNames=SFOS-I-0001&startDate=08/20/2011&commentCharacters=%&delimiter=,"
# wget --quiet -O SFOS-I-0002_v2.csv "http://api.pacificgyre.com/pgapi/getData.aspx?userName=SFOS&password=*****&format=CSV&deviceNames=SFOS-I-0002&startDate=08/17/2011&commentCharacters=%&delimiter=,"
# fancy with removal of bad points
drifterids="SFOS-I-0001 SFOS-I-0002"
for drifterid in $drifterids
do
wget --quiet -O ${drifterid}_orig.csv "http://api.pacificgyre.com/pgapi/getData.aspx?userName=SFOS&password=*****&format=CSV&deviceNames=${drifterid}&startDate=08/17/2011&enddate=12/31/2012%2023:59&commentCharacters=%&delimiter=,"
awk '{
split($0,arr,",")
if(arr[7] == 3 || arr[7] == "gpsQuality") { print $0 }
}' ${drifterid}_orig.csv > tmp.csv
mv tmp.csv ${drifterid}.csv
done
cp *.csv /var/www/html/artlab/data/csv/drifters