Commit 23bdea95 authored by PIOLLE's avatar PIOLLE
Browse files

fixes for felyx compatibility

parent 2a6f6783
......@@ -73,20 +73,20 @@ class PointCollection(AbstractFeature):
"""
Returns the geolocation dimension names defining a point collection
"""
return ['time']
return ['obs']
def get_geolocation_dimsizes(self):
"""
Returns the geolocation dimension sizes of the grid object
"""
return OrderedDict([('time',
return OrderedDict([('obs',
len(self.get_times()))])
def get_geolocation_field_dimnames(self, fieldname):
"""
Returns the dimensions of a geolocation field
"""
return ('time',)
return ('obs',)
def save(self, output, attrs={}):
"""
......@@ -103,8 +103,8 @@ class PointCollection(AbstractFeature):
"""
if output.is_writable():
# creating dimensions
output.create_dim('time', self.get_times().size)
dims = ['time']
output.create_dim('obs', self.get_times().size)
dims = ['obs']
for v in self._fields.keys():
if v not in self._geolocation_fields:
for d in self._fields[v].dimensions:
......
......@@ -20,6 +20,7 @@ from dateutil import parser
from collections import OrderedDict
#import pdb
import cftime
import numpy
import netCDF4
......@@ -1484,9 +1485,11 @@ class NCFile(AbstractMapper):
= datetime.datetime.now().strftime(self.TIME_FORMAT)
# convert datetime objects to string
for att in attributes:
if isinstance(attributes[att], datetime.datetime):
attributes[att]\
if isinstance(attributes[att], (
datetime.datetime, cftime._cftime.DatetimeGregorian)):
attributes[att] \
= attributes[att].strftime(self.TIME_FORMAT)
# we try to keep some orderinf in the attributes
try:
for att in self.STANDARD_ATTRIBUTES_VALUES:
......
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