root/MGET/Branches/Jason/PythonPackage/src/GeoEco/DataProducts/NASA/PODAAC.py @ 959

Revision 959, 183.0 KB (checked in by jjr8, 14 months ago)

* Incremented build number.
* Fixed documentation bug.

Line 
1# Datasets/NASA/PODAAC.py - THREDDSCatalogs and OPeNDAPURLs for NASA
2# PO.DAAC datasets.
3#
4# Copyright (C) 2010 Jason J. Roberts
5#
6# This program is free software; you can redistribute it and/or
7# modify it under the terms of the GNU General Public License
8# as published by the Free Software Foundation; either version 2
9# of the License, or (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License (available in the file LICENSE.TXT)
15# for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
21import datetime
22import os
23
24from GeoEco.Datasets import Dataset, QueryableAttribute, Grid
25from GeoEco.Datasets.Collections import DirectoryTree
26from GeoEco.Datasets.GDAL import GDALDataset
27from GeoEco.Datasets.OPeNDAP import THREDDSCatalog, OPeNDAPURL, OPeNDAPGrid
28from GeoEco.Datasets.Virtual import TimeSeriesGridStack, GridSliceCollection, MaskedGrid, ClippedGrid, RotatedGlobalGrid, ClimatologicalGridCollection, DerivedGrid
29from GeoEco.DynamicDocString import DynamicDocString
30from GeoEco.Internationalization import _
31from GeoEco.Types import *
32
33
34class MODISL3SSTTimeSeries(Grid):
35    __doc__ = DynamicDocString()
36
37    def __init__(self, satellite, temporalResolution, spatialResolution, geophysicalParameter, variableName=u'l3m_data', qualityLevel=0, timeout=60, maxRetryTime=300, cacheDirectory=None):
38        self.__doc__.Obj.ValidateMethodInvocation()
39
40        # Construct a THREDDSCatalog for the variable requested by the
41        # caller and wrap it in a TimeSeriesGridStack to create a 3D
42        # grid with dimensions tyx.
43
44        queryableAttributeValues = {u'Satellite': satellite,
45                                    u'SatelliteCode': satellite[0].upper(),
46                                    u'TemporalResolution': temporalResolution,
47                                    u'TemporalResolutionCode': {u'daily': u'DAY', u'8day': u'8D', u'monthly': u'MO', u'annual': u'YR'}[temporalResolution],
48                                    u'SpatialResolution': spatialResolution,
49                                    u'SpatialResolutionCode': spatialResolution[0],
50                                    u'Algorithm': {u'sst': u'sst', u'nsst': u'sst', u'sst4': u'sst4'}[geophysicalParameter],
51                                    u'Wavelength': {u'sst': u'11um', u'nsst': u'11um', u'sst4': u'4um'}[geophysicalParameter],
52                                    u'GeophysicalParameter': geophysicalParameter}
53
54        if temporalResolution == u'daily':
55            pathParsingExpressions=[r'(?P<Year>\d\d\d\d)',
56                                    r'(?P<DayOfYear>\d\d\d)',
57                                    r'%s(?P<Year>\d\d\d\d)(?P<DayOfYear>\d\d\d)(?P<EndDate>\d{0})\.L3m_%s_%s_%s\.bz2' % (queryableAttributeValues[u'SatelliteCode'], queryableAttributeValues[u'TemporalResolutionCode'], geophysicalParameter, queryableAttributeValues[u'SpatialResolutionCode'])]
58        else:
59            pathParsingExpressions=[r'(?P<Year>\d\d\d\d)',
60                                    r'%s(?P<Year>\d\d\d\d)(?P<DayOfYear>\d\d\d)(?P<EndDate>\d\d\d\d\d\d\d)\.L3m_%s_%s_%s\.bz2' % (queryableAttributeValues[u'SatelliteCode'], queryableAttributeValues[u'TemporalResolutionCode'], geophysicalParameter, queryableAttributeValues[u'SpatialResolutionCode'])]
61
62        if variableName == u'l3m_data':
63            if geophysicalParameter != u'sst4':
64                displayName = _(u'MODIS %(satellite)s L3 mapped %(temporalResolution)s %(spatialResolution)s thermal IR %(geophysicalParameter)s from NASA PO.DAAC') % {u'satellite': satellite[0].upper() + satellite[1:], u'temporalResolution': temporalResolution, u'spatialResolution': spatialResolution, u'geophysicalParameter': geophysicalParameter.upper()}
65            else:
66                displayName = _(u'MODIS %(satellite)s L3 mapped %(temporalResolution)s %(spatialResolution)s mid-IR %(geophysicalParameter)s from NASA PO.DAAC') % {u'satellite': satellite[0].upper() + satellite[1:], u'temporalResolution': temporalResolution, u'spatialResolution': spatialResolution, u'geophysicalParameter': geophysicalParameter.upper()}
67        elif geophysicalParameter != u'sst4':
68            displayName = _(u'MODIS %(satellite)s L3 mapped %(temporalResolution)s %(spatialResolution)s thermal IR %(geophysicalParameter)s quality level from NASA PO.DAAC') % {u'satellite': satellite[0].upper() + satellite[1:], u'temporalResolution': temporalResolution, u'spatialResolution': spatialResolution, u'geophysicalParameter': geophysicalParameter.upper()}
69        else:
70            displayName = _(u'MODIS %(satellite)s L3 mapped %(temporalResolution)s %(spatialResolution)s mid-IR %(geophysicalParameter)s quality level from NASA PO.DAAC') % {u'satellite': satellite[0].upper() + satellite[1:], u'temporalResolution': temporalResolution, u'spatialResolution': spatialResolution, u'geophysicalParameter': geophysicalParameter.upper()}
71
72        grid = TimeSeriesGridStack(THREDDSCatalog(url='http://opendap.jpl.nasa.gov/opendap/allData/modis/L3/%s/%s/%s/%s/catalog.xml' % (satellite, queryableAttributeValues[u'Wavelength'], spatialResolution, temporalResolution),
73                                                  pathParsingExpressions=pathParsingExpressions,
74                                                  displayName=displayName,
75                                                  timeout=timeout,
76                                                  maxRetryTime=maxRetryTime,
77                                                  queryableAttributes=self._GetQueryableAttributesForTimeSlices(),
78                                                  queryableAttributeValues=queryableAttributeValues,
79                                                  lazyPropertyValues=self._GetLazyPropertyValuesForTimeSlices(variableName, spatialResolution, temporalResolution, geophysicalParameter),
80                                                  cacheDirectory=cacheDirectory),
81                                   reportProgress=False)
82
83        # If the caller requested a specific quality level, create a
84        # THREDDSCatalog for the 'l3m_qual' variable and use it to
85        # mask the 3D grid.
86
87        if qualityLevel is not None and qualityLevel in [0, 1]:
88            grid = MaskedGrid(grid,
89                              masks=[TimeSeriesGridStack(THREDDSCatalog(url='http://opendap.jpl.nasa.gov/opendap/allData/modis/L3/%s/%s/%s/%s/catalog.xml' % (satellite, queryableAttributeValues[u'Wavelength'], spatialResolution, temporalResolution),
90                                                                        pathParsingExpressions=pathParsingExpressions,
91                                                                        displayName=_(u'quality level'),
92                                                                        timeout=timeout,
93                                                                        maxRetryTime=maxRetryTime,
94                                                                        queryableAttributes=self._GetQueryableAttributesForTimeSlices(),
95                                                                        queryableAttributeValues=queryableAttributeValues,
96                                                                        lazyPropertyValues=self._GetLazyPropertyValuesForTimeSlices('l3m_qual', spatialResolution, temporalResolution, geophysicalParameter),
97                                                                        cacheDirectory=cacheDirectory),
98                                                         reportProgress=False)],
99                              operators=[u'>'],
100                              values=[qualityLevel])
101
102        # Assign our _WrappedGrid instance variable.
103
104        self._WrappedGrid = grid
105
106    def __getattribute__(self, name):
107        if name.startswith('__') or name in ['_WrappedGrid', '_GetTimeCoordsFromQueryableAttributeValues', '_GetQueryableAttributesForTimeSlices', '_GetLazyPropertyValuesForTimeSlices', 'CreateArcGISRasters', 'CreateClimatologicalArcGISRasters', 'InterpolateAtArcGISPoints', 'CreateCayulaCornillonFrontsAsArcGISRasters']:
108            return object.__getattribute__(self, name)
109        return object.__getattribute__(object.__getattribute__(self, '_WrappedGrid'), name)
110
111    def __setattr__(self, name, value):
112        if name.startswith('__') or name in ['_WrappedGrid', '_GetTimeCoordsFromQueryableAttributeValues', '_GetQueryableAttributesForTimeSlices', '_GetLazyPropertyValuesForTimeSlices', 'CreateArcGISRasters', 'CreateClimatologicalArcGISRasters', 'InterpolateAtArcGISPoints', 'CreateCayulaCornillonFrontsAsArcGISRasters']:
113            object.__setattr__(self, name, value)
114        else:
115            setattr(object.__getattribute__(self, '_WrappedGrid'), name, value)
116
117    @classmethod
118    def _GetQueryableAttributesForTimeSlices(cls):
119
120        # First define a function used to calculate the value of the
121        # EndDate queryable attribute from the value of the DateTime
122        # queryable attribute.
123       
124        def _GetEndDate(selfOrDict, startDate):
125
126            # Get the temporal resolution.
127           
128            temporalResolution = None
129            if isinstance(selfOrDict, dict):
130                if u'TemporalResolution' in selfOrDict:
131                    temporalResolution = selfOrDict[u'TemporalResolution']
132            else:
133                temporalResolution = selfOrDict.GetQueryableAttributeValue(u'TemporalResolution')
134
135            # Calculate the end date string from the temporal resolution.
136
137            if temporalResolution is not None:
138                temporalResolution = temporalResolution.lower()
139               
140                if temporalResolution == u'daily':
141                    return ''
142               
143                if temporalResolution == u'8day':
144                    return unicode((startDate + datetime.timedelta(days=7)).strftime('%Y%j'))
145               
146                if temporalResolution == u'monthly':
147                    if startDate.month == 12:
148                        return unicode((datetime.datetime(startDate.year + 1, 1, 1) - datetime.timedelta(days=1)).strftime('%Y%j'))
149                    return unicode((datetime.datetime(startDate.year, startDate.month + 1, 1) - datetime.timedelta(days=1)).strftime('%Y%j'))
150               
151                if temporalResolution == u'annual':
152                    return unicode((datetime.datetime(startDate.year + 1, 1, 1) - datetime.timedelta(days=1)).strftime('%Y%j'))
153                   
154            return None
155
156        # Now return a tuple of the queryable attributes. The EndDate
157        # queryable attribute makes use of the function.
158
159        return (QueryableAttribute(u'Satellite', _(u'Satellite'), UnicodeStringTypeMetadata(allowedValues=[u'aqua', u'terra'], makeLowercase=True)),
160                QueryableAttribute(u'SatelliteCode', _(u'Satellite abbreviation code'), UnicodeStringTypeMetadata(allowedValues=[u'a', u't'], makeLowercase=True)),
161                QueryableAttribute(u'TemporalResolution', _(u'Temporal resolution'), UnicodeStringTypeMetadata(allowedValues=[u'daily', u'8day', u'monthly', u'annual'], makeLowercase=True)),
162                QueryableAttribute(u'TemporalResolutionCode', _(u'Temporal resolution abbreviation code'), UnicodeStringTypeMetadata(allowedValues=[u'DAY', u'8D', u'MO', u'YR'], makeLowercase=True)),
163                QueryableAttribute(u'SpatialResolution', _(u'Spatial resolution'), UnicodeStringTypeMetadata(allowedValues=[u'4km', u'9km'], makeLowercase=True)),
164                QueryableAttribute(u'SpatialResolutionCode', _(u'Spatial resolution abbreviation code'), UnicodeStringTypeMetadata(allowedValues=[u'4', u'9'], makeLowercase=True)),
165                QueryableAttribute(u'Algorithm', _(u'Algorithm'), UnicodeStringTypeMetadata(allowedValues=[u'sst', u'sst4'], makeLowercase=True)),
166                QueryableAttribute(u'Wavelength', _(u'Primary wavelength'), UnicodeStringTypeMetadata(allowedValues=[u'11um', u'4um'], makeLowercase=True)),
167                QueryableAttribute(u'GeophysicalParameter', _(u'Geophysical parameter'), UnicodeStringTypeMetadata(allowedValues=[u'sst', u'nsst', u'sst4'], makeLowercase=True)),
168                QueryableAttribute(u'DateTime', _(u'Start date'), DateTimeTypeMetadata()),
169                QueryableAttribute(u'EndDate', _(u'End date string'), UnicodeStringTypeMetadata(mustMatchRegEx=ur'\d\d\d\d\d\d\d\d'), derivedFromAttr=u'DateTime', derivedValueFunc=_GetEndDate),
170                QueryableAttribute(u'VariableName', _(u'Variable'), UnicodeStringTypeMetadata(allowedValues=[u'l3m_data', u'l3m_qual'], makeLowercase=True)))
171
172    @classmethod
173    def _GetLazyPropertyValuesForTimeSlices(cls, variableName, spatialResolution, temporalResolution, geophysicalParameter):
174        import numpy
175        return {'VariableTypes': ['Grid'],
176                'VariableNames': [variableName],
177                'SpatialReference': Dataset.ConvertSpatialReference('proj4', '+proj=latlong +ellps=WGS84 +datum=WGS84 +no_defs', 'obj'),
178                'Dimensions': 'yx',
179                'Shape': {'4km': (4320, 8640), '9km': (2160, 4320)}[spatialResolution],
180                'CoordDependencies': (None, None),
181                'CoordIncrements': {'4km': (180./4320,360./8640), '9km': (180./2160,360./4320)}[spatialResolution],
182                'TIncrement': {'daily': 1, '8day': 8, 'monthly': 1, u'annual': 1}[temporalResolution],
183                'TIncrementUnit': {'daily': 'day', '8day': 'day', 'monthly': 'month', u'annual': 'year'}[temporalResolution],
184                'TSemiRegularity': {'daily': None, '8day': 'annual', 'monthly': None, u'annual': None}[temporalResolution],
185                'TCountPerSemiRegularPeriod': {'daily': None, '8day': 46, 'monthly': None, u'annual': None}[temporalResolution],
186                'TCornerCoordType': 'min',
187                'TOffsetFromParsedTime': {'sst': None, 'nsst': -0.5, 'sst4': -0.5}[geophysicalParameter],       # Nighttime datasets start 1/2 days prior to the date and time parsed from the file (i.e. they start at 12:00:00 on the previous date, rather than 00:00:00 on the parsed date)
188                'CornerCoords': {'4km': (-90 + 180./4320/2, -180 + 360./8640/2), '9km': (-90 + 180./2160/2, -180 + 360./4320/2)}[spatialResolution],
189                'PhysicalDimensions': 'yx',
190                'PhysicalDimensionsFlipped': (True, False),
191                'UnscaledDataType': {'l3m_data': 'uint16', 'l3m_qual': 'uint8'}[variableName],
192                'UnscaledNoDataValue': {'l3m_data': 65535, 'l3m_qual': 255}[variableName],
193                'ScaledDataType': {'l3m_data': 'float32', 'l3m_qual': None}[variableName],
194                'ScaledNoDataValue': {'l3m_data': numpy.cast['float32'](0.000717185*65535 - 2), 'l3m_qual': None}[variableName],
195                'ScalingFunction': {'l3m_data': lambda data: numpy.cast['float32'](0.000717185*data - 2), 'l3m_qual': None}[variableName],
196                'UnscalingFunction': {'l3m_data': lambda data: numpy.cast['uint16'](numpy.round((2 + data)/0.000717185)), 'l3m_qual': None}[variableName]}
197
198    @classmethod
199    def _GetTimeCoordsFromQueryableAttributeValues(cls, queryableAttributeValues):
200        try:
201            if u'DateTime' in queryableAttributeValues and isinstance(queryableAttributeValues[u'DateTime'], datetime.datetime):
202                startDate = queryableAttributeValues[u'DateTime']
203                temporalResolution = None
204
205                if u'GeophysicalParameter' in queryableAttributeValues and isinstance(queryableAttributeValues[u'GeophysicalParameter'], basestring) and queryableAttributeValues[u'GeophysicalParameter'].lower() in [u'nsst', u'sst4']:
206                    tOffset = datetime.timedelta(-0.5)
207                else:
208                    tOffset = datetime.timedelta(0)
209               
210                if u'TemporalResolution' in queryableAttributeValues and isinstance(queryableAttributeValues[u'TemporalResolution'], basestring) and queryableAttributeValues[u'TemporalResolution'] in [u'daily', '8day', 'monthly', 'annual']:
211                    temporalResolution = queryableAttributeValues[u'TemporalResolution']
212                elif u'TemporalResolutionCode' in queryableAttributeValues and isinstance(queryableAttributeValues[u'TemporalResolutionCode'], basestring) and queryableAttributeValues[u'TemporalResolutionCode'] in [u'DAY', '8D', 'MO', 'YR']:
213                    temporalResolution = queryableAttributeValues[u'TemporalResolutionCode']
214                else:
215                    return [startDate + tOffset, None, None]
216                   
217                if temporalResolution in [u'daily', u'DAY']:
218                    return [startDate + tOffset, startDate + datetime.timedelta(0.5) + tOffset, startDate + datetime.timedelta(1) + tOffset - datetime.timedelta(seconds=1)]
219               
220                if temporalResolution in [u'8day', u'8D']:
221                    if startDate.month == 12 and startDate.day >= 24:
222                        endDate = datetime.datetime(startDate.year + 1, 1, 1)
223                        return [startDate + tOffset, startDate + (endDate - startDate) / 2 + tOffset, endDate + tOffset - datetime.timedelta(seconds=1)]
224                    else:
225                        return [startDate + tOffset, startDate + datetime.timedelta(4) + tOffset, startDate + datetime.timedelta(8) + tOffset - datetime.timedelta(seconds=1)]
226                   
227                if temporalResolution in [u'monthly', u'MO']:
228                    if startDate.month == 12:
229                        endDate = datetime.datetime(startDate.year + 1, 1, 1)
230                    else:
231                        endDate = datetime.datetime(startDate.year, startDate.month + 1, 1)
232                    return [startDate + tOffset, startDate + (endDate - startDate) / 2 + tOffset, endDate + tOffset - datetime.timedelta(seconds=1)]
233
234                if temporalResolution in [u'annual', u'YR']:
235                    return [startDate + tOffset, datetime.datetime(startDate.year, 7, 1) + tOffset, datetime.datetime(startDate.year + 1, 1, 1) + tOffset - datetime.timedelta(seconds=1)]
236
237            return [None, None, None]
238        except:
239            return [None, None, None]
240
241    @classmethod
242    def CreateArcGISRasters(cls, satellite, temporalResolution, spatialResolution, geophysicalParameter, variableName,
243                            outputWorkspace, mode=u'add', rasterNameExpressions=[u'%(Satellite)s', u'%(Wavelength)s', u'%(SpatialResolution)s', u'%(TemporalResolution)s', u'%%Y', u'%(SatelliteCode).1s%%Y%%j%(EndDate)s.L3m_%(TemporalResolutionCode).3s_%(GeophysicalParameter)s_%(SpatialResolutionCode).1s_%(VariableName)s.img'], rasterCatalog=None,
244                            qualityLevel=0,
245                            rotationOffset=None, spatialExtent=None, startDate=None, endDate=None,
246                            timeout=60, maxRetryTime=300, cacheDirectory=None,
247                            useUnscaledData=False, calculateStatistics=True, buildRAT=False, buildPyramids=False):
248        cls.__doc__.Obj.ValidateMethodInvocation()
249
250        # Construct a MODISL3SSTTimeSeries instance and rotate and
251        # clip it as requested.
252
253        grid = MODISL3SSTTimeSeries(satellite, temporalResolution, spatialResolution, geophysicalParameter, variableName, qualityLevel, timeout, maxRetryTime, cacheDirectory)
254       
255        try:
256            if rotationOffset is not None:
257                grid = RotatedGlobalGrid(grid, rotationOffset, u'Map units')
258
259            xMin, yMin, xMax, yMax = None, None, None, None
260            if spatialExtent is not None:
261                from GeoEco.Types import EnvelopeTypeMetadata
262                xMin, yMin, xMax, yMax = EnvelopeTypeMetadata.ParseFromArcGISString(spatialExtent)
263
264            if spatialExtent is not None or startDate is not None or endDate is not None:
265                if startDate is not None:
266                    startDate = datetime.datetime(startDate.year, startDate.month, startDate.day, 0, 0, 0)
267                if endDate is not None:
268                    endDate = datetime.datetime(endDate.year, endDate.month, endDate.day, 23, 59, 59)
269                   
270                grid = ClippedGrid(grid, u'Map coordinates', xMin=xMin, xMax=xMax, yMin=yMin, yMax=yMax, tMin=startDate, tMax=endDate)
271
272            # Construct an ArcGISWorkspace instance and import time slices
273            # from the MODISL3SSTTimeSeries instance.
274
275            from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
276
277            workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, pathCreationExpressions=rasterNameExpressions, cacheTree=True, queryableAttributes=cls._GetQueryableAttributesForTimeSlices())
278            workspace.ImportDatasets(GridSliceCollection(grid).QueryDatasets(), mode, useUnscaledData=useUnscaledData, calculateStatistics=calculateStatistics, buildRAT=buildRAT, buildPyramids=buildPyramids)
279
280            if rasterCatalog is not None:
281                workspace.ToRasterCatalog(rasterCatalog, grid.GetSpatialReference(u'ArcGIS'), tQACoordType=u'min', tCoordFunction=cls._GetTimeCoordsFromQueryableAttributeValues, overwriteExisting=True)
282
283        finally:
284            grid.Close()
285
286        # Return successfully.
287
288        return outputWorkspace
289
290    @classmethod
291    def CreateClimatologicalArcGISRasters(cls, satellite, temporalResolution, spatialResolution, geophysicalParameter, variableName,
292                                          statistic, binType,
293                                          outputWorkspace, mode=u'add', rasterNameExpressions=[u'%(Satellite)s', u'%(Wavelength)s', u'%(SpatialResolution)s', u'%(TemporalResolution)s', u'%(ClimatologyBinType)s_Climatology', u'%(Satellite)s_%(GeophysicalParameter)s_%(VariableName)s_%(ClimatologyBinName)s_%(Statistic)s.img'],
294                                          qualityLevel=0,
295                                          binDuration=1, startDayOfYear=1,
296                                          rotationOffset=None, spatialExtent=None, startDate=None, endDate=None,
297                                          timeout=60, maxRetryTime=300, cacheDirectory=None,
298                                          calculateStatistics=True, buildPyramids=False):
299        cls.__doc__.Obj.ValidateMethodInvocation()
300
301        # Construct a MODISL3SSTTimeSeries instance and rotate and
302        # clip it as requested.
303
304        grid = MODISL3SSTTimeSeries(satellite, temporalResolution, spatialResolution, geophysicalParameter, variableName, qualityLevel, timeout, maxRetryTime, cacheDirectory)
305       
306        try:
307            if rotationOffset is not None:
308                grid = RotatedGlobalGrid(grid, rotationOffset, u'Map units')
309
310            xMin, yMin, xMax, yMax = None, None, None, None
311            if spatialExtent is not None:
312                from GeoEco.Types import EnvelopeTypeMetadata
313                xMin, yMin, xMax, yMax = EnvelopeTypeMetadata.ParseFromArcGISString(spatialExtent)
314
315            if spatialExtent is not None or startDate is not None or endDate is not None:
316                if startDate is not None:
317                    startDate = datetime.datetime(startDate.year, startDate.month, startDate.day, 0, 0, 0)
318                if endDate is not None:
319                    endDate = datetime.datetime(endDate.year, endDate.month, endDate.day, 23, 59, 59)
320                   
321                grid = ClippedGrid(grid, u'Map coordinates', xMin=xMin, xMax=xMax, yMin=yMin, yMax=yMax, tMin=startDate, tMax=endDate)
322
323            # Construct a ClimatologicalGridCollection from the
324            # MODISL3SSTTimeSeries instance. Construct an
325            # ArcGISWorkspace instance and import the
326            # ClimatologicalGridCollection into it.
327
328            from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
329
330            collection = ClimatologicalGridCollection(grid, statistic, binType, binDuration, startDayOfYear, reportProgress=True)
331            workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, pathCreationExpressions=rasterNameExpressions, cacheTree=True, queryableAttributes=tuple(collection.GetAllQueryableAttributes()))
332            workspace.ImportDatasets(collection.QueryDatasets(), mode, calculateStatistics=calculateStatistics, buildPyramids=buildPyramids)
333
334        finally:
335            grid.Close()
336
337        # Return successfully.
338
339        return outputWorkspace
340
341    @classmethod
342    def InterpolateAtArcGISPoints(cls, satellite, temporalResolution, spatialResolution, geophysicalParameter, variableName,
343                                  points, valueField, tField, method=u'Nearest', where=None, noDataValue=None,
344                                  qualityLevel=0,
345                                  timeout=60, maxRetryTime=300, cacheDirectory=None,
346                                  orderByFields=None, numBlocksToCacheInMemory=256, xBlockSize=16, yBlockSize=16, tBlockSize=3):
347        cls.__doc__.Obj.ValidateMethodInvocation()
348       
349        grid = MODISL3SSTTimeSeries(satellite, temporalResolution, spatialResolution, geophysicalParameter, variableName, qualityLevel, timeout, maxRetryTime, cacheDirectory)
350
351        try:
352            if orderByFields is not None:
353                orderBy = u', '.join(map(lambda f: f + u' ASC', orderByFields))
354            else:
355                from GeoEco.ArcGIS import GeoprocessorManager
356                if GeoprocessorManager.GetArcGISMajorVersion() > 9 or GeoprocessorManager.GetArcGISMinorVersion() >= 2:
357                    orderBy = tField + u' ASC'
358                else:
359                    orderBy = None
360           
361            from GeoEco.Datasets.ArcGIS import ArcGISTable
362            from GeoEco.SpatialAnalysis.Interpolation import Interpolator
363            Interpolator.InterpolateGridsValuesForTableOfPoints([grid], ArcGISTable(points), [valueField], tField=tField, where=where, orderBy=orderBy, method=method, noDataValue=noDataValue, gridsWrap=True, numBlocksToCacheInMemory=numBlocksToCacheInMemory, xBlockSize=xBlockSize, yBlockSize=yBlockSize, tBlockSize=tBlockSize)
364
365        finally:
366            grid.Close()
367       
368        return points
369
370    @classmethod
371    def CreateCayulaCornillonFrontsAsArcGISRasters(cls, satellite, temporalResolution, spatialResolution, geophysicalParameter, minPopMeanDifference,
372                                                   outputWorkspace, mode=u'add', rasterNameExpressions=[u'%(Satellite)s', u'%(Wavelength)s_fronts', u'%(SpatialResolution)s', u'%(TemporalResolution)s', u'%%Y', '%(Satellite)s_%(TemporalResolution)s_%%Y%%j_%(GeophysicalParameter)s_%(ImageType)s.img'],
373                                                   medianFilterWindowSize=3, histogramWindowSize=20, histogramWindowStride=1, minPropNonMaskedCells=0.65, minPopProp=0.25, minTheta=0.76, minSinglePopCohesion=0.88, minGlobalPopCohesion=0.90, threads=1,
374                                                   fillHoles=20, thin=True, minSize=10,
375                                                   qualityLevel=1,
376                                                   rotationOffset=None, spatialExtent=None, startDate=None, endDate=None,
377                                                   timeout=60, maxRetryTime=300, cacheDirectory=None,
378                                                   calculateStatistics=True, buildRAT=False, buildPyramids=False,
379                                                   outputCandidateCounts=False, outputFrontCounts=False, outputWindowStatusCodes=False, outputWindowStatusValues=False):
380        cls.__doc__.Obj.ValidateMethodInvocation()
381
382        # Construct a MODISL3SSTTimeSeries instance and rotate
383        # and clip it as requested.
384
385        grid = MODISL3SSTTimeSeries(satellite, temporalResolution, spatialResolution, geophysicalParameter, u'l3m_data', qualityLevel, timeout, maxRetryTime, cacheDirectory)
386       
387        try:
388            if rotationOffset is not None:
389                grid = RotatedGlobalGrid(grid, rotationOffset, u'Map units')
390
391            xMin, yMin, xMax, yMax = None, None, None, None
392            if spatialExtent is not None:
393                from GeoEco.Types import EnvelopeTypeMetadata
394                xMin, yMin, xMax, yMax = EnvelopeTypeMetadata.ParseFromArcGISString(spatialExtent)
395
396            if spatialExtent is not None or startDate is not None or endDate is not None:
397                if startDate is not None:
398                    startDate = datetime.datetime(startDate.year, startDate.month, startDate.day, 0, 0, 0)
399                if endDate is not None:
400                    endDate = datetime.datetime(endDate.year, endDate.month, endDate.day, 23, 59, 59)
401                   
402                grid = ClippedGrid(grid, u'Map coordinates', xMin=xMin, xMax=xMax, yMin=yMin, yMax=yMax, tMin=startDate, tMax=endDate)
403
404            # Construct a CayulaCornillonFrontsInGrid collection using
405            # the requested parameters.
406
407            from GeoEco.OceanographicAnalysis.Fronts import CayulaCornillonFrontsInGrid
408
409            collection = CayulaCornillonFrontsInGrid(grid,
410                                                     wrapEdges=grid.Shape[-1] == MODISL3SSTTimeSeries._GetLazyPropertyValuesForTimeSlices('l3m_data', spatialResolution, temporalResolution, geophysicalParameter)['Shape'][-1],
411                                                     medianFilterWindowSize=medianFilterWindowSize,
412                                                     histogramWindowSize=histogramWindowSize,
413                                                     histogramWindowStride=histogramWindowStride,
414                                                     minPropNonMaskedCells=minPropNonMaskedCells,
415                                                     minPopProp=minPopProp,
416                                                     minPopMeanDifference=minPopMeanDifference,
417                                                     minTheta=minTheta,
418                                                     minSinglePopCohesion=minSinglePopCohesion,
419                                                     minGlobalPopCohesion=minGlobalPopCohesion,
420                                                     threads=threads,
421                                                     fillHoles=fillHoles,
422                                                     thin=thin,
423                                                     minSize=minSize)
424            try:
425                try:
426                    # Construct an ArcGISWorkspace instance and import
427                    # time slices from the CayulaCornillonFrontsInGrid
428                    # instance.
429
430                    expression = "ImageType = 'floc'"
431                    if outputCandidateCounts:
432                        expression += " OR ImageType = 'ccnt'"
433                    if outputFrontCounts:
434                        expression += " OR ImageType = 'fcnt'"
435                    if outputWindowStatusCodes:
436                        expression += " OR ImageType = 'wsco'"
437                    if outputWindowStatusValues:
438                        expression += " OR ImageType = 'wsvl'"
439
440                    from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
441
442                    workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, pathCreationExpressions=rasterNameExpressions, cacheTree=True, queryableAttributes=tuple(collection.GetAllQueryableAttributes()))
443                    workspace.ImportDatasets(collection.QueryDatasets(expression), mode, calculateStatistics=calculateStatistics, buildRAT=buildRAT, buildPyramids=buildPyramids)
444
445                # If we caught an exception, log it now. Then delete
446                # the collection object, to ensure its memory is
447                # freed. Normally we don't bother doing this but the
448                # memory it holds can be substantial.
449               
450                except:
451                    from GeoEco.Logging import Logger
452                    Logger.LogExceptionAsError()
453            finally:
454                del collection
455        finally:
456            grid.Close()
457
458        # Return successfully.
459
460        return outputWorkspace
461
462
463class _GHRSSTLevel4THREDDSCatalog(THREDDSCatalog):
464    __doc__ = DynamicDocString()
465
466    def __init__(self, displayName=None, timeout=60, maxRetryTime=120, cacheDirectory=None):
467        super(_GHRSSTLevel4THREDDSCatalog, self).__init__('http://podaac-opendap.jpl.nasa.gov/opendap/allData/ghrsst/data/L4/catalog.xml',
468                                                          [r'(?P<AreaCode>[^\-]+)',
469                                                           r'(?P<RDACCode>[^\-]+)',
470                                                           r'(?P<ProductCode2>[^\-]+)',
471                                                           r'(?P<Year>\d\d\d\d)',
472                                                           r'(?P<DayOfYear>\d\d\d)',
473                                                           r'(?P<Year>\d\d\d\d)(?P<Month>\d\d)(?P<Day>\d\d)-(?P<RDACCode>[^\-]+)-L4(?P<ProductType>[^\-]+)-(?P<AreaCode>[^\-]+)-v(?P<GDSVersion>\d\d)-fv(?P<FileVersion>[^\-]+)-(?P<ProductCode>[^\-]+)(?:\.nc|\.nc\.bz2|\.nc\.gz)'],
474                                                          displayName=displayName,
475                                                          timeout=timeout,
476                                                          maxRetryTime=maxRetryTime,
477                                                          queryableAttributes=(QueryableAttribute(u'RDACCode', _(u'RDAC code'), UnicodeStringTypeMetadata()),
478                                                                               QueryableAttribute(u'ProductType', _(u'Product type'), UnicodeStringTypeMetadata()),
479                                                                               QueryableAttribute(u'AreaCode', _(u'Area code'), UnicodeStringTypeMetadata()),
480                                                                               QueryableAttribute(u'GDSVersion', _(u'GDS version'), IntegerTypeMetadata()),
481                                                                               QueryableAttribute(u'FileVersion', _(u'File version'), UnicodeStringTypeMetadata()),
482                                                                               QueryableAttribute(u'ProductCode', _(u'Product code'), UnicodeStringTypeMetadata()),
483                                                                               QueryableAttribute(u'ProductCode2', _(u'Product code 2'), UnicodeStringTypeMetadata()),
484                                                                               QueryableAttribute(u'DateTime', _(u'Start date'), DateTimeTypeMetadata())),
485                                                          cacheDirectory=cacheDirectory)
486
487    def _ConstructOPeNDAPURL(self, url, timeout, maxRetryTime, queryableAttributeValues, cacheDirectory):
488        return _GHRSSTLevel4OPeNDAPURL(url,
489                                       timeout=timeout,
490                                       maxRetryTime=maxRetryTime,
491                                       parentCollection=self,
492                                       queryableAttributeValues=queryableAttributeValues,
493                                       lazyPropertyValues={'VariableTypes': ['Grid', 'Grid'],
494                                                           'VariableNames': ['analysed_sst', 'analysis_error']},
495                                       cacheDirectory=cacheDirectory)
496
497
498class _GHRSSTLevel4OPeNDAPURL(OPeNDAPURL):
499    __doc__ = DynamicDocString()
500
501    def _ConstructOPeNDAPGrid(self, variableName, variableType):
502        return _GHRSSTLevel4OPeNDAPGrid(self, variableName, variableType)
503
504
505class _GHRSSTLevel4OPeNDAPGrid(OPeNDAPGrid):
506    __doc__ = DynamicDocString()
507
508    def __init__(self, opendapURLObj, variableName, variableType):
509        self.__doc__.Obj.ValidateMethodInvocation()
510
511        # Perform additional validation.
512       
513        if variableName not in ['analysed_sst', 'analysis_error']:
514            raise ValueError(_(u'This tool does not support the "%(variableName)s" variable. The supported variables are "analysed_sst" and "analysis_error".') % {u'variableName': variableName})
515
516        # Initialize the base class.
517       
518        super(_GHRSSTLevel4OPeNDAPGrid, self).__init__(opendapURLObj,
519                                                       variableName,
520                                                       variableType,
521                                                       lazyPropertyValues={'SpatialReference': Dataset.ConvertSpatialReference('proj4', '+proj=latlong +ellps=WGS84 +datum=WGS84 +no_defs', 'obj'),
522                                                                           'Dimensions': u'tyx',
523                                                                           'TIncrement': 1,
524                                                                           'TIncrementUnit': 'day',
525                                                                           'TSemiRegularity': None,
526                                                                           'TCountPerSemiRegularPeriod': None,
527                                                                           'TCornerCoordType': 'min',
528                                                                           'CoordDependencies': (None, None, None),
529                                                                           'PhysicalDimensions': u'tyx'})
530
531    def _GetLazyPropertyPhysicalValue(self, name):
532
533        # If the caller is asking for the CoordIncrements or
534        # CornerCoords, calculate them from the lon and lat OPeNDAP
535        # variables, which give the center coordinates of the cells.
536
537        self.ParentCollection._Open()
538
539        if name in ['CoordIncrements', 'CornerCoords', 'PhysicalDimensionsFlipped']:
540            lon = self.ParentCollection._PydapDataset['lon']
541            lat = self.ParentCollection._PydapDataset['lat']
542
543            yIncrement = abs((lat[-1] - lat[0]) / (lat.shape[0] - 1))
544
545            if os.path.basename(self.ParentCollection.URL).find('-GLOB-') >= 0:      # If it is a global dataset, assume 360 degrees longitude and calculate the x increment at full precision.
546                xIncrement = 360. / self.Shape[-1]
547            elif lon[0] > lon[-1]:
548                xIncrement = abs((lon[-1] + 360. - lon[0]) / (lon.shape[0] - 1))     # For datasets such as ABOM-L4HRfnd-AUS-RAMSSA_09km that cross the 180th meridian, use a 0-to-360 coordinate system
549            else:
550                xIncrement = abs((lon[-1] - lon[0]) / (lon.shape[0] - 1))
551                   
552            if abs(yIncrement - xIncrement) < 0.000001:     # If x and y increments are almost exactly the same, force them to be exactly the same so that the cells are perfectly square
553                yIncrement = xIncrement
554
555            self.SetLazyPropertyValue('CoordIncrements', (1., yIncrement, xIncrement))
556
557            if lat[-1] > lat[0]:
558                self.SetLazyPropertyValue('CornerCoords', (datetime.datetime(1980, 1, 1), lat[0], lon[0]))      # Use fake time coordinate; the true time coordinates are parsed from the file name.
559                self.SetLazyPropertyValue('PhysicalDimensionsFlipped', (False, False, False))
560            else:
561                self.SetLazyPropertyValue('CornerCoords', (datetime.datetime(1980, 1, 1), lat[-1], lon[0]))      # Use fake time coordinate; the true time coordinates are parsed from the file name.
562                self.SetLazyPropertyValue('PhysicalDimensionsFlipped', (False, True, False))
563
564            return self.GetLazyPropertyValue(name)
565
566        # If the caller is asking for the scaled data type, scaling
567        # function, or unscaling function, determine these from the
568        # data type and add_offset and scale_factor attributes of this
569        # OPeNDAP variable.
570
571        if name in ['ScaledDataType', 'ScalingFunction', 'UnscalingFunction']:
572            v = self._GetOPeNDAPVariable()
573            if self.GetLazyPropertyValue('UnscaledDataType').startswith('float') or not hasattr(v, 'scale_factor') or not hasattr(v, 'add_offset'):
574                return None
575
576            import numpy
577
578            self.SetLazyPropertyValue('ScaledDataType', u'float32')
579            self.SetLazyPropertyValue('ScalingFunction', lambda data: numpy.cast['float32'](v.scale_factor*data + v.add_offset))
580            self.SetLazyPropertyValue('UnscalingFunction', lambda data: numpy.cast[str(self.GetLazyPropertyValue('UnscaledDataType'))](numpy.round((data - v.add_offset)/v.scale_factor)))
581
582            return self.GetLazyPropertyValue(name)
583
584        # If the caller is asking for the UnscaledNoDataValue, get it
585        # from the _FillValue attribute of this OPeNDAP variable.
586
587        if name == 'UnscaledNoDataValue':
588            v = self._GetOPeNDAPVariable()
589            if not hasattr(v, '_FillValue'):
590                return None
591            if not self.GetLazyPropertyValue('UnscaledDataType').startswith('float'):
592                return int(v._FillValue)
593            return v._FillValue
594
595        # If the caller is asking for the ScaledNoDataValue, calculate
596        # it.
597       
598        if name == 'ScaledNoDataValue':
599            scalingFunction = self.GetLazyPropertyValue('ScalingFunction')
600            unscaledNoDataValue = self.GetLazyPropertyValue('UnscaledNoDataValue')
601            if scalingFunction is None or unscaledNoDataValue is None:
602                return None
603            return scalingFunction(unscaledNoDataValue)
604
605        # Otherwise let the base class get this property.
606       
607        return super(_GHRSSTLevel4OPeNDAPGrid, self)._GetLazyPropertyPhysicalValue(name)
608
609
610class GHRSSTLevel4(Grid):
611    __doc__ = DynamicDocString()
612
613    def __init__(self, variableName, rdacCode, productType, areaCode, gdsVersion, fileVersion, productCode, productCode2=None, convertToCelsius=True, timeout=60, maxRetryTime=300, cacheDirectory=None):
614        self.__doc__.Obj.ValidateMethodInvocation()
615
616        # Construct a _GHRSSTLevel4THREDDSCatalog and wrap it in a
617        # TimeSeriesGridStack to create a 3D grid with dimensions tyx.
618
619        if productCode2 is None:
620            productCode2 = productCode
621
622        if rdacCode == 'REMSS' and areaCode == 'GLOB' and productCode == 'mw_ir_rt_OI':
623            datasetSpecificExpression = 'AND (Year > 2008 OR Year = 2008 AND DayOfYear >= 199)'     # Hack to speed up querying for mw_ir_rt_OI, which is stored in same directory as mw_ir_OI but starts at a much later date.
624        else:
625            datasetSpecificExpression = ''
626
627        grid = TimeSeriesGridStack(_GHRSSTLevel4THREDDSCatalog(_('GHRSST L4 product %s-L4%s-%s-%s hosted by NASA PO.DAAC') % (rdacCode, productType, areaCode, productCode), timeout, maxRetryTime, cacheDirectory),
628                                   expression = "VariableName = '%s' AND RDACCode = '%s' AND ProductType = '%s' AND AreaCode = '%s' AND GDSVersion = %i AND FileVersion = '%s' AND ProductCode = '%s' AND ProductCode2 = '%s' %s" % (variableName, rdacCode, productType, areaCode, gdsVersion, fileVersion, productCode, productCode2, datasetSpecificExpression),
629                                   reportProgress=False)
630
631        # If the caller requested that we convert Kelvin temperatures
632        # to Celsius, wrap the grid.
633
634        if convertToCelsius:
635            qav = {}
636            for qa in grid.GetAllQueryableAttributes():
637                qav[qa.Name] = grid.GetQueryableAttributeValue(qa.Name)
638           
639            grid = DerivedGrid([grid],
640                               'self._Grids[0].Data.__getitem__(tuple(sliceList)) - 273.15',
641                               grid.DisplayName,
642                               grid.DataType,
643                               grid.NoDataValue - 273.15,
644                               queryableAttributes=tuple(grid.GetAllQueryableAttributes()),
645                               queryableAttributeValues=qav)
646
647        # Assign our _WrappedGrid instance variable.
648
649        self._WrappedGrid = grid
650
651    def __getattribute__(self, name):
652        if name.startswith('__') or name in ['_WrappedGrid', '_PODAAC_Products', '_RotateAndClip', 'CreateArcGISRasters', 'CreateClimatologicalArcGISRasters', 'InterpolateAtArcGISPoints', 'CreateCayulaCornillonFrontsAsArcGISRasters']:
653            return object.__getattribute__(self, name)
654        return object.__getattribute__(object.__getattribute__(self, '_WrappedGrid'), name)
655
656    def __setattr__(self, name, value):
657        if name.startswith('__') or name in ['_WrappedGrid', '_PODAAC_Products', '_RotateAndClip', 'CreateArcGISRasters', 'CreateClimatologicalArcGISRasters', 'InterpolateAtArcGISPoints', 'CreateCayulaCornillonFrontsAsArcGISRasters']:
658            object.__setattr__(self, name, value)
659        else:
660            setattr(object.__getattribute__(self, '_WrappedGrid'), name, value)
661
662    # In the lists below the items are [rdacCode, productType, areaCode, gdsVersion, fileVersion, productCode, productCode2]
663
664    _PODAAC_Products = {u'ABOM-L4HRfnd-AUS-RAMSSA_09km': ['ABOM', 'HRfnd', 'AUS', 1, '01_0', 'RAMSSA_09km', 'RAMSSA_09km'],
665                        u'ABOM-L4LRfnd-GLOB-GAMSSA_28km': ['ABOM', 'LRfnd', 'GLOB', 1, '01_0', 'GAMSSA_28km', 'GAMSSA_28km'],
666                        u'DMI-L4UHfnd-NSEABALTIC-DMI_OI': ['DMI', 'UHfnd', 'NSEABALTIC', 1, '01', 'DMI_OI', 'DMI_OI'],
667                        u'EUR-L4UHRfnd-MED-ODYSSEA': ['EUR', 'UHRfnd', 'MED', 1, '01', 'ODYSSEA', 'ODYSSEA'],
668                        u'EUR-L4UHRfnd-NWE-ODYSSEA': ['EUR', 'UHRfnd', 'NWE', 1, '01', 'ODYSSEA', 'ODYSSEA'],
669                        u'JPL-L4UHfnd-GLOB-MUR': ['JPL', 'UHfnd', 'GLOB', 1, '03', 'MUR', 'MUR'],
670                        u'JPL_OUROCEAN-L4UHfnd-GLOB-G1SST': ['JPL_OUROCEAN', 'UHfnd', 'GLOB', 1, '01_0', 'G1SST', 'G1SST'],
671                        u'NAVO-L4HR1m-GLOB-K10_SST': ['NAVO', 'HR1m', 'GLOB', 1, '01_0', 'K10_SST', 'K10_SST'],
672                        u'NCDC-L4LRblend-GLOB-AVHRR_AMSR_OI': ['NCDC', 'LRblend', 'GLOB', 1, '02_0', 'AVHRR_AMSR_OI', 'AVHRR_AMSR_OI'],
673                        u'NCDC-L4LRblend-GLOB-AVHRR_OI': ['NCDC', 'LRblend', 'GLOB', 1, '02_0', 'AVHRR_OI', 'AVHRR_OI'],
674                        #u'REMSS-L4HRfnd-GLOB-mw_ir_OI': ['REMSS', 'HRfnd', 'GLOB', 1, '01', 'mw_ir_OI', 'mw_ir_OI'],               # PO.DAAC's copy of this dataset is not up to date. I emailed them and they are working on it.
675                        #u'REMSS-L4HRfnd-GLOB-mw_ir_rt_OI': ['REMSS', 'HRfnd', 'GLOB', 1, '01', 'mw_ir_rt_OI', 'mw_ir_OI'],         # PO.DAAC's copy of this dataset is not up to date. I emailed them and they are working on it.
676                        u'UKMO-L4HRfnd-GLOB-OSTIA': ['UKMO', 'HRfnd', 'GLOB', 1, '02', 'OSTIA', 'OSTIA']}
677
678    @classmethod
679    def _RotateAndClip(cls, grid, rotationOffset, spatialExtent, startDate, endDate):
680        if rotationOffset is not None:
681            grid = RotatedGlobalGrid(grid, rotationOffset, u'Map units')
682
683        xMin, yMin, xMax, yMax = None, None, None, None
684        if spatialExtent is not None:
685            from GeoEco.Types import EnvelopeTypeMetadata
686            xMin, yMin, xMax, yMax = EnvelopeTypeMetadata.ParseFromArcGISString(spatialExtent)
687
688        if spatialExtent is not None or startDate is not None or endDate is not None:
689            if startDate is not None:
690                startDate = datetime.datetime(startDate.year, startDate.month, startDate.day, 0, 0, 0)
691            if endDate is not None:
692                endDate = datetime.datetime(endDate.year, endDate.month, endDate.day, 23, 59, 59)
693               
694            grid = ClippedGrid(grid, u'Map coordinates', xMin=xMin, xMax=xMax, yMin=yMin, yMax=yMax, tMin=startDate, tMax=endDate)
695           
696        return grid
697
698    @classmethod
699    def CreateArcGISRasters(cls, product, variableName,
700                            outputWorkspace, mode=u'add', rasterNameExpressions=[u'%(AreaCode)s', u'%(RDACCode)s', u'%(ProductCode)s', u'%(VariableName)s', u'%%Y', u'%%Y%%m%%d-%(RDACCode)s-L4%(ProductType)s-%(AreaCode)s-v%(GDSVersion)02i-fv%(FileVersion)s-%(ProductCode)s-%(VariableName)s.img'], rasterCatalog=None,
701                            rotationOffset=None, spatialExtent=None, startDate=None, endDate=None,
702                            timeout=60, maxRetryTime=300, cacheDirectory=None,
703                            convertToCelsius=True, useUnscaledData=False, calculateStatistics=True, buildRAT=False, buildPyramids=False):
704        cls.__doc__.Obj.ValidateMethodInvocation()
705        [rdacCode, productType, areaCode, gdsVersion, fileVersion, productCode, productCode2] = cls._PODAAC_Products[product]
706        grid = cls(variableName, rdacCode, productType, areaCode, gdsVersion, fileVersion, productCode, productCode2, convertToCelsius and variableName == u'analysed_sst' and not useUnscaledData, timeout, maxRetryTime, cacheDirectory)
707        try:
708            from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
709            grid = cls._RotateAndClip(grid, rotationOffset, spatialExtent, startDate, endDate)
710            workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, pathCreationExpressions=rasterNameExpressions, cacheTree=True, queryableAttributes=tuple(grid.GetAllQueryableAttributes() + [QueryableAttribute(u'DateTime', _(u'Date'), DateTimeTypeMetadata())]))
711            workspace.ImportDatasets(GridSliceCollection(grid, tQACoordType=u'min').QueryDatasets(), mode, useUnscaledData=useUnscaledData, calculateStatistics=calculateStatistics, buildRAT=buildRAT, buildPyramids=buildPyramids)
712            if rasterCatalog is not None:
713                workspace.ToRasterCatalog(rasterCatalog, grid.GetSpatialReference(u'ArcGIS'), tQACoordType=u'min', tCoordFunction=lambda qav: [qav[u'DateTime'], qav[u'DateTime'] + datetime.timedelta(0.5), qav[u'DateTime'] + datetime.timedelta(1) - datetime.timedelta(seconds=1)], overwriteExisting=True)
714        finally:
715            grid.Close()
716        return outputWorkspace
717
718    @classmethod
719    def CreateClimatologicalArcGISRasters(cls, product, variableName,
720                                          statistic, binType,
721                                          outputWorkspace, mode=u'add', rasterNameExpressions=[u'%(AreaCode)s', u'%(RDACCode)s', u'%(ProductCode)s', u'%(VariableName)s', u'%(ClimatologyBinType)s_Climatology', u'%(RDACCode)s-L4%(ProductType)s-%(AreaCode)s-v%(GDSVersion)02i-fv%(FileVersion)s-%(ProductCode)s-%(VariableName)s-%(ClimatologyBinName)s-%(Statistic)s.img'],
722                                          binDuration=1, startDayOfYear=1,
723                                          rotationOffset=None, spatialExtent=None, startDate=None, endDate=None,
724                                          timeout=60, maxRetryTime=300, cacheDirectory=None,
725                                          convertToCelsius=True, calculateStatistics=True, buildPyramids=False):
726        cls.__doc__.Obj.ValidateMethodInvocation()
727        [rdacCode, productType, areaCode, gdsVersion, fileVersion, productCode, productCode2] = cls._PODAAC_Products[product]
728        grid = cls(variableName, rdacCode, productType, areaCode, gdsVersion, fileVersion, productCode, productCode2, convertToCelsius and variableName == u'analysed_sst', timeout, maxRetryTime, cacheDirectory)
729        try:
730            from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
731            grid = cls._RotateAndClip(grid, rotationOffset, spatialExtent, startDate, endDate)
732            collection = ClimatologicalGridCollection(grid, statistic, binType, binDuration, startDayOfYear, reportProgress=True)
733            workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, pathCreationExpressions=rasterNameExpressions, cacheTree=True, queryableAttributes=tuple(collection.GetAllQueryableAttributes()))
734            workspace.ImportDatasets(collection.QueryDatasets(), mode, calculateStatistics=calculateStatistics, buildPyramids=buildPyramids)
735        finally:
736            grid.Close()
737        return outputWorkspace
738
739    @classmethod
740    def InterpolateAtArcGISPoints(cls, product, variableName,
741                                  points, valueField, tField, method=u'Nearest', where=None, noDataValue=None, convertToCelsius=True,
742                                  timeout=60, maxRetryTime=300, cacheDirectory=None,
743                                  orderByFields=None, numBlocksToCacheInMemory=256, xBlockSize=64, yBlockSize=64, tBlockSize=1):
744        cls.__doc__.Obj.ValidateMethodInvocation()
745        [rdacCode, productType, areaCode, gdsVersion, fileVersion, productCode, productCode2] = cls._PODAAC_Products[product]
746        grid = cls(variableName, rdacCode, productType, areaCode, gdsVersion, fileVersion, productCode, productCode2, convertToCelsius and variableName == u'analysed_sst', timeout, maxRetryTime, cacheDirectory)
747        try:
748            if orderByFields is not None:
749                orderBy = u', '.join(map(lambda f: f + u' ASC', orderByFields))
750            else:
751                from GeoEco.ArcGIS import GeoprocessorManager
752                if GeoprocessorManager.GetArcGISMajorVersion() > 9 or GeoprocessorManager.GetArcGISMinorVersion() >= 2:
753                    orderBy = tField + u' ASC'
754                else:
755                    orderBy = None
756            from GeoEco.Datasets.ArcGIS import ArcGISTable
757            from GeoEco.SpatialAnalysis.Interpolation import Interpolator
758            Interpolator.InterpolateGridsValuesForTableOfPoints([grid], ArcGISTable(points), [valueField], tField=tField, where=where, orderBy=orderBy, method=method, noDataValue=noDataValue, gridsWrap=True, numBlocksToCacheInMemory=numBlocksToCacheInMemory, xBlockSize=xBlockSize, yBlockSize=yBlockSize, tBlockSize=tBlockSize)
759        finally:
760            grid.Close()
761        return points
762
763    @classmethod
764    def CreateCayulaCornillonFrontsAsArcGISRasters(cls, product, minPopMeanDifference,
765                                                   outputWorkspace, mode=u'add', rasterNameExpressions=[u'%(AreaCode)s', u'%(RDACCode)s', u'%(ProductCode)s', u'%(VariableName)s', u'%%Y', '%%Y%%m%%d-%(RDACCode)s-L4%(ProductType)s-%(AreaCode)s-v%(GDSVersion)02i-fv%(FileVersion)s-%(ProductCode)s-%(ImageType)s.img'],
766                                                   medianFilterWindowSize=3, histogramWindowSize=32, histogramWindowStride=1, minPropNonMaskedCells=0.65, minPopProp=0.25, minTheta=0.76, minSinglePopCohesion=0.90, minGlobalPopCohesion=0.92, threads=1,
767                                                   fillHoles=20, thin=True, minSize=10,
768                                                   rotationOffset=None, spatialExtent=None, startDate=None, endDate=None,
769                                                   timeout=60, maxRetryTime=300, cacheDirectory=None,
770                                                   calculateStatistics=True, buildRAT=False, buildPyramids=False,
771                                                   outputCandidateCounts=False, outputFrontCounts=False, outputWindowStatusCodes=False, outputWindowStatusValues=False):
772        cls.__doc__.Obj.ValidateMethodInvocation()
773
774        # Construct a GHRSSTLevel4 instance and rotate and clip it as
775        # requested.
776
777        [rdacCode, productType, areaCode, gdsVersion, fileVersion, productCode, productCode2] = cls._PODAAC_Products[product]
778        grid = cls(u'analysed_sst', rdacCode, productType, areaCode, gdsVersion, fileVersion, productCode, productCode2, False, timeout, maxRetryTime, cacheDirectory)
779        try:
780            grid = cls._RotateAndClip(grid, rotationOffset, spatialExtent, startDate, endDate)
781
782            # Construct a CayulaCornillonFrontsInGrid collection using
783            # the requested parameters.
784
785            from GeoEco.OceanographicAnalysis.Fronts import CayulaCornillonFrontsInGrid
786
787            collection = CayulaCornillonFrontsInGrid(grid,
788                                                     wrapEdges='-GLOB-' in product and spatialExtent is None,
789                                                     medianFilterWindowSize=medianFilterWindowSize,
790                                                     histogramWindowSize=histogramWindowSize,
791                                                     histogramWindowStride=histogramWindowStride,
792                                                     minPropNonMaskedCells=minPropNonMaskedCells,
793                                                     minPopProp=minPopProp,
794                                                     minPopMeanDifference=minPopMeanDifference,
795                                                     minTheta=minTheta,
796                                                     minSinglePopCohesion=minSinglePopCohesion,
797                                                     minGlobalPopCohesion=minGlobalPopCohesion,
798                                                     threads=threads,
799                                                     fillHoles=fillHoles,
800                                                     thin=thin,
801                                                     minSize=minSize)
802            try:
803                try:
804                    # Construct an ArcGISWorkspace instance and import
805                    # time slices from the CayulaCornillonFrontsInGrid
806                    # instance.
807
808                    expression = "ImageType = 'floc'"
809                    if outputCandidateCounts:
810                        expression += " OR ImageType = 'ccnt'"
811                    if outputFrontCounts:
812                        expression += " OR ImageType = 'fcnt'"
813                    if outputWindowStatusCodes:
814                        expression += " OR ImageType = 'wsco'"
815                    if outputWindowStatusValues:
816                        expression += " OR ImageType = 'wsvl'"
817
818                    from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
819
820                    workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, pathCreationExpressions=rasterNameExpressions, cacheTree=True, queryableAttributes=tuple(collection.GetAllQueryableAttributes()))
821                    workspace.ImportDatasets(collection.QueryDatasets(expression), mode, calculateStatistics=calculateStatistics, buildRAT=buildRAT, buildPyramids=buildPyramids)
822
823                # If we caught an exception, log it now. Then delete
824                # the collection object, to ensure its memory is
825                # freed. Normally we don't bother doing this but the
826                # memory it holds can be substantial.
827               
828                except:
829                    from GeoEco.Logging import Logger
830                    Logger.LogExceptionAsError()
831            finally:
832                del collection
833        finally:
834            grid.Close()
835
836        # Return successfully.
837
838        return outputWorkspace
839
840
841class QuikSCATL3TimeSeries(TimeSeriesGridStack):
842    __doc__ = DynamicDocString()
843
844    @classmethod
845    def GetQueryableAttributesForTimeSlices(cls):
846        return (QueryableAttribute(u'DateTime', _(u'Date'), DateTimeTypeMetadata()),
847                QueryableAttribute(u'ProcessingDateTime', _(u'Processing date and time'), UnicodeStringTypeMetadata(mustMatchRegEx=ur'\d\d\d\d\d\d\d\d\d\d\d\d')),
848                QueryableAttribute(u'VariableName', _(u'Variable'), UnicodeStringTypeMetadata(allowedValues=[u'asc_avg_wind_speed', u'des_avg_wind_speed', u'asc_avg_wind_vel_u', u'des_avg_wind_vel_u', u'asc_avg_wind_vel_v', u'des_avg_wind_vel_v', u'asc_avg_wind_speed_sq', u'des_avg_wind_speed_sq', u'asc_wvc_count', u'des_wvc_count', u'asc_time_frac', u'des_time_frac', u'asc_rain_prob', u'des_rain_prob', u'asc_rain_flag', u'des_rain_flag'], makeLowercase=True)))
849
850    def __init__(self, variableName, timeout=60, maxRetryTime=300, cacheDirectory=None):
851        # TODO: validation
852
853        # Initialize our display name.
854
855        self._DisplayName = _(u'QuikSCAT L3 %(variableName)s from NASA PODAAC via OPeNDAP') % {u'variableName': variableName}
856
857        # Construct a THREDDSCatalog for the caller's parameters.
858
859        queryableAttributes = QuikSCATL3TimeSeries.GetQueryableAttributesForTimeSlices()
860
861        import numpy
862        lazyPropertyValues = {'VariableTypes': ['Grid'],
863                              'VariableNames': [variableName],
864                              'SpatialReference': Dataset.ConvertSpatialReference('proj4', '+proj=latlong +ellps=WGS84 +datum=WGS84 +no_defs', 'obj'),
865                              'Dimensions': 'yx',
866                              'Shape': (720, 1440),
867                              'CoordDependencies': (None, None),
868                              'CoordIncrements': (0.25, 0.25),
869                              'TIncrement': 1,
870                              'TIncrementUnit': 'day',
871                              'TSemiRegularity': None,
872                              'TCountPerSemiRegularPeriod': None,
873                              'TCornerCoordType': 'min',
874                              'CornerCoords': (-89.875, 0.125),
875                              'PhysicalDimensions': 'yx',
876                              'PhysicalDimensionsFlipped': (False, False),
877                              'UnscaledDataType': {u'asc_avg_wind_speed': 'uint16',
878                                                   u'des_avg_wind_speed': 'uint16',
879                                                   u'asc_avg_wind_vel_u': 'int16',
880                                                   u'des_avg_wind_vel_u': 'int16',
881                                                   u'asc_avg_wind_vel_v': 'int16',
882                                                   u'des_avg_wind_vel_v': 'int16',
883                                                   u'asc_avg_wind_speed_sq': 'uint32',
884                                                   u'des_avg_wind_speed_sq': 'uint32',
885                                                   u'asc_wvc_count': 'int32',               # OPeNDAP version of the data uses int32, even though the HDF files use int8. This may be because OPeNDAP does not support int8, only uint8.
886                                                   u'des_wvc_count': 'int32',
887                                                   u'asc_time_frac': 'uint16',
888                                                   u'des_time_frac': 'uint16',
889                                                   u'asc_rain_prob': 'uint16',
890                                                   u'des_rain_prob': 'uint16',
891                                                   u'asc_rain_flag': 'int32',               # Again, OPeNDAP version of the data uses int32, even though the HDF files use int8.
892                                                   u'des_rain_flag': 'int32'}[variableName],
893                              'UnscaledNoDataValue': None,
894                              'ScaledDataType': {u'asc_avg_wind_speed': 'float32',
895                                                 u'des_avg_wind_speed': 'float32',
896                                                 u'asc_avg_wind_vel_u': 'float32',
897                                                 u'des_avg_wind_vel_u': 'float32',
898                                                 u'asc_avg_wind_vel_v': 'float32',
899                                                 u'des_avg_wind_vel_v': 'float32',
900                                                 u'asc_avg_wind_speed_sq': 'float32',
901                                                 u'des_avg_wind_speed_sq': 'float32',
902                                                 u'asc_wvc_count': None,
903                                                 u'des_wvc_count': None,
904                                                 u'asc_time_frac': 'float32',
905                                                 u'des_time_frac': 'float32',
906                                                 u'asc_rain_prob': 'float32',
907                                                 u'des_rain_prob': 'float32',
908                                                 u'asc_rain_flag': None,
909                                                 u'des_rain_flag': None}[variableName],
910                              'ScaledNoDataValue': None,
911                              'ScalingFunction': {u'asc_avg_wind_speed': lambda data: numpy.cast['float32'](data) * numpy.cast['float32'](0.01),
912                                                  u'des_avg_wind_speed': lambda data: numpy.cast['float32'](data) * numpy.cast['float32'](0.01),
913                                                  u'asc_avg_wind_vel_u': lambda data: numpy.cast['float32'](data) * numpy.cast['float32'](0.01),
914                                                  u'des_avg_wind_vel_u': lambda data: numpy.cast['float32'](data) * numpy.cast['float32'](0.01),
915                                                  u'asc_avg_wind_vel_v': lambda data: numpy.cast['float32'](data) * numpy.cast['float32'](0.01),
916                                                  u'des_avg_wind_vel_v': lambda data: numpy.cast['float32'](data) * numpy.cast['float32'](0.01),
917                                                  u'asc_avg_wind_speed_sq': lambda data: numpy.cast['float32'](data) * numpy.cast['float32'](0.01),
918                                                  u'des_avg_wind_speed_sq': lambda data: numpy.cast['float32'](data) * numpy.cast['float32'](0.01),
919                                                  u'asc_wvc_count': None,
920                                                  u'des_wvc_count': None,
921                                                  u'asc_time_frac': lambda data: numpy.cast['float32'](data) * numpy.cast['float32'](0.00002),
922                                                  u'des_time_frac': lambda data: numpy.cast['float32'](data) * numpy.cast['float32'](0.00002),
923                                                  u'asc_rain_prob': lambda data: numpy.cast['float32'](data) * numpy.cast['float32'](0.001),
924                                                  u'des_rain_prob': lambda data: numpy.cast['float32'](data) * numpy.cast['float32'](0.001),
925                                                  u'asc_rain_flag': None,
926                                                  u'des_rain_flag': None}[variableName],
927                              'UnscalingFunction': {u'asc_avg_wind_speed': lambda data: numpy.cast['uint16'](numpy.round(data / numpy.cast['float32'](0.01))),
928                                                    u'des_avg_wind_speed': lambda data: numpy.cast['uint16'](numpy.round(data / numpy.cast['float32'](0.01))),
929                                                    u'asc_avg_wind_vel_u': lambda data: numpy.cast['int16'](numpy.round(data / numpy.cast['float32'](0.01))),
930                                                    u'des_avg_wind_vel_u': lambda data: numpy.cast['int16'](numpy.round(data / numpy.cast['float32'](0.01))),
931                                                    u'asc_avg_wind_vel_v': lambda data: numpy.cast['int16'](numpy.round(data / numpy.cast['float32'](0.01))),
932                                                    u'des_avg_wind_vel_v': lambda data: numpy.cast['int16'](numpy.round(data / numpy.cast['float32'](0.01))),
933                                                    u'asc_avg_wind_speed_sq': lambda data: numpy.cast['int32'](numpy.round(data / numpy.cast['float32'](0.01))),
934                                                    u'des_avg_wind_speed_sq': lambda data: numpy.cast['int32'](numpy.round(data / numpy.cast['float32'](0.01))),
935                                                    u'asc_wvc_count': None,
936                                                    u'des_wvc_count': None,
937                                                    u'asc_time_frac': lambda data: numpy.cast['int16'](numpy.round(data / numpy.cast['float32'](0.00002))),
938                                                    u'des_time_frac': lambda data: numpy.cast['int16'](numpy.round(data / numpy.cast['float32'](0.00002))),
939                                                    u'asc_rain_prob': lambda data: numpy.cast['int16'](numpy.round(data / numpy.cast['float32'](0.001))),
940                                                    u'des_rain_prob': lambda data: numpy.cast['int16'](numpy.round(data / numpy.cast['float32'](0.001))),
941                                                    u'asc_rain_flag': None,
942                                                    u'des_rain_flag': None}[variableName]}
943
944        pathParsingExpressions=[r'(?P<Year>\d\d\d\d)',
945                                r'QS_XWGRD3_(?P<Year>\d\d\d\d)(?P<DayOfYear>\d\d\d)\.(?P<ProcessingDateTime>\d\d\d\d\d\d\d\d\d\d\d)\.gz']
946
947        threddsCatalog = THREDDSCatalog(url='http://dods.jpl.nasa.gov/opendap/ocean_wind/quikscat/L3/data/catalog.xml',
948                                        pathParsingExpressions=pathParsingExpressions,
949                                        timeout=timeout,
950                                        maxRetryTime=maxRetryTime,
951                                        queryableAttributes=queryableAttributes,
952                                        lazyPropertyValues=lazyPropertyValues,
953                                        cacheDirectory=cacheDirectory)
954
955        # Initialize the base class.
956
957        super(QuikSCATL3TimeSeries, self).__init__(threddsCatalog, None)
958
959    def _GetDisplayName(self):
960        return self._DisplayName
961
962
963class QuikSCATL3TimeSlicesInDirectory(DirectoryTree):
964    __doc__ = DynamicDocString()
965
966    def __init__(self,
967                 path,
968                 pathParsingExpressions=[r'(?P<Year>\d\d\d\d)',
969                                         r'QS_XWGRD3_(?P<Year>\d\d\d\d)(?P<DayOfYear>\d\d\d)\.(?P<ProcessingDateTime>\d\d\d\d\d\d\d\d\d\d\d)_(?P<VariableName>asc_avg_wind_speed|des_avg_wind_speed|asc_avg_wind_vel_u|des_avg_wind_vel_u|asc_avg_wind_vel_v|des_avg_wind_vel_v|asc_avg_wind_speed_sq|des_avg_wind_speed_sq|asc_wvc_count|des_wvc_count|asc_time_frac|des_time_frac|asc_rain_prob|des_rain_prob|asc_rain_flag|des_rain_flag)\.img'],
970                 datasetType=GDALDataset,
971                 pathCreationExpressions=['%%Y',
972                                          'QS_XWGRD3_%%Y%%j.%(ProcessingDateTime)s_%(VariableName)s.img'],
973                 cacheTree=True):
974       
975        super(QuikSCATL3TimeSlicesInDirectory, self).__init__(path=path,
976                                                            pathParsingExpressions=pathParsingExpressions,
977                                                            datasetType=datasetType,
978                                                            pathCreationExpressions=pathCreationExpressions,
979                                                            cacheTree=cacheTree,
980                                                            queryableAttributes=QuikSCATL3TimeSeries.GetQueryableAttributesForTimeSlices())
981
982
983###############################################################################
984# Metadata: module
985###############################################################################
986
987from GeoEco.ArcGIS import ArcGISDependency
988from GeoEco.Dependencies import PythonAggregatedModuleDependency
989from GeoEco.Datasets.ArcGIS import _UseUnscaledDataDescription, _CalculateStatisticsDescription, _BuildRATDescription, _BuildPyramidsDescription
990from GeoEco.Datasets.Virtual import TimeSeriesGridStack, GridSliceCollection, MaskedGrid, ClippedGrid, RotatedGlobalGrid
991from GeoEco.Metadata import *
992from GeoEco.OceanographicAnalysis.Fronts import CayulaCornillonEdgeDetection, _SIEDDescription, _SIEDReferences, _WindowStatusCodes, _WindowStatusValues
993from GeoEco.Types import *
994
995AddModuleMetadata(shortDescription=_(u'THREDDSCatalogs and OPeNDAPURLs for NASA PO.DAAC datasets.'))    # TODO: Better description
996
997###############################################################################
998# Metadata: MODISL3SSTTimeSeries class
999###############################################################################
1000
1001_MODISL3SSTTimeSeries_LongDescription = _(
1002u"""The NASA Jet Propulsion Laboratory (JPL) `Physical Oceanography
1003Distributed Active Archive Center <http://podaac.jpl.nasa.gov/>`_
1004(PO.DAAC) publishes four collections of sea surface temperature (SST)
1005images gathered by the Moderate Resolution Imaging Spectroradiometer
1006(MODIS) carried by the Terra and Aqua satellites:
1007
1008* `Product 162 <http://podaac.jpl.nasa.gov/PRODUCTS/p162.html>`_ -
1009  MODIS Terra Global Level 3 Mapped Thermal IR SST
1010
1011* `Product 163 <http://podaac.jpl.nasa.gov/PRODUCTS/p163.html>`_ -
1012  MODIS Terra Global Level 3 Mapped Mid-IR SST
1013
1014* `Product 184 <http://podaac.jpl.nasa.gov/PRODUCTS/p184.html>`_ -
1015  MODIS Aqua Global Level 3 Mapped Thermal IR SST
1016
1017* `Product 185 <http://podaac.jpl.nasa.gov/PRODUCTS/p185.html>`_ -
1018  MODIS Aqua Global Level 3 Mapped Mid-IR SST
1019""")
1020
1021_MODISReferences = _(
1022u"""**References**
1023
1024PO.DAAC's
1025`MODIS SST Data Set Guide <ftp://podaac.jpl.nasa.gov/pub/sea_surface_temperature/modis/doc/modis_sst.gd.html>`_
1026provides more information about the MODIS SST datasets.
1027
1028Please see
1029`these instructions <http://podaac.jpl.nasa.gov/WEB_INFO/citations.html>`_
1030on how to acknowledge your use of PO.DAAC products.""")
1031
1032AddClassMetadata(MODISL3SSTTimeSeries,
1033    shortDescription=_(u'Time series of MODIS SST images published by NASA JPL PO.DAAC.'),
1034    longDescription=_MODISL3SSTTimeSeries_LongDescription + _(
1035u"""
1036PO.DAAC presents each collection as a time series of 2D HDF files that
1037may be accessed through a variety of protocols, including `OPeNDAP <http://opendap.org/>`_.
1038Given a satellite name, temporal resolution, spatial resolution, and
1039desired geophysical parameter, this class efficiently accesses the
1040specified time series of images using OPeNDAP, representing them as a
1041single 3D grid with dimensions x, y, and time.
1042
1043""") + _MODISReferences)              # TODO: Add more documentation showing use of class from Python code.
1044
1045# Constructor
1046
1047AddMethodMetadata(MODISL3SSTTimeSeries.__init__,
1048    shortDescription=_(u'Constructs a new MODISL3SSTTimeSeries instance.'),
1049    isExposedToPythonCallers=True,
1050    dependencies=[PythonAggregatedModuleDependency('numpy')])
1051
1052AddArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'self',
1053    typeMetadata=ClassInstanceTypeMetadata(cls=MODISL3SSTTimeSeries),
1054    description=_(u'MODISL3SSTTimeSeries instance.'))
1055
1056AddArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'satellite',
1057    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Aqua', u'Terra'], makeLowercase=True),
1058    description=_(
1059u"""MODIS satellite to use, one of:
1060
1061* Aqua - the Aqua datasets start in July 2002.
1062
1063* Terra - the Terra datasets start in February 2000.
1064"""),
1065    arcGISDisplayName=_(u'Satellite'))
1066
1067AddArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'temporalResolution',
1068    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Daily', u'8day', u'Monthly', u'Annual'], makeLowercase=True),
1069    description=_(
1070u"""Temporal resolution to use, one of:
1071
1072* Daily - daily images. There are 365 during normal years and 366
1073  during leap years.
1074
1075* 8day - 8-day images. There are 46 per year. The first image of the
1076  year starts on January 1. The duration of the last image of the year
1077  is five days during normal years and six days during leap years.
1078
1079* Monthly - monthly images.
1080
1081* Annual - annual images.
1082
1083Although NASA may publish MODIS SST images at other temporal
1084resolutions, they are not supported at this time. If you need one of those
1085products, please contact the author of this tool to see if support may
1086be added.
1087
1088The satellites experience occasional transient failures that prevent
1089data from being collected. NASA opted not to produce any images for
1090these periods. These missing images are represented as time slices
1091filled with the NoData value."""),
1092    arcGISDisplayName=_(u'Temporal resolution'))
1093
1094AddArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'spatialResolution',
1095    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'4km', u'9km'], makeLowercase=True),
1096    description=_(
1097u"""Spatial resolution to use, one of:
1098
1099* 4km - the grid has a cell size of 1/24 geographic degree, or about
1100  4.64 km at the equator, with 8640 columns and 4320 rows.
1101
1102* 9km - the grid has a cell size of 1/12 geographic degree, or about
1103  9.28 km at the equator, with 4320 columns and 2160 rows.
1104"""),
1105    arcGISDisplayName=_(u'Spatial resolution'))
1106
1107AddArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'geophysicalParameter',
1108    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'SST', u'NSST', u'SST4'], makeLowercase=True),
1109    description=_(
1110u"""Geophysical parameter to use, one of:
1111
1112* SST - daytime SST derived from the 11 and 12 micrometer thermal IR
1113  infrared (IR) bands (MODIS channels 31 and 32)
1114
1115* NSST - nighttime SST derived from the 11 and 12 micrometer thermal
1116  IR infrared (IR) bands (MODIS channels 31 and 32)
1117
1118* SST4 -nighttime SST derived from the 3.8-4.1 micrometer mid-IR
1119  infrared (IR) bands (MODIS channels 20, 22, and 23)
1120
1121The geophysical parameter determines the time of day that the data
1122apply to. During the daytime, the satellites pass over the equator at
1123slightly different times, 10:30 for Terra and 13:30 for Aqua, but for
1124simplicity it is assumed that they both pass over at 12:00. Therefore,
1125a daily image of the SST parameter (daytime temperature) is assumed to
1126apply from 00:00 to 23:59 on the date of the image. The nighttime
1127passes occur 12 hours earlier. Thus a daily image of the NSST or SST4
1128parameter (nighttime temperature) is assumed to apply from 12:00 on
1129the previous day to 11:59 of the date of the image. This scheme
1130reflects what is described by the Start Time and End Time global
1131attributes of the MODIS L3 HDF files."""),
1132    arcGISDisplayName=_(u'Geophysical parameter'))
1133
1134AddArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'variableName',
1135    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'l3m_data', u'l3m_qual'], makeLowercase=True),
1136    description=_(
1137u"""Dataset variable to use, one of:
1138
1139* l3m_data - the value of the geophysical parameter (SST). The data
1140  type will be 32-bit floating point, or 16-bit unsigned integers if
1141  the original unscaled values are requested.
1142
1143* l3m_qual - the pixel quality level. The data type will be unsigned
1144  8-bit integer. According to the PO.DAAC MODIS SST documentation, the
1145  possible values are 0 (good), 1 (questionable), and 2 (clouds). The
1146  documentation also mentions the value 3 (bad, other than clouds) but
1147  it appears that NASA already converts these to No Data in both the
1148  l3m_qual and l3m_data images.
1149"""),
1150    arcGISDisplayName=_(u'Dataset variable'))
1151
1152AddArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'qualityLevel',
1153    typeMetadata=IntegerTypeMetadata(canBeNone=True, allowedValues=[0, 1, 2]),
1154    description=_(
1155u"""Pixel quality level for masking the grid, one of:
1156
1157* 0 - pixels with quality level 0 will have data; pixels with quality
1158  levels 1 or 2 will be set to No Data.
1159
1160* 1 - pixels with quality levels 0 and 1 will have data; pixels with
1161  quality level 2 will be set to No Data.
1162
1163* 2 - all pixels will have data.
1164
1165The PO.DAAC MODIS SST documentation states that the possible quality
1166levels are 0 (good), 1 (questionable), and 2 (clouds), and recommends
1167that only quality level 0 pixels be used, but notes that quality level
11681 pixels can be used "under some circumstances". The documentation
1169also mentions the quality level 3 (bad, other than clouds). These
1170appear to include land, satellite malfunctions, and dense clouds, and
1171are converted to No Data by NASA automatically."""),
1172    arcGISDisplayName=_(u'Pixel quality level'),
1173    arcGISCategory=_(u'Masking options'))
1174
1175CopyArgumentMetadata(THREDDSCatalog.__init__, u'timeout', MODISL3SSTTimeSeries.__init__, u'timeout')
1176CopyArgumentMetadata(THREDDSCatalog.__init__, u'maxRetryTime', MODISL3SSTTimeSeries.__init__, u'maxRetryTime')
1177CopyArgumentMetadata(THREDDSCatalog.__init__, u'cacheDirectory', MODISL3SSTTimeSeries.__init__, u'cacheDirectory')
1178
1179AddResultMetadata(MODISL3SSTTimeSeries.__init__, u'grid',
1180    typeMetadata=ClassInstanceTypeMetadata(cls=MODISL3SSTTimeSeries),
1181    description=_(u'MODISL3SSTTimeSeries instance.'))
1182
1183# Public method: MODISL3SSTTimeSeries.CreateArcGISRasters
1184
1185AddMethodMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters,
1186    shortDescription=_(u'Creates rasters for MODIS Level 3 SST images published by NASA JPL PO.DAAC.'),
1187    longDescription=_MODISL3SSTTimeSeries_LongDescription + _(
1188u"""
1189Given a satellite name, temporal resolution, spatial resolution, and
1190desired geophysical parameter, this tool efficiently downloads the
1191specified images using the `OPeNDAP <http://opendap.org/>`_ protocol
1192and creates corresponding rasters.
1193
1194""" + _MODISReferences),
1195    isExposedToPythonCallers=True,
1196    isExposedByCOM=True,
1197    isExposedAsArcGISTool=True,
1198    arcGISDisplayName=_(u'Create Rasters for PO.DAAC MODIS L3 SST'),
1199    arcGISToolCategory=_(u'Data Products\\NASA JPL PO.DAAC\\MODIS Global Level 3 Mapped SST'),
1200    dependencies=[ArcGISDependency(9, 1), PythonAggregatedModuleDependency('numpy')])
1201
1202AddArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'cls',
1203    typeMetadata=ClassOrClassInstanceTypeMetadata(cls=MODISL3SSTTimeSeries),
1204    description=_(u'MODISL3SSTTimeSeries class or instance.'))
1205
1206CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'satellite', MODISL3SSTTimeSeries.CreateArcGISRasters, u'satellite')
1207CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'temporalResolution', MODISL3SSTTimeSeries.CreateArcGISRasters, u'temporalResolution')
1208CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'spatialResolution', MODISL3SSTTimeSeries.CreateArcGISRasters, u'spatialResolution')
1209CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'geophysicalParameter', MODISL3SSTTimeSeries.CreateArcGISRasters, u'geophysicalParameter')
1210CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'variableName', MODISL3SSTTimeSeries.CreateArcGISRasters, u'variableName')
1211
1212AddArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'outputWorkspace',
1213    typeMetadata=ArcGISWorkspaceTypeMetadata(createParentDirectories=True),
1214    description=_(
1215u"""Directory or geodatabase to receive the rasters.
1216
1217Unless you have a specific reason to store the rasters in a
1218geodatabase, we recommend you store them in a directory because it
1219will be much faster and allows the rasters to be organized in a tree.
1220If you do store the rasters in a geodatabase, you must change the
1221Raster Name Expressions parameter; see below for more
1222information."""),
1223    arcGISDisplayName=_(u'Output workspace'))
1224
1225AddArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'mode',
1226    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Add', u'Replace'], makeLowercase=True),
1227    description=_(
1228u"""Overwrite mode, one of:
1229
1230* Add - create rasters that do not exist and skip those that already
1231  exist. This is the default.
1232
1233* Replace - create rasters that do not exist and overwrite those that
1234  already exist.
1235
1236'Add' should be appropriate for nearly all situations. One situation
1237in which 'Replace' is appropriate is when the data publisher
1238reprocesses the entire dataset with improved algorithms and releases
1239updated images. In that case, you may wish to recreate all of your
1240rasters using the updated data.
1241
1242The ArcGIS Overwrite Outputs geoprocessing setting has no effect on
1243this tool. If 'Replace' is selected the rasters will be overwritten,
1244regardless of the ArcGIS Overwrite Outputs setting."""),
1245    arcGISDisplayName=_(u'Overwrite mode'))
1246
1247AddArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'rasterNameExpressions',
1248    typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(), minLength=1),
1249    description=_(
1250u"""List of expressions specifying how the output rasters should be
1251named.
1252
1253The default expression assumes you are storing rasters in a file
1254system directory and creates them in a tree structure with names that
1255imitate those used by NASA. When storing rasters in a directory, the
1256final expression specifies the file name of the raster and any
1257preceding expressions specify subdirectories. The extension of the
1258final expression determines the output raster format: .asc for ArcInfo
1259ASCII Grid, .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE
1260file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for
1261GeoTIFF, or no extension for ArcInfo Binary Grid. The default
1262expression uses .img.
1263
1264When storing rasters in a geodatabase, you should provide only one
1265expression. That expression specifies the raster's name.
1266
1267Each expression may contain any sequence of characters permitted by
1268the output workspace. Each expression may optionally contain one or
1269more of the following case-sensitive codes. The tool replaces the
1270codes with appropriate values when creating each raster:
1271
1272* %(Satellite)s - name of the satellite, either "aqua" or "terra".
1273
1274* %(SatelliteCode)s - abbreviation for the satellite, either "A" or
1275  "T", used in NASA's file naming scheme.
1276
1277* %(TemporalResolution)s - temporal resolution, either "daily",
1278  "8day", "monthly", or "annual".
1279
1280* %(TemporalResolutionCode)s - abbreviation for the temporal
1281  resolution, either "DAY", "8D", "MO", or "YR", used in NASA's file
1282  naming scheme.
1283
1284* %(SpatialResolution)s - spatial resolution, either "4km" or "9km".
1285
1286* %(SpatialResolutionCode)s - abbreviation for the spatial
1287  resolution, either "4" or "9", used in NASA's file naming scheme.
1288 
1289* %(GeophysicalParameter)s - geophysical parameter represented in the
1290  output raster, either "sst", "nsst", or "sst4".
1291
1292* %(Algorithm)s - algorithm used to estimate the geophysical
1293  parameter from the raw sensor values, either "sst" for the sst or
1294  nsst geophysical parameter, or "sst4" for the sst4 geophysical
1295  parameter. The algorithm name is used in NASA's file naming scheme.
1296
1297* %(Wavelength)s - an alternative abbreviation for the algorithm used
1298  to estimate the geophysical parameter, either "11um" for the sst or
1299  nsst geophysical parameter, or "4um" for the sst4 geophysical
1300  parameter. The abbreviation refers to the wavelengths of the MODIS
1301  bands used in the algorithm, where 11um refers to the "thermal IR"
1302  bands and 4um refers to the "mid-IR" bands. The abbreviation is used
1303  in NASA's file naming scheme.
1304
1305* %(VariableName)s - dataset variable represented in the output
1306  raster, either "l3m_data" for the value of the geophysical parameter
1307  or "l3m_qual" for the pixel quality level.
1308
1309* %%Y - four-digit year of the raster.
1310
1311* %%m - two-digit month of the first day of the raster.
1312
1313* %%d - two-digit day of the month of the first day of the raster.
1314
1315* %%j - three-digit day of the year of the first day of the raster.
1316
1317* %(EndDate)s - date of the last day of the raster in the format
1318  "YYYYjjj" where YYYY is the four-digit year and jjj is the
1319  three-digit day of the year. This date is used in NASA's file naming
1320  scheme for temporal resolutions other than "daily".
1321"""),
1322    arcGISDisplayName=_(u'Raster name expressions'))
1323
1324AddArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'rasterCatalog',
1325    typeMetadata=ArcGISRasterCatalogTypeMetadata(canBeNone=True, mustBeDifferentThanArguments=[u'outputWorkspace'], createParentDirectories=True),
1326    description=_(
1327u"""Raster catalog to create.
1328
1329This parameter requires ArcGIS 9.3 or later.
1330
1331If this parameter is specified, after the tool finishes creating
1332rasters, it will create an unmanaged raster catalog and import all of
1333the rasters in the output workspace into it. The catalog will have
1334fields for all of the codes specified in the Raster Name Expressions
1335as well as fields for the start date, center date, and end date of
1336each raster. You can then use the catalog to create animations using
1337the ArcGIS 10 Time Slider.
1338
1339WARNING: The raster catalog will be deleted and re-created each time
1340the tool is executed. Beware of this if you plan to add your own
1341fields to the catalog after it has been created."""),
1342    direction=u'Output',
1343    arcGISDisplayName=_(u'Output raster catalog'),
1344    dependencies=[ArcGISDependency(9, 3)])
1345
1346CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'qualityLevel', MODISL3SSTTimeSeries.CreateArcGISRasters, u'qualityLevel')
1347
1348AddArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'rotationOffset',
1349    typeMetadata=FloatTypeMetadata(canBeNone=True),
1350    description=_(
1351u"""Degrees to rotate the output rasters about the polar axis. If not
1352provided, the output rasters will be centered on the Prime Meridian
1353and have x coordinates ranging from -180 to 180.
1354
1355Use this parameter to shift the center longitude to a different
1356location. Positive values shift it to the east, negative values to the
1357west. For example, to center the output rasters on the Pacific ocean
1358and use x coordinates ranging from 0 to 360 rather than -180 to 180,
1359provide 180 for this parameter.
1360
1361The rasters can only be rotated in whole grid cells. The value you
1362provide will be rounded off to the closest cell."""),
1363    arcGISDisplayName=_(u'Rotate raster by'),
1364    arcGISCategory=_(u'Spatiotemporal extent'))
1365
1366AddArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'spatialExtent',
1367    typeMetadata=EnvelopeTypeMetadata(canBeNone=True),
1368    description=_(
1369u"""Spatial extent of the output rasters, in degrees. If not provided,
1370the spatial extent will not be clipped.
1371
1372This parameter is applied after the rotation parameter and uses
1373coordinates that result after rotation. For example, if the rotation
1374parameter was 180, the resulting rasters will have x coordinates
1375ranging from 0 to 360. The spatial extent should be expressed in those
1376coordinates.
1377
1378The rasters can only be clipped in whole grid cells. The values you
1379provide will be rounded off to the closest cell."""),
1380    arcGISDisplayName=_(u'Spatial extent'),
1381    arcGISCategory=_(u'Spatiotemporal extent'))
1382
1383AddArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'startDate',
1384    typeMetadata=DateTimeTypeMetadata(canBeNone=True),
1385    description=_(
1386u"""Start date for the rasters to create. Rasters will be created for
1387images that occur on or after the start date and on or before the end
1388date. If the start date is not provided, the date of the oldest image
1389will be used.
1390
1391The time component of the start date is ignored."""),
1392    arcGISDisplayName=_(u'Start date'),
1393    arcGISCategory=_(u'Spatiotemporal extent'))
1394
1395AddArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'endDate',
1396    typeMetadata=DateTimeTypeMetadata(canBeNone=True),
1397    description=_(
1398u"""End date for the rasters to create. Rasters will be created for
1399images that occur on or after the start date and on or before the end
1400date. If the end date is not provided, the date of the most recent
1401image will be used.
1402
1403The time component of the end date is ignored."""),
1404    arcGISDisplayName=_(u'End date'),
1405    arcGISCategory=_(u'Spatiotemporal extent'))
1406
1407CopyArgumentMetadata(THREDDSCatalog.__init__, u'timeout', MODISL3SSTTimeSeries.CreateArcGISRasters, u'timeout')
1408CopyArgumentMetadata(THREDDSCatalog.__init__, u'maxRetryTime', MODISL3SSTTimeSeries.CreateArcGISRasters, u'maxRetryTime')
1409CopyArgumentMetadata(THREDDSCatalog.__init__, u'cacheDirectory', MODISL3SSTTimeSeries.CreateArcGISRasters, u'cacheDirectory')
1410
1411AddArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'useUnscaledData',
1412    typeMetadata=BooleanTypeMetadata(),
1413    description=_UseUnscaledDataDescription,
1414    arcGISDisplayName=_(u'Use unscaled data'),
1415    arcGISCategory=_(u'Additional raster processing options'))
1416
1417AddArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'calculateStatistics',
1418    typeMetadata=BooleanTypeMetadata(),
1419    description=_CalculateStatisticsDescription,
1420    arcGISDisplayName=_(u'Calculate statistics'),
1421    arcGISCategory=_(u'Additional raster processing options'))
1422
1423AddArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'buildRAT',
1424    typeMetadata=BooleanTypeMetadata(),
1425    description=_BuildRATDescription,
1426    arcGISDisplayName=_(u'Build raster attribute tables'),
1427    arcGISCategory=_(u'Additional raster processing options'))
1428
1429AddArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'buildPyramids',
1430    typeMetadata=BooleanTypeMetadata(),
1431    description=_BuildPyramidsDescription,
1432    arcGISDisplayName=_(u'Build pyramids'),
1433    arcGISCategory=_(u'Additional raster processing options'))
1434
1435AddResultMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'updatedOutputWorkspace',
1436    typeMetadata=ArcGISWorkspaceTypeMetadata(),
1437    description=_(u'Updated output workspace.'),
1438    arcGISDisplayName=_(u'Updated output workspace'),
1439    arcGISParameterDependencies=[u'outputWorkspace'])
1440
1441# Public method: MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters
1442
1443AddMethodMetadata(MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters,
1444    shortDescription=_(u'Creates climatological rasters from MODIS Level 3 SST images published by NASA JPL PO.DAAC.'),
1445    longDescription=_MODISL3SSTTimeSeries_LongDescription + _(
1446u"""
1447This tool produces rasters showing the climatological average value
1448(or other statistic) of a time series of MODIS SST images. Given a
1449specification of the desired MODIS SST time series, a statistic, and a
1450climatological bin definition, this tool efficiently downloads the
1451images using the `OPeNDAP <http://opendap.org/>`_ protocol, classifies
1452them into bins, and produces a single raster for each bin. Each cell
1453of the raster is produced by calculating the statistic on the values
1454of that cell extracted from all of the rasters in the bin.
1455
1456""" + _MODISReferences),
1457    isExposedToPythonCallers=True,
1458    isExposedByCOM=True,
1459    isExposedAsArcGISTool=True,
1460    arcGISDisplayName=_(u'Create Climatological Rasters for PO.DAAC MODIS L3 SST'),
1461    arcGISToolCategory=_(u'Data Products\\NASA JPL PO.DAAC\\MODIS Global Level 3 Mapped SST'),
1462    dependencies=[ArcGISDependency(9, 1), PythonAggregatedModuleDependency('numpy')])
1463
1464CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'cls', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'cls')
1465CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'satellite', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'satellite')
1466CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'temporalResolution', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'temporalResolution')
1467CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'spatialResolution', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'spatialResolution')
1468CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'geophysicalParameter', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'geophysicalParameter')
1469CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'variableName', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'variableName')
1470
1471AddArgumentMetadata(MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'statistic',
1472    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Count', u'Maximum', u'Mean', u'Minimum', u'Range', u'Standard Deviation', u'Sum'], makeLowercase=True),
1473    description=_(
1474u"""Statistic to calculate for each cell, one of:
1475
1476* Count - number of images in which the cell had data.
1477
1478* Maximum - maximum value for the cell.
1479
1480* Mean - mean value for the cell, calculated as the sum divided by the
1481  count.
1482
1483* Minimum - minimum value for the cell.
1484
1485* Range - range for the cell, calculated as the maximum minus the
1486  minimum.
1487
1488* Standard Deviation - sample standard deviation for the cell
1489  (i.e. the standard deviation estimated using Bessel's correction).
1490  In order to calculate this, there must be at least two images with
1491  data for the cell.
1492
1493* Sum - the sum for the cell.
1494"""),
1495    arcGISDisplayName=_(u'Statistic'))
1496
1497AddArgumentMetadata(MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'binType',
1498    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Daily', u'Monthly', u'Cumulative'], makeLowercase=True),
1499    description=_(
1500u"""Climatology bins to use, one of:
1501
1502* Daily - daily bins. Images will be classified into bins according to
1503  their days of the year. The number of days in each bin is determined
1504  by the Climatology Bin Duration parameter (which defaults to 1). The
1505  number of bins is calculated by dividing 365 by the bin duration. If
1506  there is no remainder, then that number of bins will be created;
1507  images for the 366th day of leap years will be counted in the bin
1508  that includes day 365. For example, if the bin duration is 5, 73
1509  bins will be created. The first will be for days 1-5, the second
1510  will be for days 5-10, and so on; the 73rd bin will be for days
1511  361-365 during normal years and 361-366 during leap years. If
1512  dividing 365 by the bin duration does yield a remainder, then one
1513  additional bin will be created to hold the remaining days. For
1514  example, if the bin duration is 8, 46 bins will be created. The
1515  first will be for days 1-8, the second for days 9-16, and so on; the
1516  46th will be for days 361-365 during normal years and 361-366 during
1517  leap years.
1518
1519* Monthly - monthly bins. Images will be classified into bins according to
1520  their months of the year. The number of months in each bin is
1521  determined by the Climatology Bin Duration parameter (which defaults
1522  to 1). The number of bins is calculated by dividing 12 by the bin
1523  duration. If there is no remainder, then that number of bins will be
1524  created. For example, if the bin duration is 3, there will be four
1525  bins: January-March, April-June, July-September, and
1526  October-December. If there is a remainder, then one additional bin
1527  will be created. For example, if the bin duration is 5, 3 bins will
1528  be created: January-May, June-October, November-December.
1529
1530* Cumulative - one bin. A single climatology raster will be calculated
1531  from the entire dataset. The Bin Duration parameter is ignored.
1532
1533For Daily and Monthly, to adjust when the bins start (e.g. to center a
15344-bin seasonal climatology on solstices and equinoxes), use the Start
1535Climatology At This Day Of The Year parameter."""),
1536    arcGISDisplayName=_(u'Climatology bin type'))
1537
1538CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'outputWorkspace', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'outputWorkspace')
1539
1540AddArgumentMetadata(MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'mode',
1541    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Add', u'Replace'], makeLowercase=True),
1542    description=_(
1543u"""Overwrite mode, one of:
1544
1545* Add - create rasters that do not exist and skip those that already
1546  exist. This is the default.
1547
1548* Replace - create rasters that do not exist and overwrite those that
1549  already exist. Choose this option when you want to regenerate the
1550  climatologies using the latest images.
1551
1552The ArcGIS Overwrite Outputs geoprocessing setting has no effect on
1553this tool. If 'Replace' is selected the rasters will be overwritten,
1554regardless of the ArcGIS Overwrite Outputs setting."""),
1555    arcGISDisplayName=_(u'Overwrite mode'))
1556
1557AddArgumentMetadata(MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'rasterNameExpressions',
1558    typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(), minLength=1),
1559    description=_(
1560u"""List of expressions specifying how the output rasters should be
1561named.
1562
1563The default expression assumes you are storing rasters in a file
1564system directory and creates them in a tree structure. When storing
1565rasters in a directory, the final expression specifies the file name
1566of the raster and any preceding expressions specify subdirectories.
1567The extension of the final expression determines the output raster
1568format: .asc for ArcInfo ASCII Grid, .bmp for BMP, .gif for GIF, .img
1569for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for
1570PNG, .tif for GeoTIFF, or no extension for ArcInfo Binary Grid. The
1571default expression uses .img.
1572
1573When storing rasters in a geodatabase, you should provide only one
1574expression. That expression specifies the raster's name.
1575
1576Each expression may contain any sequence of characters permitted by
1577the output workspace. Each expression may optionally contain one or
1578more of the following case-sensitive codes. The tool replaces the
1579codes with appropriate values when creating each raster:
1580
1581* %(Satellite)s - name of the satellite, either "aqua" or "terra".
1582
1583* %(SatelliteCode)s - abbreviation for the satellite, either "A" or
1584  "T", used in NASA's file naming scheme.
1585
1586* %(TemporalResolution)s - temporal resolution, either "daily",
1587  "8day", "monthly", or "annual".
1588
1589* %(TemporalResolutionCode)s - abbreviation for the temporal
1590  resolution, either "DAY", "8D", "MO", or "YR", used in NASA's file
1591  naming scheme.
1592
1593* %(SpatialResolution)s - spatial resolution, either "4km" or "9km".
1594
1595* %(SpatialResolutionCode)s - abbreviation for the spatial
1596  resolution, either "4" or "9", used in NASA's file naming scheme.
1597 
1598* %(GeophysicalParameter)s - geophysical parameter represented in the
1599  output raster, either "sst", "nsst", or "sst4".
1600
1601* %(Algorithm)s - algorithm used to estimate the geophysical
1602  parameter from the raw sensor values, either "sst" for the sst or
1603  nsst geophysical parameter, or "sst4" for the sst4 geophysical
1604  parameter. The algorithm name is used in NASA's file naming scheme.
1605
1606* %(Wavelength)s - an alternative abbreviation for the algorithm used
1607  to estimate the geophysical parameter, either "11um" for the sst or
1608  nsst geophysical parameter, or "4um" for the sst4 geophysical
1609  parameter. The abbreviation refers to the wavelengths of the MODIS
1610  bands used in the algorithm, where 11um refers to the "thermal IR"
1611  bands and 4um refers to the "mid-IR" bands. The abbreviation is used
1612  in NASA's file naming scheme.
1613
1614* %(VariableName)s - dataset variable represented in the output
1615  raster, either "l3m_data" for the value of the geophysical parameter
1616  or "l3m_qual" for the pixel quality level.
1617
1618* %(ClimatologyBinType)s - type of the climatology bin, either "Daily"
1619  if 1-day bins, "Xday" if multi-day bins (X is replaced by the
1620  duration), "Monthly" if 1-month bins, "Xmonth" if multi-month bins,
1621  or "Cumulative".
1622
1623* %(ClimatologyBinName)s - name of the climatology bin corresponding
1624  represented by the output raster, either "dayXXX" for 1-day bins
1625  (XXX is replaced by the day of the year), "daysXXXtoYYY" for
1626  multi-day bins (XXX is replaced by the first day of the bin, YYY is
1627  replaced by the last day), "monthXX" for 1-month bins (XX is
1628  replaced by the month), "monthXXtoYY" (XX is replaced by the first
1629  month of the bin, YY by the last month), or "cumulative".
1630
1631* %(Statistic)s - statistic that was calculated, in lowercase and with
1632  spaces replaced by underscores; one of: "count", "maximum", "mean",
1633  "minimum", "range", "standard_deviation", "Sum".
1634
1635If the Bin Type is "Daily", the following additional codes are
1636available:
1637
1638* %(FirstDay)i - first day of the year of the climatology bin
1639  represented by the output raster.
1640
1641* %(LastDay)i - last day of the year of the climatology bin
1642  represented by the output raster. For 1-day climatologies, this will
1643  be the same as %(FirstDay)i.
1644
1645If the Bin Type is "Monthly", the following additional codes are
1646available:
1647
1648* %(FirstMonth)i - first month of the climatology bin represented by
1649  the output raster.
1650
1651* %(DayOfFirstMonth)i - first day of the first month of the
1652  climatology bin represented by the output raster.
1653
1654* %(LastMonth)i - last month of the climatology bin represented by
1655  the output raster.
1656
1657* %(DayOfLastMonth)i - last day of the last month of the climatology
1658  bin represented by the output raster.
1659
1660Note that the additional codes are integers and may be formatted using
1661"printf"-style formatting codes. For example, to format the FirstDay
1662as a three-digit number with leading zeros::
1663
1664    %(FirstDay)03i
1665"""),
1666    arcGISDisplayName=_(u'Raster name expressions'))
1667
1668CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'qualityLevel', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'qualityLevel')
1669
1670AddArgumentMetadata(MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'binDuration',
1671    typeMetadata=IntegerTypeMetadata(minValue=1),
1672    description=_(
1673u"""Duration of each bin, in days or months, when the Bin Type is
1674Daily or Monthly, respectively. The default is 1. See the Bin Type
1675parameter for more information."""),
1676    arcGISDisplayName=_(u'Climatology bin duration'),
1677    arcGISCategory=_(u'Climatology options'))
1678
1679AddArgumentMetadata(MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'startDayOfYear',
1680    typeMetadata=IntegerTypeMetadata(minValue=1, maxValue=365),
1681    description=_(
1682u"""Use this parameter to create bin defintions that deviate from the
1683traditional calendar. The interpretation of this parameter depends on
1684the Bin Type:
1685
1686* Daily - this parameter defines the day of the year of the first
1687  climatology bin. For example, if this parameter is 100 and the Bin
1688  Duration is 10, the first bin will be numbered 100-109. The bin
1689  spanning the end of the year will be numbered 360-004. The last bin
1690  will be numbered 095-099. To define a four-bin climatology with bins
1691  that are centered approximately on the equinoxes and solstices
1692  (i.e., a seasonal climatology), set the Bin Duration to 91 and the
1693  start day to 36 (February 5). This will produce bins with dates
1694  036-126, 127-217, 218-308, and 309-035.
1695
1696* Monthly - this parameter defines the day of the year of the first
1697  climatology bin, and the day of the month of that bin will be used
1698  as the first day of the month of all of the bins. For example, if
1699  this parameter is 46, which is February 15, and the Bin Duration is
1700  1, then the bins will be February 15 - March 14, March 15 - April
1701  14, April 15 - May 14, and so on. Calculations involving this
1702  parameter always assume a 365 day year (a non-leap year). To define
1703  a four-bin climatology using the months traditionally associated
1704  with spring, summer, fall, and winter in many northern hemisphere
1705  cultures, set the Bin Duration to 3 and the start day to 60 (March
1706  1). This will produce bins with months 03-05, 06-08, 09-11, and
1707  12-02.
1708
1709* Cumulative - this parameter is ignored.
1710"""),
1711    arcGISDisplayName=_(u'Start climatology at this day of the year'),
1712    arcGISCategory=_(u'Climatology options'))
1713
1714CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'rotationOffset', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'rotationOffset')
1715CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'spatialExtent', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'spatialExtent')
1716CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'startDate', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'startDate')
1717CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'endDate', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'endDate')
1718CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'timeout', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'timeout')
1719CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'maxRetryTime', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'maxRetryTime')
1720CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'cacheDirectory', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'cacheDirectory')
1721CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'calculateStatistics', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'calculateStatistics')
1722CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'buildPyramids', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'buildPyramids')
1723
1724CopyResultMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'updatedOutputWorkspace', MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'updatedOutputWorkspace')
1725
1726# Public method: MODISL3SSTTimeSeries.InterpolateAtArcGISPoints
1727
1728AddMethodMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints,
1729    shortDescription=_(u'Interpolates PO.DAAC MODIS Level 3 SST values at points.'),
1730    longDescription=_MODISL3SSTTimeSeries_LongDescription + _(
1731u"""
1732Given a satellite name, temporal resolution, spatial resolution, and
1733desired geophysical parameter, this tool interpolates the value of
1734that parameter at the given points. This tool performs the same basic
1735operation as the ArcGIS Spatial Analyst's Extract Values to Points
1736tool, but it reads the MODIS data directly from NASA's servers using
1737the `OPeNDAP <http://opendap.org/>`_ protocol, rather than reading
1738rasters stored on your machine.
1739
1740""" + _MODISReferences),
1741    isExposedToPythonCallers=True,
1742    isExposedByCOM=True,
1743    isExposedAsArcGISTool=True,
1744    arcGISDisplayName=_(u'Interpolate PO.DAAC MODIS L3 SST at Points'),
1745    arcGISToolCategory=_(u'Data Products\\NASA JPL PO.DAAC\\MODIS Global Level 3 Mapped SST'),
1746    dependencies=[ArcGISDependency(9, 1, requiresCOMInstantiation=True), PythonAggregatedModuleDependency('numpy')])
1747
1748CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'cls', MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'cls')
1749CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'satellite', MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'satellite')
1750CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'temporalResolution', MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'temporalResolution')
1751CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'spatialResolution', MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'spatialResolution')
1752CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'geophysicalParameter', MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'geophysicalParameter')
1753CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'variableName', MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'variableName')
1754
1755AddArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'points',
1756    typeMetadata=ArcGISFeatureLayerTypeMetadata(mustExist=True, allowedShapeTypes=[u'Point']),
1757    description=_(
1758u"""Points at which values should be interpolated.
1759
1760The SST data use the WGS 1984 geographic coordinate system. It is
1761recommended but not required that the points use the same coordinate
1762system. If they do not, this tool will attempt to project the points
1763to the WGS 1984 coordinate system prior to doing the interpolation.
1764This may fail if a datum transformation is required, in which case you
1765will have to manually project the points to the WGS 1984 coordinate
1766system before using this tool."""),
1767    arcGISDisplayName=_(u'Point features'))
1768
1769AddArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'valueField',
1770    typeMetadata=ArcGISFieldTypeMetadata(mustExist=True, allowedFieldTypes=[u'short', u'long', u'float', u'double']),
1771    description=_(
1772u"""Field of the points to receive the interpolated values.
1773
1774The field must have a floating-point or integer data type. If the
1775field cannot represent the interpolated value at full precision, the
1776closest approximation will be stored and a warning will be issued.
1777This will happen, for example, when you interpolate SST values into an
1778integer field."""),
1779    arcGISDisplayName=_(u'Field to receive the interpolated values'),
1780    arcGISParameterDependencies=[u'points'])
1781
1782AddArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'tField',
1783    typeMetadata=ArcGISFieldTypeMetadata(mustExist=True, allowedFieldTypes=[u'date']),
1784    description=_(
1785u"""Field of the points that specifies the date and time of the point.
1786
1787The field must have a date or datetime data type. If the field can
1788only represent dates with no time component, the time will assumed to
1789be 00:00:00."""),
1790    arcGISDisplayName=_(u'Date field'),
1791    arcGISParameterDependencies=[u'points'])
1792
1793AddArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'method',
1794    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Nearest', u'Linear'], makeLowercase=True),
1795    description=_(
1796u"""Interpolation method to use, one of:
1797
1798* Nearest - nearest neighbor interpolation. The interpolated value
1799  will simply be the value of the cell that contains the point. This
1800  is the default.
1801
1802* Linear - linear interpolation (also known as trilinear
1803  interpolation). This method is suitable for the l3m_data variable
1804  (SST), a continuous variable, but is not appropriate for the
1805  l3m_qual variable, a categorical variable (use nearest neighbor
1806  instead). This method averages the values of the eight nearest cells
1807  in the x, y, and time dimensions, weighting the contribution of each
1808  cell by the area of it that would be covered by a hypothetical cell
1809  centered on the point being interpolated. If the cell containing the
1810  point contains NoData, the result is NoData. If any of the other
1811  seven cells contain NoData, they are omitted from the average, and
1812  the result is based on the weighted average of the cells that do
1813  contain data. This is the same algorithm implemented by the ArcGIS
1814  Spatial Analyst's Extract Values to Points tool.
1815"""),
1816    arcGISDisplayName=_(u'Interpolation method'))
1817
1818AddArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'where',
1819    typeMetadata=SQLWhereClauseTypeMetadata(canBeNone=True),
1820    description=_(
1821u"""SQL WHERE clause expression that specifies the subset of points to
1822use. If this parameter is not provided, all of the points will be
1823used.
1824
1825The exact syntax of this expression depends on the type of feature
1826class you're using. ESRI recommends you reference fields using the
1827following syntax:
1828
1829* For shapefiles, ArcInfo coverages, or feature classes stored in file
1830  geodatabases, ArcSDE geodatabases, or ArcIMS, enclose field names in
1831  double quotes: "MY_FIELD"
1832
1833* For feature classes stored in personal geodatabases, enclose field
1834  names in square brackets: [MY_FIELD].
1835"""),
1836    arcGISDisplayName=_(u'Where clause'),
1837    arcGISCategory=_(u'Interpolation options'),
1838    arcGISParameterDependencies=[u'points'])
1839
1840AddArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'noDataValue',
1841    typeMetadata=FloatTypeMetadata(canBeNone=True),
1842    description=_(
1843u"""Value to use when the interpolated value is NoData.
1844
1845If a value is not provided for this parameter, a database NULL value
1846will be stored in the field when the interpolated value is NoData. If
1847the field cannot store NULL values, as is the case with shapefiles,
1848the value -9999 will be used."""),
1849    arcGISDisplayName=_(u'Value to use when the interpolated value is NoData'),
1850    arcGISCategory=_(u'Interpolation options'))
1851
1852CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'qualityLevel', MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'qualityLevel')
1853CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'timeout', MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'timeout')
1854CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'maxRetryTime', MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'maxRetryTime')
1855CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'cacheDirectory', MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'cacheDirectory')
1856
1857AddArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'orderByFields',
1858    typeMetadata=ListTypeMetadata(elementType=ArcGISFieldTypeMetadata(mustExist=True), minLength=1, canBeNone=True),
1859    description=_(
1860u"""Fields for defining the order in which the points are processed.
1861
1862The points may be processed faster if they are ordered
1863spatiotemporally, such that points that are close in space and time
1864are processed sequentially. Ordering the points this way increases the
1865probability that the value of a given point can be interpolated from
1866data that is cached in memory, rather than from data that must be read
1867from the disk or network, which is much slower. Choose fields that
1868faciliate this. For example, if your points represent the locations of
1869animals tracked by satellite telemetry, order the processing first by
1870the animal ID and then by the transmission date or number.
1871
1872If you omit this parameter, the Date Field will be used automatically.
1873
1874This parameter requires ArcGIS 9.2 or later."""),
1875    arcGISDisplayName=_(u'Order by fields'),
1876    arcGISCategory=_(u'Performance tuning options'),
1877    arcGISParameterDependencies=[u'points'],
1878    dependencies=[ArcGISDependency(9, 2)])
1879
1880AddArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'numBlocksToCacheInMemory',
1881    typeMetadata=IntegerTypeMetadata(minValue=0, canBeNone=True),
1882    description=_(
1883u"""Maximum number of blocks of SST data to cache in memory.
1884
1885To minimize the number of times that the disk or network must be
1886accessed, this tool employs a simple caching strategy, in addition to
1887disk caching described by the Cache Directory parameter. When it
1888processes the first point, it reads a square block of cells centered
1889on that point and caches it in memory. When it processes the second
1890and subsequent points, it first checks whether the cells needed for
1891that point are contained by the block cached in memory. If so, it
1892processes that point using the in-memory block, rather than reading
1893from disk or the network again. If not, it reads another square block
1894centered on that point and adds it to the cache.
1895
1896The tool processes the remaining points, adding additional blocks to
1897the cache, as needed. To prevent the cache from exhausing all memory,
1898it is only permitted to grow to the size specified by this parameter.
1899When the cache is full but a new block is needed, the oldest block is
1900discarded to make room for the newest block.
1901
1902The maximum size of the cache in bytes may be calculated by
1903multiplying this parameter by the block size parameters and the data
1904type of the geophysical parameter (either 4 bytes for the l3m_data or
19052 bytes for l3m_qual). For example, if this parameter is 128 and the
1906blocks are x=32 by y=32 by t=2 and you're interpolating the l3m_data
1907parameter (SST) which is 4 bytes, the maximum size of the cache is
19081048576 bytes (1 MB).
1909
1910If this parameter is 0, no blocks will be cached in memory."""),
1911    arcGISDisplayName=_(u'Number of blocks of data to cache in memory'),
1912    arcGISCategory=_(u'Performance tuning options'))
1913
1914AddArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'xBlockSize',
1915    typeMetadata=IntegerTypeMetadata(minValue=0, canBeNone=True),
1916    description=_(
1917u"""Size of the blocks of SST data to cache in memory, in the x
1918direction (longitude). The size is given as the number of cells.
1919
1920If this parameter is 0, no blocks will be cached in memory."""),
1921    arcGISDisplayName=_(u'In-memory cache block size, in X direction'),
1922    arcGISCategory=_(u'Performance tuning options'))
1923
1924AddArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'yBlockSize',
1925    typeMetadata=IntegerTypeMetadata(minValue=0, canBeNone=True),
1926    description=_(
1927u"""Size of the blocks of SST data to cache in memory, in the y
1928direction (latitude). The size is given as the number of cells.
1929
1930If this parameter is 0, no blocks will be cached in memory."""),
1931    arcGISDisplayName=_(u'In-memory cache block size, in Y direction'),
1932    arcGISCategory=_(u'Performance tuning options'))
1933
1934AddArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'tBlockSize',
1935    typeMetadata=IntegerTypeMetadata(minValue=0, canBeNone=True),
1936    description=_(
1937u"""Size of the blocks of SST data to cache in memory, in the t
1938direction (time). The size is given as the number of cells.
1939
1940If this parameter is 0, no blocks will be cached in memory."""),
1941    arcGISDisplayName=_(u'In-memory cache block size, in T direction'),
1942    arcGISCategory=_(u'Performance tuning options'))
1943
1944AddResultMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'updatedPoints',
1945    typeMetadata=ArcGISFeatureLayerTypeMetadata(),
1946    description=_(u'Updated points.'),
1947    arcGISDisplayName=_(u'Updated points'),
1948    arcGISParameterDependencies=[u'points'])
1949
1950# Public method: MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters
1951
1952AddMethodMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters,
1953    shortDescription=_(u'Creates rasters indicating the positions of fronts in MODIS Level 3 SST images published by NASA JPL PO.DAAC, using the Cayula and Cornillon (1992) single image edge detection (SIED) algorithm.'),
1954    longDescription=_MODISL3SSTTimeSeries_LongDescription + _(
1955u"""
1956
1957Given a satellite name, temporal resolution, spatial resolution, and
1958desired SST product, this tool efficiently downloads the corresponding
1959time series of MODIS Level 3 SST images, executes the Cayula and Cornillon
1960SIED algorithm to identify fronts, and creates rasters showing the
1961locations of the fronts.
1962
1963This tool is complicated and has a lot of parameters. The complex
1964dynamics of the ocean, the presence of clouds, the difficulty of
1965detecting and masking them, and the inability to resolve fine-scale
1966thermal features using the spatial resolution of MODIS Level 3
1967products make it hard to obtain perfect results. For the best chance
1968of success, please read all of the documentation carefully.
1969
1970We configured the default parameters of this tool to balance a number
1971of tradeoffs. These defaults are different than those used in Cayula
1972and Cornillon's original study. For example, the original study used a
197332x32 moving window while ours is somewhat smaller because we found
1974that the algorithm appeared to detect more fronts in MODIS images when
1975a smaller window was used. This is probably due to the fact that
1976Cayula and Cornillon's original data had a spatial resolution of about
19771 km, while MODIS Level 3 has a resolution of about 4.6 km. The
1978theoretical basis of the algorithm requires that only one front appear
1979in the window; the 32x32 window appeared to be too large to work well
1980with MODIS's coarser resolution, often enclosing multiple fronts.
1981
1982We believe our default values work better for the MODIS Level 3 images
1983than Cayula and Cornillon's original values, but we have not attempted
1984to formally validate the results. Please keep that in mind when
1985applying this tool in your own studies.
1986
1987Note that the Front Cleanup Options, which are enabled by default,
1988require that MATLAB 2007b or the MATLAB Component Runtime (MCR) 7.7 be
1989installed. You can download a free copy of the MCR 7.7 from
1990http://code.nicholas.duke.edu/projects/mget/wiki/MCR. If you do not
1991wish to install MATLAB or the MCR, you must disable the Front Cleanup
1992Options.
1993
1994**The SIED Algorithm**
1995
1996""" + _SIEDDescription +
1997"""
1998""" + _MODISReferences +
1999"""
2000
2001""" + _SIEDReferences),
2002    isExposedToPythonCallers=True,
2003    isExposedByCOM=True,
2004    isExposedAsArcGISTool=True,
2005    arcGISDisplayName=_(u'Find Cayula-Cornillon Fronts in PO.DAAC MODIS L3 SST'),
2006    arcGISToolCategory=_(u'Data Products\\NASA JPL PO.DAAC\\MODIS Global Level 3 Mapped SST'),
2007    dependencies=[ArcGISDependency(9, 1), PythonAggregatedModuleDependency('numpy')])
2008
2009CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'cls', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'cls')
2010CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'satellite', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'satellite')
2011
2012CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'temporalResolution', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'temporalResolution')
2013MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters.__doc__.Obj.GetArgumentByName(u'temporalResolution').Description += _(
2014u"""
2015
2016The choice of an appropriate temporal resolution is critical to the
2017successful operation of the Cayula and Cornillon algorithm. The algorithm
2018is designed to operate on instantaneous images of SST, not averages.
2019Therefore, for best results, choose daily temporal resolution.
2020
2021You may be tempted to try a lower temporal resolution, such as 8-day
2022or monthly, because there are fewer clouds. The problem is that the
2023SST gradients are not as sharp because SST has been averaged over
2024several images. If the fronts have moved around over the duration of
2025those images, as is often the case, the SST gradient will be smoothed
2026out spatially and the algorithm will function poorly.
2027
2028Rather than choosing a lower temporal resolution, consider using daily
2029and then compositing the resulting frontal images. For example, rather
2030than using 8-day images, find the fronts in the 8 daily images and
2031then add them together. This is similar to how Cayula and Cornillon's
2032(1996) multiple-image edge detection (MIED) works. Also consider using
2033both daytime and nighttime images in your composites.""")
2034
2035CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'spatialResolution', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'spatialResolution')
2036MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters.__doc__.Obj.GetArgumentByName(u'spatialResolution').Description += _(
2037u"""
2038
2039The default Cayula and Cornillon algorithm parameters are intended to be
2040used with the 4km MODIS products. If you use the 9km products, you
2041might achieve better results by adjusting the parameter values,
2042particularly the Histogram Window Size parameter.""")
2043
2044CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'geophysicalParameter', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'geophysicalParameter')
2045
2046AddArgumentMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'minPopMeanDifference',
2047    typeMetadata=FloatTypeMetadata(mustBeGreaterThan=0.),
2048    description=_(
2049u"""Minimum difference, in degrees C, between the mean temperatures of
2050two adjacent populations of pixels for a front to be detected between
2051those two populations.
2052
2053The Cayula and Cornillon algorithm passes a moving window over the
2054image, checking each window for a bimodal distribution in the
2055temperatures of the pixels within it. When the algorithm detects a
2056bimodal distribution, it computes the mean temperatures of the two
2057populations and compares the difference between the means to this
2058threshold. If the difference is less than this threshold, the
2059algorithm concludes there is no front present and moves on to the next
2060window.
2061
2062You can use this parameter to eliminate weak fronts by selecting a
2063value that corresponds to a desired minimum mean temperature
2064difference. Larger values will detect fewer fronts; smaller values
2065will detect more fronts. However, bear in mind that
2066`this document <ftp://podaac-ftp.jpl.nasa.gov/allData/modis/docs/MODIS_SST_Guide_Doc.pdf>`_
2067MODIS SST data can only be considered accurate to +/- 0.4 degrees C.
2068We do not advise thresholds below that value."""),
2069    arcGISDisplayName=_(u'Front detection threshold'))
2070
2071AddArgumentMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputWorkspace',
2072    typeMetadata=ArcGISWorkspaceTypeMetadata(createParentDirectories=True),
2073    description=_(
2074u"""Directory or geodatabase to receive the rasters.
2075
2076Unless you have a specific reason to store the rasters in a
2077geodatabase, we recommend you store them in a directory because it
2078will be much faster and allows the rasters to be organized in a tree.
2079If you do store the rasters in a geodatabase, you must change the
2080Raster Name Expressions parameter; the documentation for that
2081parameter for more information.
2082
2083The front location images will be written as 8-bit signed integer
2084rasters. Each pixel can have one of three values:
2085
2086* NoData - the pixel was never a candidate for containing a front,
2087  either because it was masked or because because it did not appear in
2088  any histogram windows that had sufficiently large numbers of
2089  non-masked pixels to proceed with the histogramming step of the
2090  Cayula and Cornillon algorithm.
2091
2092* 0 - The pixel was a candidate for containing a front -- it was not
2093  masked and it appeared in at least one histogram window with a
2094  sufficient number of non-masked pixels to proceed with the
2095  histogramming step -- but it was never marked as a front pixel in
2096  any of the histogram windows it appeared in.
2097
2098* 1 - The pixel was a candidate for containing a front and it was marked
2099  as a front pixel in at least one of the histogram windows it
2100  appeared in.
2101
2102You may also instruct this tool to write several kinds of diagnostic
2103outputs. These can help you understand why a front was or was not
2104identified at a specific location. Please see the documentation for
2105the diagnostic outputs for more information.
2106
2107The front location images described above are constructed by
2108performing a classification of two of the diagnostic outputs, the
2109"candidate counts" and "front counts" images, and then applying the
2110Fill Holes, Thin, and Minimum Front Size options."""),
2111    arcGISDisplayName=_(u'Output workspace'))
2112
2113CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'mode', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'mode')
2114
2115AddArgumentMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'rasterNameExpressions',
2116    typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(), minLength=1),
2117    description=_(
2118u"""List of expressions specifying how the output rasters should be
2119named.
2120
2121The default expression assumes you are storing rasters in a file
2122system directory and creates them in a tree structure. When storing
2123rasters in a directory, the final expression specifies the file name
2124of the raster and any preceding expressions specify subdirectories.
2125The extension of the final expression determines the output raster
2126format: .asc for ArcInfo ASCII Grid, .bmp for BMP, .gif for GIF, .img
2127for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for
2128PNG, .tif for GeoTIFF, or no extension for ArcInfo Binary Grid. The
2129default expression uses .img.
2130
2131When storing rasters in a geodatabase, you should provide only one
2132expression. That expression specifies the raster's name.
2133
2134Each expression may contain any sequence of characters permitted by
2135the output workspace. Each expression may optionally contain one or
2136more of the following case-sensitive codes. The tool replaces the
2137codes with appropriate values when creating each raster:
2138
2139* %(Satellite)s - name of the satellite, either "aqua" or "terra".
2140
2141* %(SatelliteCode)s - abbreviation for the satellite, either "A" or
2142  "T", used in NASA's file naming scheme.
2143
2144* %(TemporalResolution)s - temporal resolution, either "daily",
2145  "8day", "monthly", or "annual".
2146
2147* %(TemporalResolutionCode)s - abbreviation for the temporal
2148  resolution, either "DAY", "8D", "MO", or "YR", used in NASA's file
2149  naming scheme.
2150
2151* %(SpatialResolution)s - spatial resolution, either "4km" or "9km".
2152
2153* %(SpatialResolutionCode)s - abbreviation for the spatial
2154  resolution, either "4" or "9", used in NASA's file naming scheme.
2155 
2156* %(GeophysicalParameter)s - geophysical parameter used to produce the
2157  output raster, either "sst", "nsst", or "sst4".
2158
2159* %(Algorithm)s - algorithm used to estimate the geophysical
2160  parameter from the raw sensor values, either "sst" for the sst or
2161  nsst geophysical parameter, or "sst4" for the sst4 geophysical
2162  parameter. The algorithm name is used in NASA's file naming scheme.
2163
2164* %(Wavelength)s - an alternative abbreviation for the algorithm used
2165  to estimate the geophysical parameter, either "11um" for the sst or
2166  nsst geophysical parameter, or "4um" for the sst4 geophysical
2167  parameter. The abbreviation refers to the wavelengths of the MODIS
2168  bands used in the algorithm, where 11um refers to the "thermal IR"
2169  bands and 4um refers to the "mid-IR" bands. The abbreviation is used
2170  in NASA's file naming scheme.
2171 
2172* %(ImageType)s - type of image represented in the output raster,
2173  either "floc" (front locations), "ccnt" (candidate counts), "fcnt"
2174  (front counts), "wsco" (window status codes), or "wsvl" (window
2175  status values).
2176
2177* %%Y - four-digit year of the raster.
2178
2179* %%m - two-digit month of the first day of the raster.
2180
2181* %%d - two-digit day of the month of the first day of the raster.
2182
2183* %%j - three-digit day of the year of the first day of the raster.
2184
2185* %(EndDate)s - date of the last day of the raster in the format
2186  "YYYYjjj" where YYYY is the four-digit year and jjj is the
2187  three-digit day of the year. This date is used in NASA's file naming
2188  scheme for temporal resolutions other than "daily".
2189"""),
2190    arcGISDisplayName=_(u'Raster name expressions'))
2191
2192CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'medianFilterWindowSize', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'medianFilterWindowSize')
2193CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'histogramWindowSize', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'histogramWindowSize')
2194CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'histogramWindowStride', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'histogramWindowStride')
2195CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'minPropNonMaskedCells', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'minPropNonMaskedCells')
2196CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'minPopProp', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'minPopProp')
2197CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'minTheta', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'minTheta')
2198CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'minSinglePopCohesion', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'minSinglePopCohesion')
2199CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'minGlobalPopCohesion', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'minGlobalPopCohesion')
2200CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'threads', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'threads')
2201CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'fillHoles', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'fillHoles')
2202CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'thin', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'thin')
2203CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'minSize', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'minSize')
2204
2205CopyArgumentMetadata(MODISL3SSTTimeSeries.__init__, u'qualityLevel', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'qualityLevel')
2206
2207CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'rotationOffset', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'rotationOffset')
2208CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'spatialExtent', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'spatialExtent')
2209CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'startDate', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'startDate')
2210CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'endDate', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'endDate')
2211CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'timeout', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'timeout')
2212CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'maxRetryTime', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'maxRetryTime')
2213CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'cacheDirectory', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'cacheDirectory')
2214CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'calculateStatistics', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'calculateStatistics')
2215CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'buildRAT', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'buildRAT')
2216CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'buildPyramids', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'buildPyramids')
2217
2218AddArgumentMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputCandidateCounts',
2219    typeMetadata=BooleanTypeMetadata(),
2220    description=_(
2221u"""If True, candidate counts diagnostic images will be created.
2222
2223Candidate counts images contain 16-bit unsigned integers and indicate
2224how many times each pixel of the corresponding SST image was a
2225candidate for containing a front, i.e. the number of times it appeared
2226in a histogram window that had a sufficiently large number of
2227non-masked pixels to proceed with the histogramming step of the
2228Cayula and Cornillon algorithm. If the histogram window stride is less
2229than the window size, successive histogram windows will overlap, and
2230many pixels will have candidate counts greater than 1. Masked pixels
2231can never be candidates for containing a front so they will always
2232have the value 0."""),
2233    arcGISDisplayName=_(u'Create candidate counts rasters'),
2234    arcGISCategory=_(u'Optional diagnostic outputs'))
2235
2236AddArgumentMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputFrontCounts',
2237    typeMetadata=BooleanTypeMetadata(),
2238    description=_(
2239u"""If True, front counts diagnostic images will be created.
2240
2241Front counts images contain 16-bit unsigned integers and indicate how
2242many times each pixel of the corresponding SST image was found to
2243contain a front. The value will range from 0 (it never contained a
2244front) to the candidate count value for the pixel (it always contained
2245a front in every histogram window that contained it).
2246
2247The Front Cleanup Options are not applied to the front counts
2248image."""),
2249    arcGISDisplayName=_(u'Create front counts rasters'),
2250    arcGISCategory=_(u'Optional diagnostic outputs'))
2251
2252AddArgumentMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputWindowStatusCodes',
2253    typeMetadata=BooleanTypeMetadata(),
2254    description=_(
2255u"""If True, diagnostic images of window status codes will be created.
2256
2257Window status code images contain 8-bit unsigned integers that
2258indicate the result of the algorithm for the histogram window centered
2259on the pixel. You can use this image to diagnose why the algorithm did
2260not find fronts in a particular region of your image.
2261
2262The algorithm result will be one of these code numbers:
2263
2264""" + _WindowStatusCodes),
2265    arcGISDisplayName=_(u'Create window status code rasters'),
2266    arcGISCategory=_(u'Optional diagnostic outputs'))
2267
2268AddArgumentMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputWindowStatusValues',
2269    typeMetadata=BooleanTypeMetadata(),
2270    description=_(
2271u"""If True, diagnostic images of window status values will be
2272created.
2273
2274Window status values images contain 32-bit floating point values
2275to be used in conjunction with the window status codes when diagnosing
2276the results of the algorithm. The value of each pixel depends on the
2277window status code for that pixel:
2278
2279""" + _WindowStatusValues),
2280    arcGISDisplayName=_(u'Create window status value rasters'),
2281    arcGISCategory=_(u'Optional diagnostic outputs'))
2282
2283CopyResultMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'updatedOutputWorkspace', MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'updatedOutputWorkspace')
2284
2285###############################################################################
2286# Metadata: _GHRSSTLevel4THREDDSCatalog class
2287###############################################################################
2288
2289AddClassMetadata(_GHRSSTLevel4THREDDSCatalog,
2290    shortDescription=_(u'THREDDSCatalog for the NASA JPL PO.DAAC GHRSST L4 datasets.'),
2291    longDescription=_(
2292u"""This class is not intended to be used directly by external
2293callers. Use GHRSSTLevel4 instead."""))
2294
2295###############################################################################
2296# Metadata: _GHRSSTLevel4OPeNDAPURL class
2297###############################################################################
2298
2299AddClassMetadata(_GHRSSTLevel4OPeNDAPURL,
2300    shortDescription=_(u'OPeNDAPURL for a NASA JPL PO.DAAC GHRSST L4 file.'),
2301    longDescription=_(
2302u"""This class is not intended to be used directly by external
2303callers. Use GHRSSTLevel4 instead."""))
2304
2305###############################################################################
2306# Metadata: _GHRSSTLevel4OPeNDAPGrid class
2307###############################################################################
2308
2309AddClassMetadata(_GHRSSTLevel4OPeNDAPGrid,
2310    shortDescription=_(u'OPeNDAPGrid for a variable of a NASA JPL PO.DAAC GHRSST L4 file.'),
2311    longDescription=_(
2312u"""This class is not intended to be used directly by external
2313callers. Use GHRSSTLevel4 instead."""))
2314
2315# Constructor
2316
2317AddMethodMetadata(_GHRSSTLevel4OPeNDAPGrid.__init__,
2318    shortDescription=_(u'Constructs a new _GHRSSTLevel4OPeNDAPGrid instance.'))
2319
2320AddArgumentMetadata(_GHRSSTLevel4OPeNDAPGrid.__init__, u'self',
2321    typeMetadata=ClassInstanceTypeMetadata(cls=_GHRSSTLevel4OPeNDAPGrid),
2322    description=_(u'_GHRSSTLevel4OPeNDAPGrid instance.'))
2323
2324AddArgumentMetadata(_GHRSSTLevel4OPeNDAPGrid.__init__, u'opendapURLObj',
2325    typeMetadata=ClassInstanceTypeMetadata(cls=_GHRSSTLevel4OPeNDAPURL),
2326    description=_(u'_GHRSSTLevel4OPeNDAPURL instance that contains us.'))
2327
2328AddArgumentMetadata(_GHRSSTLevel4OPeNDAPGrid.__init__, u'variableName',
2329    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'analysed_sst', u'analysis_error']),
2330    description=_(u'OPeNDAP variable name.'))
2331
2332AddArgumentMetadata(_GHRSSTLevel4OPeNDAPGrid.__init__, u'variableType',
2333    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Grid']),
2334    description=_(u'OPeNDAP variable type.'))
2335
2336AddResultMetadata(_GHRSSTLevel4OPeNDAPGrid.__init__, u'grid',
2337    typeMetadata=ClassInstanceTypeMetadata(cls=_GHRSSTLevel4OPeNDAPGrid),
2338    description=_(u'_GHRSSTLevel4OPeNDAPGrid instance.'))
2339
2340###############################################################################
2341# Metadata: GHRSSTLevel4 class
2342###############################################################################
2343
2344_GHRSSTLevel4_LongDescription = _(
2345u"""The `Group for High-Resolution Sea Surface Temperature (GHRSST) <http://www.ghrsst.org/>`_
2346provides a new generation of global high-resolution (<10km) SST
2347products to the operational oceanographic, meteorological, climate and
2348general scientific community. The overall aim of the GHRSST is to
2349provide the best quality sea surface temperature data for applications
2350in short, medium and decadal/climate time scales in the most cost
2351effective and efficient manner through international collaboration and
2352scientific innovation.
2353
2354This %(name)s accesses L4 gap-free gridded SST products published in
2355near real time by the GHRSST GDAC Global Data Assembly Center (GDAC)
2356at the `NASA JPL Physical Oceanography Distributed Active Archive Center (PO.DAAC) <http://podaac.jpl.nasa.gov/SeaSurfaceTemperature/GHRSST>`_.
2357These products provide regional and global daily cloud-free estimates
2358of SST at spatial resolutions ranging from 0.25 degrees to down 1 km.
2359To fill in cloudy areas, data from multiple satellite and in-situ
2360sensors are combined and regions without any data are filled in
2361various interpolation and modeling techniques.
2362
2363All products accessed by this %(name)s are published at a daily
2364timestep. Some products are updated on a continual basis and available
2365in near real time; others are updated infrequently and are intended
2366mainly for historical analysis. The temporal extent, spatial
2367resolution and extent, and sensors and interpolation technique used
2368vary by product. All products use the WGS 1984 geographic coordinate
2369system. GHRSST temperatures are published in kelvin. By default, this
2370%(name)s converts them to degrees Celsius but provides an option to
2371obtain the original kelvin values.
2372
2373All products are obtained from PO.DAAC using the OPeNDAP protocol.
2374This %(name)s supports most but not all of the GHRSST L4 products
2375hosted by PO.DAAC. If you see a product on PO.DAAC that is not
2376available with this tool, please contact the MGET development team for
2377assistance.""")
2378
2379AddClassMetadata(GHRSSTLevel4,
2380    shortDescription=_(u'A Grid representing a GHRSST L4 product hosted by NASA JPL PO.DAAC.'),
2381    longDescription=_GHRSSTLevel4_LongDescription % {u'name': 'class'})
2382
2383# Constructor
2384
2385AddMethodMetadata(GHRSSTLevel4.__init__,
2386    shortDescription=_(u'Constructs a new GHRSSTLevel4 instance.'))
2387
2388AddArgumentMetadata(GHRSSTLevel4.__init__, u'self',
2389    typeMetadata=ClassInstanceTypeMetadata(cls=GHRSSTLevel4),
2390    description=_(u'GHRSSTLevel4 instance.'))
2391
2392AddArgumentMetadata(GHRSSTLevel4.__init__, u'variableName',
2393    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'analysed_sst', u'analysis_error']),
2394    description=_(
2395u"""GHRSST variable to access, one of:
2396
2397* analysed_sst - GHRSST product-specific estimate of SST.
2398
2399* analysis_error - GHRSST product-specific estimate of of the error in
2400  the SST estimate.
2401
2402Please see the product documentation for details about what these
2403variables mean and how they were calculated. These variable names are
2404case-sensitive."""),
2405    arcGISDisplayName=_(u'GHRSST variable'))
2406
2407AddArgumentMetadata(GHRSSTLevel4.__init__, u'rdacCode',
2408    typeMetadata=UnicodeStringTypeMetadata(),
2409    description=_(
2410u"""The code of the GHRSST Regional Data Access Center (RDAC) that
2411produced the product. These codes are case-sensitive, typically upper
2412case, and assigned by GHRSST."""))
2413
2414AddArgumentMetadata(GHRSSTLevel4.__init__, u'productType',
2415    typeMetadata=UnicodeStringTypeMetadata(),
2416    description=_(
2417u"""GHRSST product type code. These codes are case-sensitive, assigned
2418by GHRSST, and indicate the overall resolution and type of SST
2419estimated by the product. Typical codes include "LRfnd", "HRfnd",
2420"UHfnd", "HR1m", and "LRblend"."""))
2421
2422AddArgumentMetadata(GHRSSTLevel4.__init__, u'areaCode',
2423    typeMetadata=UnicodeStringTypeMetadata(),
2424    description=_(
2425u"""The region code of the the product. These codes are
2426case-sensitive, typically upper case, and assigned by GHRSST. A list
2427of codes may be seen on the PO.DAAC OPeNDAP server at
2428http://podaac-opendap.jpl.nasa.gov/opendap/hyrax/allData/ghrsst/data/L4/"""))
2429
2430AddArgumentMetadata(GHRSSTLevel4.__init__, u'gdsVersion',
2431    typeMetadata=IntegerTypeMetadata(minValue=1),
2432    description=_(
2433u"""Version of the GHRSST Data Specification (GDS) used by the
2434product. At the time of this writing, all products accessed by this
2435function were at GDS version 1."""))
2436
2437AddArgumentMetadata(GHRSSTLevel4.__init__, u'fileVersion',
2438    typeMetadata=UnicodeStringTypeMetadata(),
2439    description=_(
2440u"""Version of the file. This is a case-sensitive string that is
2441product specific and assigned by the RDAC that produced the
2442product."""))
2443
2444AddArgumentMetadata(GHRSSTLevel4.__init__, u'productCode',
2445    typeMetadata=UnicodeStringTypeMetadata(),
2446    description=_(
2447u"""The RDAC-assigned product code that appears at the end of the
2448GHRSST file name."""))
2449
2450AddArgumentMetadata(GHRSSTLevel4.__init__, u'productCode2',
2451    typeMetadata=UnicodeStringTypeMetadata(canBeNone=True),
2452    description=_(
2453u"""The RDAC-assigned product code that appears in the PO.DAAC OPeNDAP
2454catalog structure below the RDAC level. For example, in the URL
2455http://podaac-opendap.jpl.nasa.gov/opendap/hyrax/allData/ghrsst/data/L4/GLOB/REMSS/mw_ir_OI/2012/001/20120103-REMSS-L4HRfnd-GLOB-v01-fv03-mw_ir_rt_OI.nc.gz,
2456the productCode is "mw_ir_rt_OI" while the productCode2 is "mw_ir_OI".
2457
2458Typically the productCode2 is the same as the same as the productCode,
2459in which case you should omit the productCode2 (leave it None). Only a
2460few products have a different productCode2."""))
2461
2462AddArgumentMetadata(GHRSSTLevel4.__init__, u'convertToCelsius',
2463    typeMetadata=BooleanTypeMetadata(),
2464    description=_(
2465u"""If True (the default), temperature values will be converted from
2466kelvin to degrees Celsius. If False, temperature values will be in the
2467original kelvin values."""),
2468    arcGISDisplayName=_(u'Convert temperatures to Celsius'),
2469    arcGISCategory=_(u'Additional raster processing options'))
2470
2471CopyArgumentMetadata(THREDDSCatalog.__init__, u'timeout', GHRSSTLevel4.__init__, u'timeout')
2472CopyArgumentMetadata(THREDDSCatalog.__init__, u'maxRetryTime', GHRSSTLevel4.__init__, u'maxRetryTime')
2473CopyArgumentMetadata(THREDDSCatalog.__init__, u'cacheDirectory', GHRSSTLevel4.__init__, u'cacheDirectory')
2474
2475AddResultMetadata(GHRSSTLevel4.__init__, u'grid',
2476    typeMetadata=ClassInstanceTypeMetadata(cls=GHRSSTLevel4),
2477    description=_(u'GHRSSTLevel4 instance.'))
2478
2479# Public method: GHRSSTLevel4.CreateArcGISRasters
2480
2481AddMethodMetadata(GHRSSTLevel4.CreateArcGISRasters,
2482    shortDescription=_(u'Creates rasters for a GHRSST L4 product hosted by NASA JPL PO.DAAC.'),
2483    longDescription=_GHRSSTLevel4_LongDescription % {u'name': 'tool'},
2484    isExposedToPythonCallers=True,
2485    isExposedByCOM=True,
2486    isExposedAsArcGISTool=True,
2487    arcGISDisplayName=_(u'Create Rasters for GHRSST L4 SST'),
2488    arcGISToolCategory=_(u'Data Products\\NASA JPL PO.DAAC\\GHRSST L4 SST'),
2489    dependencies=[ArcGISDependency(9, 1), PythonAggregatedModuleDependency('numpy')])
2490
2491AddArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'cls',
2492    typeMetadata=ClassOrClassInstanceTypeMetadata(cls=GHRSSTLevel4),
2493    description=_(u'GHRSSTLevel4 class or instance.'))
2494
2495AddArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'product',
2496    typeMetadata=UnicodeStringTypeMetadata(allowedValues=sorted(GHRSSTLevel4._PODAAC_Products.keys())),
2497    description=_(
2498u"""GHRSST L4 product to access. Currently, the following products are
2499supported:
2500
2501* `ABOM-L4HRfnd-AUS-RAMSSA_09km <http://podaac.jpl.nasa.gov/dataset/ABOM-L4HRfnd-AUS-RAMSSA_09km>`_.
2502* `ABOM-L4LRfnd-GLOB-GAMSSA_28km <http://podaac.jpl.nasa.gov/dataset/ABOM-L4LRfnd-GLOB-GAMSSA_28km>`_.
2503* `DMI-L4UHfnd-NSEABALTIC-DMI_OI <http://podaac.jpl.nasa.gov/dataset/DMI-L4UHfnd-NSEABALTIC-DMI_OI>`_.
2504* `EUR-L4UHRfnd-MED-ODYSSEA <http://podaac.jpl.nasa.gov/dataset/EUR-L4UHRfnd-MED-ODYSSEA>`_.
2505* `EUR-L4UHRfnd-NWE-ODYSSEA <http://podaac.jpl.nasa.gov/dataset/EUR-L4UHRfnd-NWE-ODYSSEA>`_.
2506* `JPL-L4UHfnd-GLOB-MUR <http://podaac.jpl.nasa.gov/dataset/JPL-L4UHfnd-GLOB-MUR>`_.
2507* `JPL_OUROCEAN-L4UHfnd-GLOB-G1SST <http://podaac.jpl.nasa.gov/dataset/JPL_OUROCEAN-L4UHfnd-GLOB-G1SST>`_.
2508* `NAVO-L4HR1m-GLOB-K10_SST <http://podaac.jpl.nasa.gov/dataset/NAVO-L4HR1m-GLOB-K10_SST>`_.
2509* `NCDC-L4LRblend-GLOB-AVHRR_AMSR_OI <http://podaac.jpl.nasa.gov/dataset/NCDC-L4LRblend-GLOB-AVHRR_AMSR_OI>`_.
2510* `NCDC-L4LRblend-GLOB-AVHRR_OI <http://podaac.jpl.nasa.gov/dataset/NCDC-L4LRblend-GLOB-AVHRR_OI>`_.
2511* `UKMO-L4HRfnd-GLOB-OSTIA <http://podaac.jpl.nasa.gov/dataset/UKMO-L4HRfnd-GLOB-OSTIA>`_.
2512
2513All products use the WGS 1984 geographic coordinate system and are
2514published at a daily timestep. Some products are updated on a
2515continual basis and available in near real time; others are updated
2516infrequently and are intended mainly for historical analysis. The
2517temporal extent, spatial resolution and extent, and sensors and
2518interpolation technique used vary by product. Please see the products'
2519documentation for details.
2520
2521This tool supports most but not all of the GHRSST L4 products hosted
2522by PO.DAAC. If you see a product on PO.DAAC that is not available with
2523this tool, please contact the MGET development team for
2524assistance."""),
2525    arcGISDisplayName=_(u'GHRSST L4 product'))
2526
2527CopyArgumentMetadata(GHRSSTLevel4.__init__, u'variableName', GHRSSTLevel4.CreateArcGISRasters, u'variableName')
2528
2529CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'outputWorkspace', GHRSSTLevel4.CreateArcGISRasters, u'outputWorkspace')
2530CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'mode', GHRSSTLevel4.CreateArcGISRasters, u'mode')
2531
2532AddArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'rasterNameExpressions',
2533    typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(), minLength=1),
2534    description=_(
2535u"""List of expressions specifying how the output rasters should be
2536named.
2537
2538The default expression assumes you are storing rasters in a file
2539system directory and creates them in a tree structure with names that
2540imitate those used by NASA. When storing rasters in a directory, the
2541final expression specifies the file name of the raster and any
2542preceding expressions specify subdirectories. The extension of the
2543final expression determines the output raster format: .asc for ArcInfo
2544ASCII Grid, .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE
2545file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for
2546GeoTIFF, or no extension for ArcInfo Binary Grid. The default
2547expression uses .img.
2548
2549When storing rasters in a geodatabase, you should provide only one
2550expression. That expression specifies the raster's name.
2551
2552Each expression may contain any sequence of characters permitted by
2553the output workspace. Each expression may optionally contain one or
2554more of the following case-sensitive codes. The tool replaces the
2555codes with appropriate values when creating each raster:
2556
2557* %(AreaCode)s - GHRSST abbreviation indicating the spatial extent of
2558  the product, such as "GLOB" for global extent or "AUS" for
2559  Australia.
2560
2561* %(RDACCode)s - GHRSST abbreviation for the Regonal Data Assembly
2562  Center (RDAC) that produced the product.
2563
2564* %(ProductCode)s - name of the product, assigned by the RDAC.
2565
2566* %(VariableName)s - GHRSST variable represented in the output raster,
2567  either "analysed_sst" or "analysis_error".
2568
2569* %(ProductType)s - GHRSST product type code that indicates the
2570  overall resolution and type of SST estimated by the product. For
2571  example, "UHfnd" indicates ultra-high resolution (< 5 km spatial
2572  resolution) foundational SST. Please see the GHRSST documentation
2573  for the formal meanings of these codes.
2574
2575* %(GDSVersion)02i - version of the GHRSST Data Specification (GDS)
2576  used by the product. At the time of this writing, all products
2577  accessed by this function were at GDS version 1, which will be
2578  rendered as 01 by the expression %(GDSVersion)02i.
2579
2580* %(FileVersion)s - version of the data file itself. This is
2581  product-specific and assigned by the RDAC that produced the product.
2582
2583* %%Y - four-digit year of the raster.
2584
2585* %%m - two-digit month of the first day of the raster.
2586
2587* %%d - two-digit day of the month of the first day of the raster.
2588
2589* %%j - three-digit day of the year of the first day of the raster.
2590"""),
2591    arcGISDisplayName=_(u'Raster name expressions'))
2592
2593CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'rasterCatalog', GHRSSTLevel4.CreateArcGISRasters, u'rasterCatalog')
2594CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'rotationOffset', GHRSSTLevel4.CreateArcGISRasters, u'rotationOffset')
2595CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'spatialExtent', GHRSSTLevel4.CreateArcGISRasters, u'spatialExtent')
2596CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'startDate', GHRSSTLevel4.CreateArcGISRasters, u'startDate')
2597CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'endDate', GHRSSTLevel4.CreateArcGISRasters, u'endDate')
2598CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'timeout', GHRSSTLevel4.CreateArcGISRasters, u'timeout')
2599CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'maxRetryTime', GHRSSTLevel4.CreateArcGISRasters, u'maxRetryTime')
2600CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'cacheDirectory', GHRSSTLevel4.CreateArcGISRasters, u'cacheDirectory')
2601
2602CopyArgumentMetadata(GHRSSTLevel4.__init__, u'convertToCelsius', GHRSSTLevel4.CreateArcGISRasters, u'convertToCelsius')
2603
2604CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'useUnscaledData', GHRSSTLevel4.CreateArcGISRasters, u'useUnscaledData')
2605CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'calculateStatistics', GHRSSTLevel4.CreateArcGISRasters, u'calculateStatistics')
2606CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'buildRAT', GHRSSTLevel4.CreateArcGISRasters, u'buildRAT')
2607CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateArcGISRasters, u'buildPyramids', GHRSSTLevel4.CreateArcGISRasters, u'buildPyramids')
2608
2609AddResultMetadata(GHRSSTLevel4.CreateArcGISRasters, u'updatedOutputWorkspace',
2610    typeMetadata=ArcGISWorkspaceTypeMetadata(),
2611    description=_(u'Updated output workspace.'),
2612    arcGISDisplayName=_(u'Updated output workspace'),
2613    arcGISParameterDependencies=[u'outputWorkspace'])
2614
2615# Public method: GHRSSTLevel4.CreateClimatologicalArcGISRasters
2616
2617AddMethodMetadata(GHRSSTLevel4.CreateClimatologicalArcGISRasters,
2618    shortDescription=_(u'Creates climatological rasters for a GHRSST L4 product hosted by NASA JPL PO.DAAC.'),
2619    longDescription=_(
2620u""" This tool produces rasters showing the climatological average
2621value (or other statistic) of a time series of GHRSST L4 SST images.
2622Given a desired GHRSST L4 product, a statistic, and a climatological
2623bin definition, this tool efficiently downloads the images, classifies
2624them into bins, and produces a single raster for each bin. Each cell
2625of the raster is produced by calculating the statistic on the values
2626of that cell extracted from all of the rasters in the bin.
2627
2628""" + _GHRSSTLevel4_LongDescription) % {u'name': 'tool'},
2629    isExposedToPythonCallers=True,
2630    isExposedByCOM=True,
2631    isExposedAsArcGISTool=True,
2632    arcGISDisplayName=_(u'Create Climatological Rasters for GHRSST L4 SST'),
2633    arcGISToolCategory=_(u'Data Products\\NASA JPL PO.DAAC\\GHRSST L4 SST'),
2634    dependencies=[ArcGISDependency(9, 1), PythonAggregatedModuleDependency('numpy')])
2635
2636CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'cls', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'cls')
2637CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'product', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'product')
2638CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'variableName', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'variableName')
2639
2640CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'statistic', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'statistic')
2641CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'binType', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'binType')
2642CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'outputWorkspace', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'outputWorkspace')
2643CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'mode', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'mode')
2644
2645AddArgumentMetadata(GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'rasterNameExpressions',
2646    typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(), minLength=1),
2647    description=_(
2648u"""List of expressions specifying how the output rasters should be
2649named.
2650
2651The default expression assumes you are storing rasters in a file
2652system directory and creates them in a tree structure. When storing
2653rasters in a directory, the final expression specifies the file name
2654of the raster and any preceding expressions specify subdirectories.
2655The extension of the final expression determines the output raster
2656format: .asc for ArcInfo ASCII Grid, .bmp for BMP, .gif for GIF, .img
2657for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for
2658PNG, .tif for GeoTIFF, or no extension for ArcInfo Binary Grid. The
2659default expression uses .img.
2660
2661When storing rasters in a geodatabase, you should provide only one
2662expression. That expression specifies the raster's name.
2663
2664Each expression may contain any sequence of characters permitted by
2665the output workspace. Each expression may optionally contain one or
2666more of the following case-sensitive codes. The tool replaces the
2667codes with appropriate values when creating each raster:
2668
2669* %(AreaCode)s - GHRSST abbreviation indicating the spatial extent of
2670  the product, such as "GLOB" for global extent or "AUS" for
2671  Australia.
2672
2673* %(RDACCode)s - GHRSST abbreviation for the Regonal Data Assembly
2674  Center (RDAC) that produced the product.
2675
2676* %(ProductCode)s - name of the product, assigned by the RDAC.
2677
2678* %(VariableName)s - GHRSST variable represented in the output raster,
2679  either "analysed_sst" or "analysis_error".
2680
2681* %(ProductType)s - GHRSST product type code that indicates the
2682  overall resolution and type of SST estimated by the product. For
2683  example, "UHfnd" indicates ultra-high resolution (< 5 km spatial
2684  resolution) foundational SST. Please see the GHRSST documentation
2685  for the formal meanings of these codes.
2686
2687* %(GDSVersion)02i - version of the GHRSST Data Specification (GDS)
2688  used by the product. At the time of this writing, all products
2689  accessed by this function were at GDS version 1, which will be
2690  rendered as 01 by the expression %(GDSVersion)02i.
2691
2692* %(FileVersion)s - version of the data file itself. This is
2693  product-specific and assigned by the RDAC that produced the product.
2694
2695* %(ClimatologyBinType)s - type of the climatology bin, either "Daily"
2696  if 1-day bins, "Xday" if multi-day bins (X is replaced by the
2697  duration), "Monthly" if 1-month bins, "Xmonth" if multi-month bins,
2698  or "Cumulative".
2699
2700* %(ClimatologyBinName)s - name of the climatology bin corresponding
2701  represented by the output raster, either "dayXXX" for 1-day bins
2702  (XXX is replaced by the day of the year), "daysXXXtoYYY" for
2703  multi-day bins (XXX is replaced by the first day of the bin, YYY is
2704  replaced by the last day), "monthXX" for 1-month bins (XX is
2705  replaced by the month), "monthXXtoYY" (XX is replaced by the first
2706  month of the bin, YY by the last month), or "cumulative".
2707
2708* %(Statistic)s - statistic that was calculated, in lowercase and with
2709  spaces replaced by underscores; one of: "count", "maximum", "mean",
2710  "minimum", "range", "standard_deviation", "Sum".
2711
2712If the Bin Type is "Daily", the following additional codes are
2713available:
2714
2715* %(FirstDay)i - first day of the year of the climatology bin
2716  represented by the output raster.
2717
2718* %(LastDay)i - last day of the year of the climatology bin
2719  represented by the output raster. For 1-day climatologies, this will
2720  be the same as %(FirstDay)i.
2721
2722If the Bin Type is "Monthly", the following additional codes are
2723available:
2724
2725* %(FirstMonth)i - first month of the climatology bin represented by
2726  the output raster.
2727
2728* %(DayOfFirstMonth)i - first day of the first month of the
2729  climatology bin represented by the output raster.
2730
2731* %(LastMonth)i - last month of the climatology bin represented by
2732  the output raster.
2733
2734* %(DayOfLastMonth)i - last day of the last month of the climatology
2735  bin represented by the output raster.
2736
2737Note that the additional codes are integers and may be formatted using
2738"printf"-style formatting codes. For example, to format the FirstDay
2739as a three-digit number with leading zeros::
2740
2741    %(FirstDay)03i
2742"""),
2743    arcGISDisplayName=_(u'Raster name expressions'))
2744
2745CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'binDuration', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'binDuration')
2746CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateClimatologicalArcGISRasters, u'startDayOfYear', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'startDayOfYear')
2747
2748CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'rotationOffset', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'rotationOffset')
2749CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'spatialExtent', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'spatialExtent')
2750CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'startDate', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'startDate')
2751CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'endDate', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'endDate')
2752CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'timeout', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'timeout')
2753CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'maxRetryTime', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'maxRetryTime')
2754CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'cacheDirectory', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'cacheDirectory')
2755CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'convertToCelsius', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'convertToCelsius')
2756CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'calculateStatistics', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'calculateStatistics')
2757CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'buildPyramids', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'buildPyramids')
2758
2759CopyResultMetadata(GHRSSTLevel4.CreateArcGISRasters, u'updatedOutputWorkspace', GHRSSTLevel4.CreateClimatologicalArcGISRasters, u'updatedOutputWorkspace')
2760
2761# Public method: GHRSSTLevel4.InterpolateAtArcGISPoints
2762
2763AddMethodMetadata(GHRSSTLevel4.InterpolateAtArcGISPoints,
2764    shortDescription=_(u'Interpolates values of a GHRSST L4 product hosted by NASA JPL PO.DAAC at points.'),
2765    longDescription=_(
2766u""" Given a desired GHRSST L4 product, this tool interpolates the
2767value of that product at the given points. This tool performs the same
2768basic operation as the ArcGIS Spatial Analyst's Extract Values to
2769Points tool, but it reads the MODIS data directly from NASA's servers
2770rather than reading rasters stored on your machine.
2771
2772""" + _GHRSSTLevel4_LongDescription) % {u'name': 'tool'},
2773    isExposedToPythonCallers=True,
2774    isExposedByCOM=True,
2775    isExposedAsArcGISTool=True,
2776    arcGISDisplayName=_(u'Interpolate GHRSST L4 SST at Points'),
2777    arcGISToolCategory=_(u'Data Products\\NASA JPL PO.DAAC\\GHRSST L4 SST'),
2778    dependencies=[ArcGISDependency(9, 1, requiresCOMInstantiation=True), PythonAggregatedModuleDependency('numpy')])
2779
2780CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'cls', GHRSSTLevel4.InterpolateAtArcGISPoints, u'cls')
2781CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'product', GHRSSTLevel4.InterpolateAtArcGISPoints, u'product')
2782CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'variableName', GHRSSTLevel4.InterpolateAtArcGISPoints, u'variableName')
2783
2784CopyArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'points', GHRSSTLevel4.InterpolateAtArcGISPoints, u'points')
2785CopyArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'valueField', GHRSSTLevel4.InterpolateAtArcGISPoints, u'valueField')
2786CopyArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'tField', GHRSSTLevel4.InterpolateAtArcGISPoints, u'tField')
2787
2788AddArgumentMetadata(GHRSSTLevel4.InterpolateAtArcGISPoints, u'method',
2789    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Nearest', u'Linear'], makeLowercase=True),
2790    description=_(
2791u"""Interpolation method to use, one of:
2792
2793* Nearest - nearest neighbor interpolation. The interpolated value
2794  will simply be the value of the cell that contains the point. This
2795  is the default.
2796
2797* Linear - linear interpolation (also known as trilinear
2798  interpolation). This method averages the values of the eight nearest
2799  cells in the x, y, and time dimensions, weighting the contribution
2800  of each cell by the area of it that would be covered by a
2801  hypothetical cell centered on the point being interpolated. If the
2802  cell containing the point contains NoData, the result is NoData. If
2803  any of the other seven cells contain NoData, they are omitted from
2804  the average, and the result is based on the weighted average of the
2805  cells that do contain data. This is the same algorithm implemented
2806  by the ArcGIS Spatial Analyst's Extract Values to Points tool.
2807"""),
2808    arcGISDisplayName=_(u'Interpolation method'))
2809
2810CopyArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'where', GHRSSTLevel4.InterpolateAtArcGISPoints, u'where')
2811CopyArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'noDataValue', GHRSSTLevel4.InterpolateAtArcGISPoints, u'noDataValue')
2812
2813AddArgumentMetadata(GHRSSTLevel4.InterpolateAtArcGISPoints, u'convertToCelsius',
2814    typeMetadata=BooleanTypeMetadata(),
2815    description=_(
2816u"""If True (the default), temperature values will be converted from
2817kelvin to degrees Celsius. If False, temperature values will be in the
2818original kelvin values."""),
2819    arcGISDisplayName=_(u'Convert temperatures to Celsius'),
2820    arcGISCategory=_(u'Interpolation options'))
2821
2822CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'timeout', GHRSSTLevel4.InterpolateAtArcGISPoints, u'timeout')
2823CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'maxRetryTime', GHRSSTLevel4.InterpolateAtArcGISPoints, u'maxRetryTime')
2824CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'cacheDirectory', GHRSSTLevel4.InterpolateAtArcGISPoints, u'cacheDirectory')
2825
2826CopyArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'orderByFields', GHRSSTLevel4.InterpolateAtArcGISPoints, u'orderByFields')
2827
2828AddArgumentMetadata(GHRSSTLevel4.InterpolateAtArcGISPoints, u'numBlocksToCacheInMemory',
2829    typeMetadata=IntegerTypeMetadata(minValue=0, canBeNone=True),
2830    description=_(
2831u"""Maximum number of blocks of SST data to cache in memory.
2832
2833To minimize the number of times that the disk or network must be
2834accessed, this tool employs a simple caching strategy, in addition to
2835disk caching described by the Cache Directory parameter. When it
2836processes the first point, it reads a square block of cells centered
2837on that point and caches it in memory. When it processes the second
2838and subsequent points, it first checks whether the cells needed for
2839that point are contained by the block cached in memory. If so, it
2840processes that point using the in-memory block, rather than reading
2841from disk or the network again. If not, it reads another square block
2842centered on that point and adds it to the cache.
2843
2844The tool processes the remaining points, adding additional blocks to
2845the cache, as needed. To prevent the cache from exhausing all memory,
2846it is only permitted to grow to the size specified by this parameter.
2847When the cache is full but a new block is needed, the oldest block is
2848discarded to make room for the newest block.
2849
2850The maximum size of the cache in bytes may be calculated by
2851multiplying this parameter by the block size parameters and then by 2.
2852For example, if this parameter is 256 and the blocks are x=64 by y=64
2853by t=1, the maximum size of the cache is 2097152 bytes (2 MB).
2854
2855If this parameter is 0, no blocks will be cached in memory."""),
2856    arcGISDisplayName=_(u'Number of blocks of data to cache in memory'),
2857    arcGISCategory=_(u'Performance tuning options'))
2858
2859CopyArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'xBlockSize', GHRSSTLevel4.InterpolateAtArcGISPoints, u'xBlockSize')
2860CopyArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'yBlockSize', GHRSSTLevel4.InterpolateAtArcGISPoints, u'yBlockSize')
2861CopyArgumentMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'tBlockSize', GHRSSTLevel4.InterpolateAtArcGISPoints, u'tBlockSize')
2862
2863CopyResultMetadata(MODISL3SSTTimeSeries.InterpolateAtArcGISPoints, u'updatedPoints', GHRSSTLevel4.InterpolateAtArcGISPoints, u'updatedPoints')
2864
2865# Public method: GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters
2866
2867AddMethodMetadata(GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters,
2868    shortDescription=_(u'Creates rasters indicating the positions of fronts in GHRSST L4 SST images hosted by NASA JPL PO.DAAC, using the Cayula and Cornillon (1992) single image edge detection (SIED) algorithm.'),
2869    longDescription=_GHRSSTLevel4_LongDescription + _(
2870u"""
2871
2872Given a desired GHRSST L4 product, this tool efficiently downloads the
2873a time series of SST images, executes the Cayula and Cornillon SIED
2874algorithm to identify fronts, and creates rasters showing the
2875locations of the fronts.
2876
2877This tool is complicated and has a lot of parameters. The complex
2878dynamics of the ocean and the presence of clouds make it hard to
2879obtain perfect results, even with the sophisticated algorithms GHRSST
2880products employ to guess values for cloudy pixels. For the best chance
2881of success, please read all of the documentation carefully.
2882
2883In our experience, the SIED front detection algorithm is somewhat
2884sensitive to the spatial resolution of the SST data it is applied to
2885and will perform better if several parameters are adjusted. We
2886configured the default parameter values of this tool to those used in
2887Cayula and Cornillon's original study. That study was applied to AVHRR
2888images collected by NOAA polar orbiters. The images had an effective
2889resolution between 1 and 1.5 km. Therefore the default parameter
2890values for this tool are appropriate for GHRSST products with similar
2891resolution (e.g. EUR-L4UHRfnd-MED-ODYSSEA, EUR-L4UHRfnd-NWE-ODYSSEA,
2892JPL-L4UHfnd-GLOB-MUR, JPL_OUROCEAN-L4UHfnd-GLOB-G1SST).
2893
2894To apply this tool to higher resolution GHRSST L4 products, we suggest
2895reducing the Histogram Window Size to a smaller value such as 20. If
2896you do that, you must also reduce the Minimum Single-Population
2897Cohesion and Minimum Global-Population Cohesion parameters, as
2898described in the documentation for those parameters. FOr a Histogram
2899Window Size fo 20, those two parameters should be set to 0.88 and 0.9,
2900respectively.
2901
2902Note that the Front Cleanup Options, which are enabled by default,
2903require that MATLAB 2007b or the MATLAB Component Runtime (MCR) 7.7 be
2904installed. You can download a free copy of the MCR 7.7 from
2905http://code.nicholas.duke.edu/projects/mget/wiki/MCR. If you do not
2906wish to install MATLAB or the MCR, you must disable the Front Cleanup
2907Options.
2908
2909**The SIED Algorithm**
2910
2911""" + _SIEDDescription +
2912"""
2913
2914""" + _SIEDReferences) % {u'name': 'tool'},
2915    isExposedToPythonCallers=True,
2916    isExposedByCOM=True,
2917    isExposedAsArcGISTool=True,
2918    arcGISDisplayName=_(u'Find Cayula-Cornillon Fronts in GHRSST L4 SST'),
2919    arcGISToolCategory=_(u'Data Products\\NASA JPL PO.DAAC\\GHRSST L4 SST'),
2920    dependencies=[ArcGISDependency(9, 1), PythonAggregatedModuleDependency('numpy')])
2921
2922CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'cls', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'cls')
2923CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'product', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'product')
2924
2925AddArgumentMetadata(GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'minPopMeanDifference',
2926    typeMetadata=FloatTypeMetadata(mustBeGreaterThan=0.),
2927    description=_(
2928u"""Minimum difference, in degrees C, between the mean temperatures of
2929two adjacent populations of pixels for a front to be detected between
2930those two populations.
2931
2932The Cayula and Cornillon algorithm passes a moving window over the
2933image, checking each window for a bimodal distribution in the
2934temperatures of the pixels within it. When the algorithm detects a
2935bimodal distribution, it computes the mean temperatures of the two
2936populations and compares the difference between the means to this
2937threshold. If the difference is less than this threshold, the
2938algorithm concludes there is no front present and moves on to the next
2939window.
2940
2941You can use this parameter to eliminate weak fronts by selecting a
2942value that corresponds to a desired minimum mean temperature
2943difference. Larger values will detect fewer fronts; smaller values
2944will detect more fronts. However, bear in mind that temperature
2945estimates derived from most satellite remote sensors are only
2946considered accurate to within 0.3 to 0.5 degrees C. We do not advise
2947thresholds below 0.3 to 0.5 degrees C."""),
2948    arcGISDisplayName=_(u'Front detection threshold'))
2949
2950CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputWorkspace', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputWorkspace')
2951CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'mode', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'mode')
2952
2953AddArgumentMetadata(GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'rasterNameExpressions',
2954    typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(), minLength=1),
2955    description=_(
2956u"""List of expressions specifying how the output rasters should be
2957named.
2958
2959The default expression assumes you are storing rasters in a file
2960system directory and creates them in a tree structure. When storing
2961rasters in a directory, the final expression specifies the file name
2962of the raster and any preceding expressions specify subdirectories.
2963The extension of the final expression determines the output raster
2964format: .asc for ArcInfo ASCII Grid, .bmp for BMP, .gif for GIF, .img
2965for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for
2966PNG, .tif for GeoTIFF, or no extension for ArcInfo Binary Grid. The
2967default expression uses .img.
2968
2969When storing rasters in a geodatabase, you should provide only one
2970expression. That expression specifies the raster's name.
2971
2972Each expression may contain any sequence of characters permitted by
2973the output workspace. Each expression may optionally contain one or
2974more of the following case-sensitive codes. The tool replaces the
2975codes with appropriate values when creating each raster:
2976
2977* %(AreaCode)s - GHRSST abbreviation indicating the spatial extent of
2978  the product, such as "GLOB" for global extent or "AUS" for
2979  Australia.
2980
2981* %(RDACCode)s - GHRSST abbreviation for the Regonal Data Assembly
2982  Center (RDAC) that produced the product.
2983
2984* %(ProductCode)s - name of the product, assigned by the RDAC.
2985
2986* %(VariableName)s - GHRSST variable represented in the output raster,
2987  either "analysed_sst" or "analysis_error".
2988
2989* %(ProductType)s - GHRSST product type code that indicates the
2990  overall resolution and type of SST estimated by the product. For
2991  example, "UHfnd" indicates ultra-high resolution (< 5 km spatial
2992  resolution) foundational SST. Please see the GHRSST documentation
2993  for the formal meanings of these codes.
2994
2995* %(GDSVersion)02i - version of the GHRSST Data Specification (GDS)
2996  used by the product. At the time of this writing, all products
2997  accessed by this function were at GDS version 1, which will be
2998  rendered as 01 by the expression %(GDSVersion)02i.
2999
3000* %(FileVersion)s - version of the data file itself. This is
3001  product-specific and assigned by the RDAC that produced the product.
3002 
3003* %(ImageType)s - type of image represented in the output raster,
3004  either "floc" (front locations), "ccnt" (candidate counts), "fcnt"
3005  (front counts), "wsco" (window status codes), or "wsvl" (window
3006  status values).
3007
3008* %%Y - four-digit year of the raster.
3009
3010* %%m - two-digit month of the first day of the raster.
3011
3012* %%d - two-digit day of the month of the first day of the raster.
3013
3014* %%j - three-digit day of the year of the first day of the raster.
3015"""),
3016    arcGISDisplayName=_(u'Raster name expressions'))
3017
3018CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'medianFilterWindowSize', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'medianFilterWindowSize')
3019CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'histogramWindowSize', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'histogramWindowSize')
3020CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'histogramWindowStride', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'histogramWindowStride')
3021CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'minPropNonMaskedCells', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'minPropNonMaskedCells')
3022CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'minPopProp', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'minPopProp')
3023CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'minTheta', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'minTheta')
3024CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'minSinglePopCohesion', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'minSinglePopCohesion')
3025CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'minGlobalPopCohesion', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'minGlobalPopCohesion')
3026CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'threads', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'threads')
3027CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'fillHoles', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'fillHoles')
3028CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'thin', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'thin')
3029CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, u'minSize', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'minSize')
3030
3031CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'rotationOffset', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'rotationOffset')
3032CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'spatialExtent', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'spatialExtent')
3033CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'startDate', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'startDate')
3034CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'endDate', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'endDate')
3035CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'timeout', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'timeout')
3036CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'maxRetryTime', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'maxRetryTime')
3037CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'cacheDirectory', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'cacheDirectory')
3038CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'calculateStatistics', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'calculateStatistics')
3039CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'buildRAT', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'buildRAT')
3040CopyArgumentMetadata(GHRSSTLevel4.CreateArcGISRasters, u'buildPyramids', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'buildPyramids')
3041
3042CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputCandidateCounts', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputCandidateCounts')
3043CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputFrontCounts', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputFrontCounts')
3044CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputWindowStatusCodes', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputWindowStatusCodes')
3045CopyArgumentMetadata(MODISL3SSTTimeSeries.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputWindowStatusValues', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'outputWindowStatusValues')
3046
3047CopyResultMetadata(GHRSSTLevel4.CreateArcGISRasters, u'updatedOutputWorkspace', GHRSSTLevel4.CreateCayulaCornillonFrontsAsArcGISRasters, u'updatedOutputWorkspace')
3048
3049###############################################################################
3050# Metadata: QuikSCATL3TimeSeries class
3051###############################################################################
3052
3053AddClassMetadata(QuikSCATL3TimeSeries,
3054    shortDescription=_(u'TODO: Add description.'))
3055
3056# TODO: Add metadata
3057
3058###############################################################################
3059# Metadata: QuikSCATL3TimeSlicesInDirectory class
3060###############################################################################
3061
3062AddClassMetadata(QuikSCATL3TimeSlicesInDirectory,
3063    shortDescription=_(u'TODO: Add description.'))
3064
3065# TODO: Add metadata
3066
3067###############################################################################
3068# Names exported by this module
3069###############################################################################
3070
3071__all__ = ['MODISL3SSTTimeSeries',
3072           'GHRSSTLevel4'
3073           'QuikSCATL3TimeSeries',
3074           'QuikSCATL3TimeSlicesInDirectory']
Note: See TracBrowser for help on using the browser.