Skip to content
Snippets Groups Projects
Commit f9cade63 authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

add BATH

parent 5fa0b2d3
No related branches found
No related tags found
No related merge requests found
......@@ -31,10 +31,10 @@ def writeHeader(hdrFile, cfg, fe, r, variables_1D, device):
# 00001 18/02/2020 19:04:19 18/02/2020 22:41:07 11°28.85 N 023°00.59 W 4063 5083 fr30001
# add PROFILE and END_PROFILE_TIME, BATH
for i in range(fe.n):
print("{:0>5d} {} {} {}".format(i+1, tools.julian2dt(fe['TIME'][i]).strftime("%d/%m/%Y %H:%M:%S"),
tools.Dec2dmc(fe['LATITUDE'][i],'N'), tools.Dec2dmc(fe['LONGITUDE'][i],'W')))
f.write("{:0>5d} {} {} {}\n".format(i+1, tools.julian2dt(fe['TIME'][i]).strftime("%d/%m/%Y %H:%M:%S"),
tools.Dec2dmc(fe['LATITUDE'][i],'N'), tools.Dec2dmc(fe['LONGITUDE'][i],'W')))
print("{:0>5d} {} {} {} {}".format(i+1, tools.julian2dt(fe['TIME'][i]).strftime("%d/%m/%Y %H:%M:%S"),
tools.Dec2dmc(fe['LATITUDE'][i],'N'), tools.Dec2dmc(fe['LONGITUDE'][i],'W'), fe['BATH'][i]))
f.write("{:0>5d} {} {} {} {}\n".format(i+1, tools.julian2dt(fe['TIME'][i]).strftime("%d/%m/%Y %H:%M:%S"),
tools.Dec2dmc(fe['LATITUDE'][i],'N'), tools.Dec2dmc(fe['LONGITUDE'][i],'W'), fe['BATH'][i]))
f.close()
......
......@@ -52,8 +52,14 @@ def writeNetCDF(cfg, device, fe, r, variables_1D):
# create the variable
if any(key in item for item in variables_1D):
ncvars[key] = nc.createVariable(
key, dtype(hash['types']).char, (key,), fill_value=fillvalue)
try:
# create variable whit same dimension name, as TIME(TIME)
ncvars[key] = nc.createVariable(
key, dtype(hash['types']).char, (key,), fill_value=fillvalue)
except:
# for BATH(TIME), it's a mess !
ncvars[key] = nc.createVariable(
key, dtype(hash['types']).char, 'TIME', fill_value=fillvalue)
else:
ncvars[key] = nc.createVariable(
key, dtype(hash['types']).char, dims_2D, fill_value=fillvalue)
......
......@@ -17,7 +17,7 @@ from physical_parameter import Roscop
# typeInstrument is a dictionary as key: files extension
typeInstrument = {'CTD': ('cnv', 'CNV'), 'XBT': (
'EDF', 'edf'), 'LADCP': ('lad', 'LAD'), 'TSG': 'COLCOR'}
variables_1D = ['TIME', 'LATITUDE', 'LONGITUDE']
variables_1D = ['TIME', 'LATITUDE', 'LONGITUDE','BATH']
ti = typeInstrument # an alias
filesBrowsePosition_row = 2
filesBrowsePosition_column = 1
......
......@@ -34,7 +34,7 @@ instrumentNumber = "09P1263"
LONGITUDE = 'NMEA\s+Longitude\s*[:=]\s*(\d+)\s+(\d+.\d+)\s+(\w)'
DATE = 'Date\s*:\s*(\d+)/(\d+)/(\d+)'
TIME = '[Heure|Hour]\s*:\s*(\d+)[:hH](\d+):(\d+)'
bottomDepth = 'Bottom Depth\s*:\s*(\d*\.?\d+?)\s*\S*'
BATH = 'Bottom Depth\s*:\s*(\d*\.?\d+?)\s*\S*'
operator = 'Operator\s*:\s*(.*)'
type = 'Type\s*:\s*(.*)'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment