Skip to content

Commit e5cdeec

Browse files
authored
Merge pull request #1 from ctroupin/opendap
Opendap
2 parents d879273 + d85890b commit e5cdeec

8 files changed

Lines changed: 278 additions & 1419 deletions

data/alborex_mean_sla.nc

2.37 MB
Binary file not shown.

python/alborexconfig.json

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,51 @@
11
{
22
"datafiles":{
3-
"adcp": "/home/ctroupin/Data/Alborex/ADCP/dep0023_socib-rv_scb-rdi001_L1_2014-05.nc",
4-
"ctd": "/home/ctroupin/Data/Alborex/CTD/dep0007_socib-rv_scb-sbe9002_L1_2014-05-25.nc",
5-
"ctdlegs": ["/home/ctroupin/Data/Alborex/CTD/ctd_positions_Leg1.txt",
6-
"/home/ctroupin/Data/Alborex/CTD/ctd_positions_Leg2.txt"],
3+
"coast": "/home/ctroupin/Data/Alborex/Coastline/coastline_f.dat",
4+
"altimetry": "../data/alborex_mean_sla.nc",
5+
"ctdlegs": ["../data/ctd_positions_Leg1.txt",
6+
"../data/ctd_positions_Leg2.txt"],
7+
"sst": ["../data/A2014145125000.L2_LAC_SST.nc",
8+
"../data/A2014150020500.L2_LAC_SST.nc"],
9+
"front": "../data/front_coordinates.dat",
10+
"adcp": "http://thredds.socib.es/thredds/dodsC/research_vessel/current_profiler/socib_rv-scb_rdi001/L1/2014/dep0023_socib-rv_scb-rdi001_L1_2014-05.nc",
11+
"ctd": "http://thredds.socib.es/thredds/dodsC/research_vessel/ctd/socib_rv-scb_sbe9002/L1_corr/2014/dep0007_socib-rv_scb-sbe9002_L1_corr_2014-05-25.nc",
712
"gliders": ["http://thredds.socib.es/thredds/dodsC/auv/glider/icoast00-ime_slcost000/L1/2014/dep0005_icoast00_ime-slcost000_L1_2014-05-25_data_dt.nc",
813
"http://thredds.socib.es/thredds/dodsC/auv/glider/ideep00-ime_sldeep000/L1/2014/dep0012_ideep00_ime-sldeep000_L1_2014-05-25_data_dt.nc"],
9-
"profilers": ["/home/ctroupin/Data/Alborex/Profilers/dep0001_profiler-drifter-arvora3001_ogs-arvora3001_L1_2014-05-25.nc",
10-
"/home/ctroupin/Data/Alborex/Profilers/dep0001_profiler-drifter-provbioll001_ogs-provbioll001_L1_2014-05-25.nc"],
11-
"coast": "/home/ctroupin/Data/Alborex/Coastline/coastline_cartex_f3.txt",
12-
"rv": "/home/ctroupin/Data/Alborex/RV/dep0015_socib-rv_scb-pos001_L1_2014-05-25.nc",
13-
"altimetry": "/home/ctroupin/Data/Alborex/Altimetry/mean.nc",
14-
"coast": "/home/ctroupin/Data/Alborex/Coastline/coastline_f.dat",
15-
"thermosal": "/home/ctroupin/Data/Alborex/RV/dep0015_socib-rv_scb-tsl001_L1_2014-05-25_HR.nc"
16-
},
17-
"datadirs":{
18-
"sst": "/home/ctroupin/Data/Alborex/SST/",
19-
"drifters": "/home/ctroupin/Data/Alborex/Drifters",
20-
"profilers": "/home/ctroupin/Data/Alborex/Profilers",
21-
"adcp": "/home/ctroupin/Data/Alborex/ADCP",
22-
"gliders": "/home/ctroupin/Data/Alborex/Gliders"
14+
"profilers": ["http://thredds.socib.es/thredds/dodsC/drifter/profiler_drifter/profiler_drifter_arvora3001-ogs_arvora3001/L1/2014/dep0001_profiler-drifter-arvora3001_ogs-arvora3001_L1_2014-05-25.nc",
15+
"http://thredds.socib.es/thredds/dodsC/drifter/profiler_drifter/profiler_drifter_provbioll001-ogs_provbioll001/L1/2014/dep0001_profiler-drifter-provbioll001_ogs-provbioll001_L1_2014-05-25.nc",
16+
"http://thredds.socib.es/thredds/dodsC/drifter/profiler_drifter/profiler_drifter_arvorc001-ime_arvorc001/L1/2014/dep0001_profiler-drifter-arvorc001_ime-arvorc001_L1_2014-05-25.nc"],
17+
"drifters": ["http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp018-scb_svp013/L1/2014/dep0001_drifter-svp018_scb-svp013_L1_2014-05-25.nc",
18+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp019-scb_svp014/L1/2014/dep0001_drifter-svp019_scb-svp014_L1_2014-05-25.nc",
19+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp020-scb_svp015/L1/2014/dep0001_drifter-svp020_scb-svp015_L1_2014-05-28.nc",
20+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp021-scb_svp016/L1/2014/dep0001_drifter-svp021_scb-svp016_L1_2014-05-25.nc",
21+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp022-scb_svp017/L1/2014/dep0001_drifter-svp022_scb-svp017_L1_2014-05-25.nc",
22+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp024-scb_svp019/L1/2014/dep0001_drifter-svp024_scb-svp019_L1_2014-05-25.nc",
23+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp025-scb_svp020/L1/2014/dep0001_drifter-svp025_scb-svp020_L1_2014-05-25.nc",
24+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp027-scb_svp022/L1/2014/dep0001_drifter-svp027_scb-svp022_L1_2014-05-25.nc",
25+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp036-ime_svp007/L1/2014/dep0001_drifter-svp036_ime-svp007_L1_2014-05-25.nc",
26+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp037-ime_svp008/L1/2014/dep0001_drifter-svp037_ime-svp008_L1_2014-05-25.nc",
27+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp038-ime_svp009/L1/2014/dep0001_drifter-svp038_ime-svp009_L1_2014-05-25.nc",
28+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp039-ime_svp010/L1/2014/dep0001_drifter-svp039_ime-svp010_L1_2014-05-25.nc",
29+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp040-ime_svp011/L1/2014/dep0001_drifter-svp040_ime-svp011_L1_2014-05-25.nc",
30+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp041-ime_svp012/L1/2014/dep0001_drifter-svp041_ime-svp012_L1_2014-05-25.nc",
31+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp042-ime_svp006/L1/2014/dep0001_drifter-svp042_ime-svp006_L1_2014-05-25.nc",
32+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp043-ogs_svp001/L1/2014/dep0001_drifter-svp043_ogs-svp001_L1_2014-05-25.nc",
33+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp044-ogs_svp002/L1/2014/dep0001_drifter-svp044_ogs-svp002_L1_2014-05-25.nc",
34+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp045-ogs_svp003/L1/2014/dep0001_drifter-svp045_ogs-svp003_L1_2014-05-25.nc",
35+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp046-ogs_svp004/L1/2014/dep0001_drifter-svp046_ogs-svp004_L1_2014-05-25.nc",
36+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp047-ogs_svp005/L1/2014/dep0001_drifter-svp047_ogs-svp005_L1_2014-05-25.nc",
37+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp048-ime_svp013/L1/2014/dep0001_drifter-svp048_ime-svp013_L1_2014-05-25.nc",
38+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp049-ime_svp014/L1/2014/dep0001_drifter-svp049_ime-svp014_L1_2014-05-25.nc",
39+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp051-ime_svp016/L1/2014/dep0001_drifter-svp051_ime-svp016_L1_2014-05-25.nc",
40+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp052-ime_svp017/L1/2014/dep0001_drifter-svp052_ime-svp017_L1_2014-05-25.nc",
41+
"http://thredds.socib.es/thredds/dodsC/drifter/surface_drifter/drifter_svp054-ime_svp019/L1/2014/dep0001_drifter-svp054_ime-svp019_L1_2014-05-25.nc"],
42+
"rv": "http://thredds.socib.es/thredds/dodsC/research_vessel/gps/socib_rv-scb_pos001/L1/2014/05/dep0015_socib-rv_scb-pos001_L1_2014-05-25.nc",
43+
"thermosal": "http://thredds.socib.es/thredds/dodsC/research_vessel/thermosalinometer/socib_rv-scb_tsl001/L1/2014/05/dep0015_socib-rv_scb-tsl001_L1_2014-05-25.nc",
44+
"sstremote": ["https://oceandata.sci.gsfc.nasa.gov/cgi/getfile/A2014145125000.L2_LAC_SST.nc",
45+
"https://oceandata.sci.gsfc.nasa.gov/cgi/getfile/A2014150020500.L2_LAC_SST.nc"]
2346
},
24-
"figdir": "/home/ctroupin/Publis/201703_AlborexData/figures",
25-
"figdirleaflet": "/home/ctroupin/Publis/201703_AlborexData/leaflet/images/",
47+
"figdir": "../figures",
48+
"figdirleaflet": "../leaflet/images/",
2649
"domain":{
2750
"coordinates1": [-6.75, 3.001, 34.75, 40.0],
2851
"coordinates2": [-1.0, -0.25, 36.65, 37.25],

python/alborexdata.py

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -179,27 +179,27 @@ def get_from_netcdf(self, datafile):
179179
"""
180180
Read the coordinates and the temperature from existing data file
181181
"""
182-
if os.path.exists(datafile):
183-
with netCDF4.Dataset(datafile, 'r') as nc:
184-
self.lon = nc.get_variables_by_attributes(standard_name='longitude')[0][:]
185-
self.lat = nc.get_variables_by_attributes(standard_name='latitude')[0][:]
186-
self.time = nc.get_variables_by_attributes(standard_name='time')[0][:]
187-
self.timeunits = nc.get_variables_by_attributes(standard_name='time')[0].units
188-
self.dates = netCDF4.num2date(self.time, self.timeunits)
189182

190-
try:
191-
self.qclat = nc.get_variables_by_attributes(standard_name='latitude status_flag')[0][:]
192-
except IndexError:
193-
self.qclat = None
183+
with netCDF4.Dataset(datafile, 'r') as nc:
184+
self.lon = nc.get_variables_by_attributes(standard_name='longitude')[0][:]
185+
self.lat = nc.get_variables_by_attributes(standard_name='latitude')[0][:]
186+
self.time = nc.get_variables_by_attributes(standard_name='time')[0][:]
187+
self.timeunits = nc.get_variables_by_attributes(standard_name='time')[0].units
188+
self.dates = netCDF4.num2date(self.time, self.timeunits)
194189

195-
try:
196-
self.qclon = nc.get_variables_by_attributes(standard_name='longitude status_flag')[0][:]
197-
except IndexError:
198-
self.qclon = None
199-
try:
200-
self.temperature = nc.get_variables_by_attributes(standard_name='sea_water_temperature')[0][:]
201-
except IndexError:
202-
self.temperature = None
190+
try:
191+
self.qclat = nc.get_variables_by_attributes(standard_name='latitude status_flag')[0][:]
192+
except IndexError:
193+
self.qclat = None
194+
195+
try:
196+
self.qclon = nc.get_variables_by_attributes(standard_name='longitude status_flag')[0][:]
197+
except IndexError:
198+
self.qclon = None
199+
try:
200+
self.temperature = nc.get_variables_by_attributes(standard_name='sea_water_temperature')[0][:]
201+
except IndexError:
202+
self.temperature = None
203203

204204
def apply_qc_latlon(self, QC=[1]):
205205
"""
@@ -304,15 +304,14 @@ def get_from_netcdf(self, datafile):
304304
"""
305305
Read the coordinates and the field values from a netCDF file
306306
"""
307-
if os.path.exists(datafile):
308-
with netCDF4.Dataset(datafile, 'r') as nc:
309-
self.lon = nc.get_variables_by_attributes(standard_name='longitude')[0][:]
310-
self.lat = nc.get_variables_by_attributes(standard_name='latitude')[0][:]
311-
self.time = nc.get_variables_by_attributes(standard_name='time')[0][:]
312-
timeunits = nc.get_variables_by_attributes(standard_name='time')[0].units
313-
self.dates = netCDF4.num2date(self.time, timeunits)
314-
self.salinity = nc.get_variables_by_attributes(standard_name='sea_water_salinity')[0][:]
315-
self.temperature = nc.get_variables_by_attributes(standard_name='sea_water_temperature')[0][:]
307+
with netCDF4.Dataset(datafile, 'r') as nc:
308+
self.lon = nc.get_variables_by_attributes(standard_name='longitude')[0][:]
309+
self.lat = nc.get_variables_by_attributes(standard_name='latitude')[0][:]
310+
self.time = nc.get_variables_by_attributes(standard_name='time')[0][:]
311+
timeunits = nc.get_variables_by_attributes(standard_name='time')[0].units
312+
self.dates = netCDF4.num2date(self.time, timeunits)
313+
self.salinity = nc.get_variables_by_attributes(standard_name='sea_water_salinity')[0][:]
314+
self.temperature = nc.get_variables_by_attributes(standard_name='sea_water_temperature')[0][:]
316315

317316
class CTD():
318317

python/figure1_AlborexData.ipynb

Lines changed: 0 additions & 527 deletions
This file was deleted.

0 commit comments

Comments
 (0)