예제 #1
0
파일: climat.py 프로젝트: admg26/pygeode
    def get_outtime(cls, intime):
        from pygeode.timeaxis import SeasonalTAxes
        from pygeode.timeutils import _uniquify
        try:
            SeasonalAxis = SeasonalTAxes[intime.__class__]
        except:
            raise NotImplemented(
                'Seasonal Time axis not implemented for this calendar')

        # Wrap in axis with a seasonal axis to allow reduction
        outax = SeasonalAxis(values = intime.values, \
                            startdate = intime.startdate, \
                            units = intime.units)
        if 'year' in outax.auxarrays:
            fields = [outax.auxarrays['year'], outax.auxarrays['season']]
            fields = _uniquify(fields)
            auxarrays = {'year': fields[0], 'season': fields[1]}
        else:
            fields = [outax.auxarrays['season']]
            fields = _uniquify(fields)
            auxarrays = {'season': fields[0]}

        return SeasonalAxis(startdate=intime.startdate,
                            units=intime.units,
                            **auxarrays)
예제 #2
0
파일: climat.py 프로젝트: aerler/pygeode
  def get_outtime (cls, intime):
    from pygeode.timeaxis import SeasonalTAxes
    from pygeode.timeutils import _uniquify
    try:
      SeasonalAxis = SeasonalTAxes[intime.__class__]
    except:
      raise NotImplemented('Seasonal Time axis not implemented for this calendar')

    # Wrap in axis with a seasonal axis to allow reduction
    outax = SeasonalAxis(values = intime.values, \
                        startdate = intime.startdate, \
                        units = intime.units)
    if 'year' in outax.auxarrays:
      fields = [outax.auxarrays['year'], outax.auxarrays['season']]
      fields = _uniquify(fields)
      auxarrays = {'year':fields[0], 'season':fields[1]}
    else:
      fields = [outax.auxarrays['season']]
      fields = _uniquify(fields)
      auxarrays = {'season':fields[0]}

    return SeasonalAxis (startdate=intime.startdate, units=intime.units, **auxarrays)
예제 #3
0
파일: timeaxis.py 프로젝트: aerler/pygeode
def _uniquify (fields):
  from pygeode import timeutils
  from warnings import warn
  warn ("Deprecated.  Use timeutils module.")
  return timeutils._uniquify(fields)
예제 #4
0
파일: timeaxis.py 프로젝트: admg26/pygeode
def _uniquify (fields):
  from pygeode import timeutils
  from warnings import warn
  warn ("Deprecated.  Use timeutils module.")
  return timeutils._uniquify(fields)