Commit e988bf9d authored by ARCHER's avatar ARCHER

corrected dims / changed names

parent da622e37
......@@ -144,6 +144,7 @@ def writeLight(fname,data,date,meta=None):
"""
# version number
names_mapping = OrderedDict([
('owiLon' , 'lon'),
('owiLat' , 'lat'),
......@@ -151,8 +152,8 @@ def writeLight(fname,data,date,meta=None):
('owiWindDirection' , 'wind_to_direction'),
('owiWindQuality' , 'quality_flag'),
('owiLandFlag' , 'land_flag'),
('owiPreProcessing/ND_2','radar_image_co'),
('owiPreProcessing/ND_2_cross' , 'radar_image_cr'),
('owiPreProcessing/ND_2','nrcs_detrend_co'),
('owiPreProcessing/ND_2_cross' , 'nrcs_detrend_cr'),
('owiPreProcessing/FilterBinary_1' , 'heterogeneity_co_h'),
('owiPreProcessing/FilterBinary_2' , 'heterogeneity_co_m'),
('owiPreProcessing/FilterBinary_3' , 'heterogeneity_co_l'),
......@@ -182,11 +183,11 @@ def writeLight(fname,data,date,meta=None):
},
'wind_to_direction': {
'long_name' : 'Wind to direction (oceanographic convention)',
'units' : 'degrees'
'units' : 'degrees',
# 'usage_level' : "basic"
}
}
X,Y = data['owiLon'].shape
dims = (X,Y)
X,Y = data['owiLon'].T.shape
nc=netCDF4.Dataset(fname, 'w', format='NETCDF4')
nc.createDimension('time',1)
nc.createDimension('Y',Y)
......@@ -196,6 +197,7 @@ def writeLight(fname,data,date,meta=None):
nc.institution = 'IFREMER LOPS/SIAM'
nc.reference = 'Mouche Alexis, Chapron Bertrand, Knaff John, Zhao Yuan, Zhang Biao, Combot Clement (2019). Copolarized and Cross‐Polarized SAR Measurements for High‐Resolution Description of Major Hurricane Wind Structures: Application to Irma Category 5 Hurricane. Journal Of Geophysical Research-oceans, 124(6), 3905-3922. https://doi.org/10.1029/2019JC015056'
nc.measurementDate = date.strftime("%Y-%m-%dT%H:%M:%SZ")
#nc.version = "???" # TODO : add version string
for global_attr in global_attrs:
try:
setattr(nc, global_attr, meta[global_attr])
......@@ -210,7 +212,7 @@ def writeLight(fname,data,date,meta=None):
time[::] = (date - epoch).total_seconds() # works for python < 3.3
for in_name in names_mapping.keys():
if in_name in data:
value = data[in_name]
value = data[in_name].T
out_name = names_mapping[in_name]
try:
fill_value=data[in_name].fill_value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment