Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added data/alborex_mean_sla.nc
Binary file not shown.
63 changes: 43 additions & 20 deletions python/alborexconfig.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,51 @@
{
"datafiles":{
"adcp": "/home/ctroupin/Data/Alborex/ADCP/dep0023_socib-rv_scb-rdi001_L1_2014-05.nc",
"ctd": "/home/ctroupin/Data/Alborex/CTD/dep0007_socib-rv_scb-sbe9002_L1_2014-05-25.nc",
"ctdlegs": ["/home/ctroupin/Data/Alborex/CTD/ctd_positions_Leg1.txt",
"/home/ctroupin/Data/Alborex/CTD/ctd_positions_Leg2.txt"],
"coast": "/home/ctroupin/Data/Alborex/Coastline/coastline_f.dat",
"altimetry": "../data/alborex_mean_sla.nc",
"ctdlegs": ["../data/ctd_positions_Leg1.txt",
"../data/ctd_positions_Leg2.txt"],
"sst": ["../data/A2014145125000.L2_LAC_SST.nc",
"../data/A2014150020500.L2_LAC_SST.nc"],
"front": "../data/front_coordinates.dat",
"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",
"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",
"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",
"http://thredds.socib.es/thredds/dodsC/auv/glider/ideep00-ime_sldeep000/L1/2014/dep0012_ideep00_ime-sldeep000_L1_2014-05-25_data_dt.nc"],
"profilers": ["/home/ctroupin/Data/Alborex/Profilers/dep0001_profiler-drifter-arvora3001_ogs-arvora3001_L1_2014-05-25.nc",
"/home/ctroupin/Data/Alborex/Profilers/dep0001_profiler-drifter-provbioll001_ogs-provbioll001_L1_2014-05-25.nc"],
"coast": "/home/ctroupin/Data/Alborex/Coastline/coastline_cartex_f3.txt",
"rv": "/home/ctroupin/Data/Alborex/RV/dep0015_socib-rv_scb-pos001_L1_2014-05-25.nc",
"altimetry": "/home/ctroupin/Data/Alborex/Altimetry/mean.nc",
"coast": "/home/ctroupin/Data/Alborex/Coastline/coastline_f.dat",
"thermosal": "/home/ctroupin/Data/Alborex/RV/dep0015_socib-rv_scb-tsl001_L1_2014-05-25_HR.nc"
},
"datadirs":{
"sst": "/home/ctroupin/Data/Alborex/SST/",
"drifters": "/home/ctroupin/Data/Alborex/Drifters",
"profilers": "/home/ctroupin/Data/Alborex/Profilers",
"adcp": "/home/ctroupin/Data/Alborex/ADCP",
"gliders": "/home/ctroupin/Data/Alborex/Gliders"
"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",
"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",
"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"],
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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"],
"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",
"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",
"sstremote": ["https://oceandata.sci.gsfc.nasa.gov/cgi/getfile/A2014145125000.L2_LAC_SST.nc",
"https://oceandata.sci.gsfc.nasa.gov/cgi/getfile/A2014150020500.L2_LAC_SST.nc"]
},
"figdir": "/home/ctroupin/Publis/201703_AlborexData/figures",
"figdirleaflet": "/home/ctroupin/Publis/201703_AlborexData/leaflet/images/",
"figdir": "../figures",
"figdirleaflet": "../leaflet/images/",
"domain":{
"coordinates1": [-6.75, 3.001, 34.75, 40.0],
"coordinates2": [-1.0, -0.25, 36.65, 37.25],
Expand Down
55 changes: 27 additions & 28 deletions python/alborexdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,27 +179,27 @@ def get_from_netcdf(self, datafile):
"""
Read the coordinates and the temperature from existing data file
"""
if os.path.exists(datafile):
with netCDF4.Dataset(datafile, 'r') as nc:
self.lon = nc.get_variables_by_attributes(standard_name='longitude')[0][:]
self.lat = nc.get_variables_by_attributes(standard_name='latitude')[0][:]
self.time = nc.get_variables_by_attributes(standard_name='time')[0][:]
self.timeunits = nc.get_variables_by_attributes(standard_name='time')[0].units
self.dates = netCDF4.num2date(self.time, self.timeunits)

try:
self.qclat = nc.get_variables_by_attributes(standard_name='latitude status_flag')[0][:]
except IndexError:
self.qclat = None
with netCDF4.Dataset(datafile, 'r') as nc:
self.lon = nc.get_variables_by_attributes(standard_name='longitude')[0][:]
self.lat = nc.get_variables_by_attributes(standard_name='latitude')[0][:]
self.time = nc.get_variables_by_attributes(standard_name='time')[0][:]
self.timeunits = nc.get_variables_by_attributes(standard_name='time')[0].units
self.dates = netCDF4.num2date(self.time, self.timeunits)

try:
self.qclon = nc.get_variables_by_attributes(standard_name='longitude status_flag')[0][:]
except IndexError:
self.qclon = None
try:
self.temperature = nc.get_variables_by_attributes(standard_name='sea_water_temperature')[0][:]
except IndexError:
self.temperature = None
try:
self.qclat = nc.get_variables_by_attributes(standard_name='latitude status_flag')[0][:]
except IndexError:
self.qclat = None

try:
self.qclon = nc.get_variables_by_attributes(standard_name='longitude status_flag')[0][:]
except IndexError:
self.qclon = None
try:
self.temperature = nc.get_variables_by_attributes(standard_name='sea_water_temperature')[0][:]
except IndexError:
self.temperature = None

def apply_qc_latlon(self, QC=[1]):
"""
Expand Down Expand Up @@ -304,15 +304,14 @@ def get_from_netcdf(self, datafile):
"""
Read the coordinates and the field values from a netCDF file
"""
if os.path.exists(datafile):
with netCDF4.Dataset(datafile, 'r') as nc:
self.lon = nc.get_variables_by_attributes(standard_name='longitude')[0][:]
self.lat = nc.get_variables_by_attributes(standard_name='latitude')[0][:]
self.time = nc.get_variables_by_attributes(standard_name='time')[0][:]
timeunits = nc.get_variables_by_attributes(standard_name='time')[0].units
self.dates = netCDF4.num2date(self.time, timeunits)
self.salinity = nc.get_variables_by_attributes(standard_name='sea_water_salinity')[0][:]
self.temperature = nc.get_variables_by_attributes(standard_name='sea_water_temperature')[0][:]
with netCDF4.Dataset(datafile, 'r') as nc:
self.lon = nc.get_variables_by_attributes(standard_name='longitude')[0][:]
self.lat = nc.get_variables_by_attributes(standard_name='latitude')[0][:]
self.time = nc.get_variables_by_attributes(standard_name='time')[0][:]
timeunits = nc.get_variables_by_attributes(standard_name='time')[0].units
self.dates = netCDF4.num2date(self.time, timeunits)
self.salinity = nc.get_variables_by_attributes(standard_name='sea_water_salinity')[0][:]
self.temperature = nc.get_variables_by_attributes(standard_name='sea_water_temperature')[0][:]

class CTD():

Expand Down
527 changes: 0 additions & 527 deletions python/figure1_AlborexData.ipynb

This file was deleted.

Loading