Esempio n. 1
0
    def __init__(self, *args, **kwargs):
        if kwargs.get('value') is None and kwargs.get('data') is None:
            msg = 'Without a "data" object, "value" is required.'
            raise ValueError(msg)

        self._bounds = None
        self._name_bounds = None
        self._name_bounds_tuple = None

        self.name_bounds_dimension = kwargs.pop('name_bounds_dimension', OCGIS_BOUNDS)
        bounds = kwargs.pop('bounds', None)
        # used for creating name_bounds as well as the name of the bounds dimension in netCDF
        self.name_bounds = kwargs.pop('name_bounds', None)
        self.name_bounds_tuple = kwargs.pop('name_bounds_tuple', None)
        self.axis = kwargs.pop('axis', None)
        # if True, bounds were interpolated. if False, they were loaded from source data. used in conforming units.
        self._has_interpolated_bounds = False

        AbstractSourcedVariable.__init__(self, kwargs.pop('data', None), kwargs.pop('src_idx', None))
        AbstractUidValueDimension.__init__(self, *args, **kwargs)

        # setting bounds requires checking the data type of value set in a superclass.
        self.bounds = bounds

        # conform any units if they provided. check they are not equivalent first
        if self.conform_units_to is not None:
            if not self.conform_units_to.equals(self.cfunits):
                self.cfunits_conform(self.conform_units_to)
Esempio n. 2
0
 def __init__(self,*args,**kwds):
     bounds = kwds.pop('bounds',None)
     self.name_bounds = kwds.pop('name_bounds',None)
     self._axis = kwds.pop('axis',None)
     
     AbstractSourcedVariable.__init__(self,kwds.pop('data',None),src_idx=kwds.pop('src_idx',None),value=kwds.get('value'))
     AbstractUidValueDimension.__init__(self,*args,**kwds)
     
     ## setting bounds requires checking the data type of value set in a
     ## superclass.
     self.bounds = bounds
     
     if self._axis is None:
         self._axis = 'undefined'
Esempio n. 3
0
 def __init__(self,*args,**kwds):
     bounds = kwds.pop('bounds',None)
     self.name_bounds = kwds.pop('name_bounds',None)
     self._axis = kwds.pop('axis',None)
     ## if True, an attempt will be made to interpolate bounds if None are
     ## provided.
     self._interpolate_bounds = kwds.pop('interpolate_bounds',False)
     ## if True, bounds were interpolated. if False, they were loaded from
     ## source data
     self._has_interpolated_bounds = False
     
     AbstractSourcedVariable.__init__(self,
                                      kwds.pop('data',None),
                                      src_idx=kwds.pop('src_idx',None),
                                      value=kwds.get('value'),
                                      dtype=kwds.get('dtype'))
     AbstractUidValueDimension.__init__(self,*args,**kwds)
             
     ## setting bounds requires checking the data type of value set in a
     ## superclass.
     self.bounds = bounds
     
     if self._axis is None:
         self._axis = 'undefined'
Esempio n. 4
0
    def __init__(self, *args, **kwargs):
        self._name_value = None

        self.name_value = kwargs.pop('name_value', None)

        AbstractSourcedVariable.__init__(self, *args, **kwargs)