Changeset 824

Show
Ignore:
Timestamp:
07/29/11 16:31:51 (22 months ago)
Author:
jjr8
Message:

Incremented build number. Fixed some bugs. Resumed development of Linear Mixed Modeling tools.

Location:
MGET/Branches/Jason/PythonPackage/src/GeoEco
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • MGET/Branches/Jason/PythonPackage/src/GeoEco/DataManagement/NetCDFs.py

    r542 r824  
    175175        dataset = netCDF3.Dataset(netCDFFileTemp, 'r') 
    176176        try: 
    177             data = cls.GetNumpyArrayFor2DVariableInDataset(dataset, variableName, netCDFFile) 
     177            data = cls.GetNumpyArrayFor2DVariableInDataset(dataset, variableName, netCDFFile).squeeze() 
    178178        finally: 
    179179            try: 
     
    195195        variables2D = [] 
    196196        for name, var in dataset.variables.items(): 
    197             if len(var.dimensions) == 2: 
     197            ndim = 0 
     198            for dim in var.dimensions: 
     199                if len(dataset.dimensions[dim]) > 1: 
     200                    ndim += 1 
     201            if ndim == 2: 
    198202                variables2D.append(name) 
    199203        if len(variables2D) <= 0: 
     
    206210            Logger.RaiseException(ValueError(_(u'The netCDF file %(netCDFFile)s does not contain a variable named "%(var)s". The 2D variables contained in this file are: %(vars)s.') % {u'netCDFFile' :  netCDFFile, u'var' :  variableName, u'vars' : u', '.join(variables2D)})) 
    207211             
    208         if len(dataset.variables[variableName].dimensions) != 2: 
     212        if name not in variables2D: 
    209213            variables2D.sort() 
    210214            Logger.RaiseException(ValueError(_(u'The %(var)s variable in netCDF file %(netCDFFile)s has %(dims)i dimensions. This tool can only process variables with 2 dimensions. The 2D variables contained in this file are: %(vars)s.') % {u'netCDFFile' :  netCDFFile, u'var' :  variableName, u'dims' : len(dataset.variables[variableName].dimensions), u'vars' : u', '.join(variables2D)})) 
  • MGET/Branches/Jason/PythonPackage/src/GeoEco/Datasets/Virtual.py

    r808 r824  
    20662066        startDateTime = datetime.datetime(2001, 1, 1) + datetime.timedelta(startDayOfYear - 1)      # Use a non-leap year for this calculation 
    20672067        if startDateTime.day > 28: 
    2068             raise NotImplementedError(_(u'The Start Day Of Year parameter specifies that the first climatological grid should start on %(day)i %(month)s. This is not supported. The grid may not start later than day 28 of any month. We apologize for the inconvenience.') % {u'day': startDateTime.day, u'month': startDateTime.strftime('%B')}) 
     2068            raise NotImplementedError(_(u'The Start Day Of Year parameter specifies that the first climatological grid should start on %(day)i %(month)s. This is not supported. The grid may not start later than day 28 of any month. We apologize for the inconvenience.') % {u'day': startDateTime.day, u'month': self._Str(startDateTime.strftime('%B'))}) 
    20692069 
    20702070        # If the grid has a time increment that is larger than the bin 
     
    22402240                    if self._BinDuration == 1: 
    22412241                        queryableAttributeValues = {u'ClimatologyBinName': u'month%02i' % (binMonthsAndDays[bin][0] / 100)} 
    2242                         displayName = _(u'%(month)s climatological %(statistic)s of the %(dn)s') % {u'dn': self._Grid.DisplayName, u'month': datetime.datetime(2001, binMonthsAndDays[bin][0]/100, 1).strftime('%B'), u'statistic': self._Statistic} 
     2242                        displayName = _(u'%(month)s climatological %(statistic)s of the %(dn)s') % {u'dn': self._Grid.DisplayName, u'month': self._Str(datetime.datetime(2001, binMonthsAndDays[bin][0]/100, 1).strftime('%B')), u'statistic': self._Statistic} 
    22432243                    else: 
    22442244                        queryableAttributeValues = {u'ClimatologyBinName': u'months%02ito%02i' % (binMonthsAndDays[bin][0] / 100, binMonthsAndDays[bin][1] / 100)} 
  • MGET/Branches/Jason/PythonPackage/src/GeoEco/Statistics/Modeling.py

    r815 r824  
    35843584 
    35853585AddArgumentMetadata(LinearMixedModel.FitToArcGISTable, u'correlationStructure', 
    3586     typeMetadata=UnicodeStringTypeMetadata(canBeNone=True, makeLowercase=True, allowedValues=[u'REML', u'ML']), 
    3587     description=_( 
    3588 u"""TODO"""), 
     3586    typeMetadata=UnicodeStringTypeMetadata(canBeNone=True, allowedValues=[u'Exponential', u'Gaussian', u'Linear', u'Rational quadratic', u'Spherical']), 
     3587    description=_( 
     3588u"""TODO: Write documentation for this parameter."""), 
    35893589    arcGISDisplayName=_(u'Correlation structure'), 
    35903590    arcGISCategory=_(u'Within-group correlation structure')) 
     
    35933593    typeMetadata=UnicodeStringTypeMetadata(canBeNone=True), 
    35943594    description=_( 
    3595 u"""TODO"""), 
     3595u"""TODO: Write documentation for this parameter."""), 
    35963596    arcGISDisplayName=_(u'Correlation formula'), 
    35973597    arcGISCategory=_(u'Within-group correlation structure')) 
     
    36003600    typeMetadata=FloatTypeMetadata(canBeNone=True, mustBeGreaterThan=0.), 
    36013601    description=_( 
    3602 u"""TODO"""), 
     3602u"""TODO: Write documentation for this parameter."""), 
    36033603    arcGISDisplayName=_(u'Range'), 
    36043604    arcGISCategory=_(u'Within-group correlation structure')) 
     
    36073607    typeMetadata=FloatTypeMetadata(canBeNone=True, minValue=0., maxValue=1.), 
    36083608    description=_( 
    3609 u"""TODO"""), 
     3609u"""TODO: Write documentation for this parameter."""), 
    36103610    arcGISDisplayName=_(u'Nugget'), 
    36113611    arcGISCategory=_(u'Within-group correlation structure')) 
     
    36143614    typeMetadata=UnicodeStringTypeMetadata(canBeNone=True, makeLowercase=True, allowedValues=[u'Euclidean', u'Manhattan', u'Maximum']), 
    36153615    description=_( 
    3616 u"""TODO"""), 
     3616u"""TODO: Write documentation for this parameter."""), 
    36173617    arcGISDisplayName=_(u'Distance metric'), 
    36183618    arcGISCategory=_(u'Within-group correlation structure')) 
     
    36213621    typeMetadata=BooleanTypeMetadata(), 
    36223622    description=_( 
    3623 u"""TODO"""), 
     3623u"""TODO: Write documentation for this parameter."""), 
    36243624    arcGISDisplayName=_(u'Keep coefficients fixed during model optimization'), 
    36253625    arcGISCategory=_(u'Within-group correlation structure')) 
  • MGET/Branches/Jason/PythonPackage/src/GeoEco/__init__.py

    r793 r824  
    1 __version__ = u'0.8a27' 
     1__version__ = u'0.8a28'