Skip to Content.

mget-help - RE: [mget-help] HYCOM OPeNDAP URL

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


From: "Jason Roberts" <>
To: "'Shin Kobara'" <>
Cc: <>
Subject: RE: [mget-help] HYCOM OPeNDAP URL
Date: Fri, 24 May 2013 14:42:28 -0400

Dear Shin,

 

You are correct. I fixed the problem some time ago but have not had time to release a new version of MGET yet (I’ve been very busy with another project). Sorry about that.

 

A patched file is attached. To apply it:

 

1.    Stop all ArcGIS programs.

2.    Overwrite C:\Python27\ArcGIS10.1\Lib\site-packages\GeoEco\DataProducts\HYCOM.py with the attached file.

3.    Try the tool again.

 

This patch also switches the HYCOM server from tds.hycom.org to tds1.hycom.org, but only for the Gulf of Mexico datasets. According to Michael McDonald, the HYCOM sysadmin, tds.hycom.org is dying. He is replacing it with tds1.hycom.org. I do not know if tds1.hycom.org will be the server name going forward, or if he will rename the new server to tds.hycom.org after the old one is finally decommissioned. In any case, the old server is so fragile right now that it makes sense to change MGET to the new one, even if it is only temporary.

 

Unfortunately the new server does not have an “all experiments aggregated” version of the global datasets; it only has the individual experiments as separate THREDDS catalogs, similar to how the GoMex datasets work. Because MGET’s tools for the global datasets is currently programmed to require an “all experiments aggregated”, I cannot switch it to the new server merely by editing the URL inside the code to use tds1.hycom.org instead of tds.hycom.org. I have to modify it to aggregate the datasets itself, similar to how the MGET GoMex tools work. I have not had time to do this yet.

 

I hope this helps. Let me know if you have any other problems.

 

Jason

 

From: Shin Kobara [mailto:]
Sent: Thursday, May 23, 2013 6:18 PM
To:
Subject: [mget-help] HYCOM OPeNDAP URL

 

Hi,

 

Could you fix HYCOM OpeNDAP Url?

But I believe it should be 31.0 for 2013.

 

Thank you


Shin Kobara, Ph.D
979-739-1607
-------------------------------
Live with hope, Aspire for lofty ideals, Be true to yourself
There your inner brilliance shines. D. Ikeda

# Datasets/HYCOM.py - Grids representing HYCOM datasets.
#
# Copyright (C) 2010 Jason J. Roberts
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License (available in the file LICENSE.TXT)
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA.

import bisect
import datetime
import os

from GeoEco.Datasets import Dataset, QueryableAttribute, Grid
from GeoEco.Datasets.OPeNDAP import THREDDSCatalog, OPeNDAPURL, OPeNDAPGrid
from GeoEco.DynamicDocString import DynamicDocString
from GeoEco.Internationalization import _
from GeoEco.Types import *


class _HYCOMGridGOMl0043D(OPeNDAPGrid):
    __doc__ = DynamicDocString()

    def __init__(self, url, variableName, timeout, maxRetryTime, 
cacheDirectory):
        self._CachedTCenterCoords = None
        super(_HYCOMGridGOMl0043D, self).__init__(OPeNDAPURL(url, 
timeout=timeout, maxRetryTime=maxRetryTime, cacheDirectory=cacheDirectory),
                                                    variableName,
                                                    'Grid',
                                                    
lazyPropertyValues={'SpatialReference': 
Dataset.ConvertSpatialReference('proj4', '+proj=merc +R=6371001 +no_defs', 
'obj'),
                                                                        
'Dimensions': 'tyx',
                                                                        
'CoordDependencies': (None, None, None),
                                                                        
'CoordIncrements': (None, 4447.7949713872476, 4447.7949713872476),      # t 
increment is None because, sadly, HYCOM omits slices when their system 
occasionally fails to generate data for a day
                                                                        
'TCornerCoordType': 'center',
                                                                        
'PhysicalDimensions': 'tyx',
                                                                        
'PhysicalDimensionsFlipped': (False, False, False),
                                                                        
'UnscaledDataType': 'float32',
                                                                        
'UnscaledNoDataValue': 1.2676506002282294e+030,
                                                                        
'ScalingFunction': None})
        
    def _GetLazyPropertyPhysicalValue(self, name):
        if name == 'CornerCoords':
            return (self._GetCoords('t', 0, [0], [0], 0.), 
2045985.6431758059, -10897097.679898757)       # Center of lower-left cell, 
in degrees: 98.0 W, 18.091648101806641 N
        return super(_HYCOMGridGOMl0043D, 
self)._GetLazyPropertyPhysicalValue(name)

    def _GetCoords(self, coord, coordNum, slices, sliceDims, 
fixedIncrementOffset):
        if coord != 't':
            raise RuntimeError(_('_HYCOMGridGOMl0043D._GetCoords() called 
with coord == \'%(coord)s\'. This should never happen. Please contact the 
author of this tool for assistance.') % {u'coord': coord})
        if self._CachedTCenterCoords is None:
            import numpy
            self.ParentCollection._Open()
            mt = list(self.ParentCollection._PydapDataset['MT'][:])
            if len(mt) > 0 and isinstance(mt[0], numpy.string_):
                self._CachedTCenterCoords = numpy.array(map(lambda dateStr: 
datetime.datetime.strptime(str(dateStr)[:19], '%Y-%m-%dT%H:%M:%S'), mt), 
dtype='object')
            else:
                self._CachedTCenterCoords = numpy.array(map(lambda days: 
datetime.timedelta(days) + datetime.datetime(1900, 12, 31), mt), 
dtype='object')
        if slices is None:
            result = self._CachedTCenterCoords.copy()
        else:
            result = self._CachedTCenterCoords.__getitem__(*slices)
        if fixedIncrementOffset != 0:
            result += datetime.timedelta(fixedIncrementOffset)
        return result


class HYCOMGOMl0043D(Grid):
    __doc__ = DynamicDocString()

    def _GetVariableName(self):
        return self._VariableName

    VariableName = property(_GetVariableName, doc=DynamicDocString())

    def _GetStartYear(self):
        return self._StartYear

    StartYear = property(_GetStartYear, doc=DynamicDocString())

    def _GetEndYear(self):
        return self._EndYear

    EndYear = property(_GetEndYear, doc=DynamicDocString())

    def __init__(self, variableName, startYear=None, endYear=None, 
timeout=600, maxRetryTime=None, cacheDirectory=None):
        self.__doc__.Obj.ValidateMethodInvocation()

        # Perform additional validation

        if startYear is None:
            startYear = 2003
        elif startYear > (datetime.datetime.now() + 
datetime.timedelta(5)).year:
            raise ValueError(_(u'The start year must be less than or equal to 
%(max)i.') % {u'max': (datetime.datetime.now() + datetime.timedelta(5)).year})

        if endYear is not None and endYear < startYear:
            raise ValueError(_(u'The end year must be greater than or equal 
to the start year. If the start year is not specified, the end year must be 
greater than or equal to 2003.'))

        # Initialize our properties.

        self._VariableName = variableName
        self._StartYear = startYear
        self._EndYear = endYear
        self._Timeout = timeout
        self._MaxRetryTime = maxRetryTime
        self._CacheDirectory = cacheDirectory
        self._DisplayName = _(u'%(name)s grid of the HYCOM + NCODA Gulf of 
Mexico 1/25 degree Analysis (GOMl0.04)') % {u'name': variableName}
        self._OpenURL = None
        self._OpenGrid = None

        # Initialize the base class.

        super(HYCOMGOMl0043D, 
self).__init__(queryableAttributes=(QueryableAttribute(u'VariableName', 
_(u'HYCOM variable'), UnicodeStringTypeMetadata(allowedValues=[u'emp', 
u'mld', u'mlp', u'qtot', u'ssh', u'surface_salinity_trend', 
u'surface_temperature_trend'], makeLowercase=True)),),
                                             
queryableAttributeValues={u'VariableName': variableName},
                                             
lazyPropertyValues={'SpatialReference': 
Dataset.ConvertSpatialReference('proj4', '+proj=merc +R=6371001 +no_defs', 
'obj'),
                                                                 
'Dimensions': u'tyx',
                                                                 
'CoordDependencies': (None, None, None),
                                                                 
'CoordIncrements': (1.0, 4447.7949713872476, 4447.7949713872476),
                                                                 
'TIncrementUnit': u'day',
                                                                 
'TSemiRegularity': None,
                                                                 
'TCountPerSemiRegularPeriod': None,
                                                                 
'TCornerCoordType': u'center',
                                                                 
'CornerCoords': (datetime.datetime(startYear, 1, 1), 2045985.6431758059, 
-10897097.679898757),       # Center of lower-left cell, in degrees: 98.0 W, 
18.091648101806641 N
                                                                 
'PhysicalDimensions': u'tyx',
                                                                 
'PhysicalDimensionsFlipped': (False, False, False),
                                                                 
'UnscaledDataType': u'float32',
                                                                 
'UnscaledNoDataValue': 1.2676506002282294e+030,
                                                                 
'ScalingFunction': None})

    def _Close(self):
        if hasattr(self, '_OpenGrid') and self._OpenGrid is not None:
            self._OpenGrid.Close()
            self._OpenURL = None
            self._OpenGrid = None
        super(HYCOMGOMl0043D, self)._Close()

    def _GetDisplayName(self):
        return self._DisplayName
        
    def _GetLazyPropertyPhysicalValue(self, name):

        # The only property that we can retrieve here is the shape.
        # For the t axis, add the number of days in the years leading
        # up to the final year to the number of days available from
        # HYCOM in the final year. For the x and y axes, just use
        # hardcoded values.

        if name == 'Shape':
            if self._EndYear is not None and self._EndYear < 
datetime.datetime.now().year:
                return ((datetime.datetime(self._EndYear + 1, 1, 1) - 
datetime.datetime(self._StartYear, 1, 1)).days, 385, 541)

            endYearGrid = 
_HYCOMGridGOMl0043D('http://hycom-tds1.coaps.fsu.edu/thredds/dodsC/GOMl0.04/expt_31.0/%i'
 % datetime.datetime.now().year, self._VariableName, self._Timeout, 
self._MaxRetryTime, self._CacheDirectory)
            try:
                endDay = endYearGrid.CenterCoords['t', -1]
                
                if endDay.month == 12 and endDay.day == 31:
                    endYearGrid = 
_HYCOMGridGOMl0043D('http://hycom-tds1.coaps.fsu.edu/thredds/dodsC/GOMl0.04/expt_31.0/%i'
 % datetime.datetime.now().year + 1, self._VariableName, self._Timeout, 
self._MaxRetryTime, self._CacheDirectory)
                    endDay = endYearGrid.CenterCoords['t', -1]
            finally:
                endYearGrid.Close()

            return ((endDay - datetime.datetime(self._StartYear, 1, 1)).days 
+ 1, 385, 541)

        return None

    def _ReadNumpyArray(self, sliceList):

        # For many OPeNDAP datasets, we would be able to request the
        # entire 3D slab directly. This won't work for the HYCOM
        # GOMl0.04 dataset, for two reasons: 1) The dataset is split
        # OPeNDAP URLs for each year, and 2) HYCOM omits slices when
        # their system occasionally fails to generate data for a day,
        # so most years do not have a full 365 (or 366) slices. To
        # deal with this, we have to loop over the requested range of
        # time indices and issue OPeNDAP requests to the proper URLs
        # and per-URL time indices.
        #
        # First, allocate the array we will return. We'll populate
        # this as we go along. (I prefer this approach rather than
        # growing an array through concatenation because it avoids
        # repeatedly allocating and copying memory.)

        import numpy
        result = numpy.zeros((sliceList[0].stop - sliceList[0].start, 
sliceList[1].stop - sliceList[1].start, sliceList[2].stop - 
sliceList[2].start), dtype=str(self.UnscaledDataType))

        # Loop over the requested t indices, populating the result
        # array.

        i = 0
        tCoords = self.CenterCoords['t', sliceList[0]]
        
        while i < len(tCoords):

            # Open the _HYCOMGridGOMl0043D for the next block of t
            # coordinates. These grids are 1 year long, except in 2010
            # when HYCOM switched to an improved configuration after
            # six months.

            if tCoords[i] < datetime.datetime(2009, 5, 1):
                url = 
'http://tds.hycom.org/thredds/dodsC/GOMl0.04/expt_20.1/%i' % tCoords[i].year
            else:
                url = 
'http://hycom-tds1.coaps.fsu.edu/thredds/dodsC/GOMl0.04/expt_31.0/%i' % 
tCoords[i].year

            if self._OpenURL != url:
                if self._OpenGrid is not None:
                    self._OpenGrid.Close()
                    self._OpenURL = None
                    self._OpenGrid = None
                    
                self._OpenGrid = _HYCOMGridGOMl0043D(url, self._VariableName, 
self._Timeout, self._MaxRetryTime, self._CacheDirectory)
                self._OpenURL = url

            if tCoords[i] >= datetime.datetime(2010, 1, 1) and tCoords[i] <= 
datetime.datetime(2010, 6, 30):
                lastDayOfDataset = datetime.datetime(2010, 6, 30)
            else:
                lastDayOfDataset = datetime.datetime(tCoords[i].year, 12, 31)

            # Read the necessary data from this grid as one 3D slab.

            gridTStart = 
bisect.bisect_left(self._OpenGrid.CenterCoords['t'].tolist(), tCoords[i])
            gridTStop = 
bisect.bisect_right(self._OpenGrid.CenterCoords['t'].tolist(), tCoords[-1])
            gridTCoords = self._OpenGrid.CenterCoords['t', 
gridTStart:gridTStop]
            data = self._OpenGrid.UnscaledData.__getitem__((slice(gridTStart, 
gridTStop), sliceList[1], sliceList[2]))

            # Iterate through the t indices, copying out time slices
            # when they are available, otherwise setting slices to the
            # UnscaledNoDataValue.

            j = 0

            while i < len(tCoords) and tCoords[i] <= lastDayOfDataset:
                if j < len(gridTCoords) and gridTCoords[j] == tCoords[i]:
                    result[i] = data[j]
                    j += 1
                else:
                    result[i] = self.UnscaledNoDataValue
                i += 1

        # Return successfully.

        return result, self.UnscaledNoDataValue

    @classmethod
    def CreateArcGISRasters(cls, variableName,
                            outputWorkspace, mode=u'add', 
rasterNameExpressions=['%(VariableName)s', '%%Y', 
'%(VariableName)s_%%Y%%j.img'], rasterCatalog=None,
                            spatialExtent=None, linearUnit=u'Degrees', 
startDate=None, endDate=None,
                            timeout=600, maxRetryTime=None, 
cacheDirectory=None,
                            calculateStatistics=True, buildPyramids=False):
        cls.__doc__.Obj.ValidateMethodInvocation()
        if startDate is not None:
            startYear = startDate.year
        else:
            startYear = None
        if endDate is not None:
            endYear = endDate.year
        else:
            endYear = None
        grid = HYCOMGOMl0043D(variableName, startYear=startYear, 
endYear=endYear, timeout=timeout, maxRetryTime=maxRetryTime, 
cacheDirectory=cacheDirectory)
        try:
            cls._LogWarning(_(u'The HYCOM OPeNDAP server often requires five 
to ten minutes to return the data required to create the first raster. Please 
be patient. After the first one is created, the rest will go much faster. 
Because the first raster takes so long, the first status report may estimate 
an absurdly long time to completion. Please wait for the second status 
report, issued five minutes after the first one, for a better estimate. This 
tool cannot be cancelled until the first raster is created. If this tool 
fails with to a timeout error, increase the timeout value and try again.'))
            from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
            from GeoEco.Datasets.Virtual import GridSliceCollection
            grid = HYCOMGOMl0044D._Clip(grid, spatialExtent, linearUnit, 
startDate=startDate, endDate=endDate)
            workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, 
pathCreationExpressions=rasterNameExpressions, cacheTree=True, 
queryableAttributes=tuple(grid.GetAllQueryableAttributes() + 
[QueryableAttribute(u'DateTime', _(u'Date'), DateTimeTypeMetadata())]))
            workspace.ImportDatasets(GridSliceCollection(grid, 
tQACoordType=u'center').QueryDatasets(), mode, 
calculateStatistics=calculateStatistics, buildPyramids=buildPyramids)
            if rasterCatalog is not None:
                workspace.ToRasterCatalog(rasterCatalog, 
grid.GetSpatialReference(u'ArcGIS'), tQACoordType=u'center', 
tCoordFunction=lambda qav: [qav[u'DateTime'] - datetime.timedelta(0.5), 
qav[u'DateTime'], qav[u'DateTime'] + datetime.timedelta(0.5) - 
datetime.timedelta(seconds=1)], overwriteExisting=True)
        finally:
            grid.Close()
        return outputWorkspace

    @classmethod
    def CreateClimatologicalArcGISRasters(cls, variableName,
                                          statistic, binType,
                                          outputWorkspace, mode=u'add', 
rasterNameExpressions=[u'%(VariableName)s', 
u'%(ClimatologyBinType)s_Climatology', 
u'%(VariableName)s_%(ClimatologyBinName)s_%(Statistic)s.img'],
                                          binDuration=1, startDayOfYear=1,
                                          spatialExtent=None, 
linearUnit=u'Degrees', startDate=None, endDate=None,
                                          timeout=600, maxRetryTime=None, 
cacheDirectory=None,
                                          calculateStatistics=True, 
buildPyramids=False):
        cls.__doc__.Obj.ValidateMethodInvocation()
        if startDate is not None:
            startYear = startDate.year
        else:
            startYear = None
        if endDate is not None:
            endYear = endDate.year
        else:
            endYear = None
        grid = HYCOMGOMl0043D(variableName, startYear=startYear, 
endYear=endYear, timeout=timeout, maxRetryTime=maxRetryTime, 
cacheDirectory=cacheDirectory)
        try:
            cls._LogWarning(_(u'The HYCOM OPeNDAP server often requires five 
to ten minutes to return the data required to create the first raster. Please 
be patient. After the first one is created, the rest will go much faster. 
Because the first raster takes so long, the first status report may estimate 
an absurdly long time to completion. Please wait for the second status 
report, issued five minutes after the first one, for a better estimate. This 
tool cannot be cancelled until the first raster is created. If this tool 
fails with to a timeout error, increase the timeout value and try again.'))
            from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
            from GeoEco.Datasets.Virtual import ClimatologicalGridCollection
            grid = HYCOMGOMl0044D._Clip(grid, spatialExtent, linearUnit, 
startDate=startDate, endDate=endDate)
            collection = ClimatologicalGridCollection(grid, statistic, 
binType, binDuration, startDayOfYear, reportProgress=True)
            workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, 
pathCreationExpressions=rasterNameExpressions, cacheTree=True, 
queryableAttributes=tuple(collection.GetAllQueryableAttributes()))
            workspace.ImportDatasets(collection.QueryDatasets(), mode, 
calculateStatistics=calculateStatistics, buildPyramids=buildPyramids)
        finally:
            grid.Close()
        return outputWorkspace

    @classmethod
    def InterpolateAtArcGISPoints(cls, variableNames,
                                  points, valueFields, tField, 
method=u'Nearest', where=None, noDataValue=None,
                                  timeout=600, maxRetryTime=None, 
cacheDirectory=None,
                                  orderByFields=None, 
numBlocksToCacheInMemory=128, xBlockSize=16, yBlockSize=16, tBlockSize=3):
        cls.__doc__.Obj.ValidateMethodInvocation()
        grids = [HYCOMGOMl0043D(variableName, timeout=timeout, 
maxRetryTime=maxRetryTime, cacheDirectory=cacheDirectory) for variableName in 
variableNames]
        try:
            if orderByFields is not None:
                orderBy = u', '.join(map(lambda f: f + u' ASC', 
orderByFields))
            else:
                from GeoEco.ArcGIS import GeoprocessorManager
                if GeoprocessorManager.GetArcGISMajorVersion() > 9 or 
GeoprocessorManager.GetArcGISMinorVersion() >= 2:
                    orderBy = tField + u' ASC'
                else:
                    orderBy = None
            cls._LogWarning(_(u'The HYCOM OPeNDAP server often requires five 
to ten minutes to return the data required to process the first point. Please 
be patient. After the first one is processed, the rest will go much faster. 
Because the first one takes so long, the first status report may estimate an 
absurdly long time to completion. Please wait for the second status report, 
issued five minutes after the first one, for a better estimate. This tool 
cannot be cancelled until the first point is processed. If this tool fails 
with to a timeout error, increase the timeout value and try again.'))
            from GeoEco.Datasets.ArcGIS import ArcGISTable
            from GeoEco.SpatialAnalysis.Interpolation import Interpolator
            Interpolator.InterpolateGridsValuesForTableOfPoints(grids, 
ArcGISTable(points), valueFields, tField=tField, where=where, 
orderBy=orderBy, method=method, noDataValue=noDataValue, 
numBlocksToCacheInMemory=numBlocksToCacheInMemory, xBlockSize=xBlockSize, 
yBlockSize=yBlockSize, tBlockSize=tBlockSize)
        finally:
            for grid in grids:
                grid.Close()
        return points


class _HYCOMGridGOMl0044D(OPeNDAPGrid):
    __doc__ = DynamicDocString()

    def __init__(self, url, variableName, timeout, maxRetryTime, 
cacheDirectory):
        self._CachedTCenterCoords = None
        super(_HYCOMGridGOMl0044D, self).__init__(OPeNDAPURL(url, 
timeout=timeout, maxRetryTime=maxRetryTime, cacheDirectory=cacheDirectory),
                                                    variableName,
                                                    'Grid',
                                                    
lazyPropertyValues={'SpatialReference': 
Dataset.ConvertSpatialReference('proj4', '+proj=merc +R=6371001 +no_defs', 
'obj'),
                                                                        
'Dimensions': 'tzyx',
                                                                        
'CoordDependencies': (None, None, None, None),
                                                                        
'CoordIncrements': (None, None, 4447.7949713872476, 4447.7949713872476),      
  # t increment is None because, sadly, HYCOM omits slices when their system 
occasionally fails to generate data for a day
                                                                        
'TCornerCoordType': 'center',
                                                                        
'PhysicalDimensions': 'tzyx',
                                                                        
'PhysicalDimensionsFlipped': (False, False, False, False),
                                                                        
'UnscaledDataType': 'float32',
                                                                        
'UnscaledNoDataValue': 1.2676506002282294e+030,
                                                                        
'ScalingFunction': None})
        
    def _GetLazyPropertyPhysicalValue(self, name):
        if name == 'CornerCoords':
            return (self._GetCoords('t', 0, [0], [0], 0.), 0.0, 
2045985.6431758059, -10897097.679898757)       # Center of lower-left cell, 
in degrees: 98.0 W, 18.091648101806641 N
        return super(_HYCOMGridGOMl0044D, 
self)._GetLazyPropertyPhysicalValue(name)

    def _GetCoords(self, coord, coordNum, slices, sliceDims, 
fixedIncrementOffset):
        if coord not in ['t', 'z']:
            raise RuntimeError(_('_HYCOMGridGOMl0044D._GetCoords() called 
with coord == \'%(coord)s\'. This should never happen. Please contact the 
author of this tool for assistance.') % {u'coord': coord})

        import numpy

        if coord == 't':
            if self._CachedTCenterCoords is None:
                self.ParentCollection._Open()
                mt = list(self.ParentCollection._PydapDataset['MT'][:])
                if len(mt) > 0 and isinstance(mt[0], numpy.string_):
                    self._CachedTCenterCoords = numpy.array(map(lambda 
dateStr: datetime.datetime.strptime(str(dateStr)[:19], '%Y-%m-%dT%H:%M:%S'), 
mt), dtype='object')
                else:
                    self._CachedTCenterCoords = numpy.array(map(lambda days: 
datetime.timedelta(days) + datetime.datetime(1900, 12, 31), mt), 
dtype='object')
            if slices is None:
                result = self._CachedTCenterCoords.copy()
            else:
                result = self._CachedTCenterCoords.__getitem__(*slices)
            if fixedIncrementOffset != 0:
                result += datetime.timedelta(fixedIncrementOffset)
            return result

        zCoords = [0.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 40.0, 50.0, 60.0, 
70.0, 80.0, 90.0, 100.0, 125.0, 150.0, 200.0, 250.0, 300.0, 400.0, 500.0, 
600.0, 700.0, 800.0, 900.0, 1000.0, 1100.0, 1200.0, 1300.0, 1400.0, 1500.0, 
1750.0, 2000.0, 2500.0, 3000.0, 3500.0, 4000.0, 4500.0, 5000.0, 5500.0]
        if fixedIncrementOffset == -0.5:
            zCoords = [0.0] + map(lambda a, b: (a+b)/2., zCoords[:-1], 
zCoords[1:])
        elif fixedIncrementOffset == 0.5:
            zCoords = map(lambda a, b: (a+b)/2., zCoords[:-1], zCoords[1:]) + 
[11000.0]
        if slices is None:
            return numpy.array(zCoords)
        return numpy.array(zCoords).__getitem__(*slices)


class HYCOMGOMl0044D(Grid):
    __doc__ = DynamicDocString()

    def _GetVariableName(self):
        return self._VariableName

    VariableName = property(_GetVariableName, doc=DynamicDocString())

    def _GetStartYear(self):
        return self._StartYear

    StartYear = property(_GetStartYear, doc=DynamicDocString())

    def _GetEndYear(self):
        return self._EndYear

    EndYear = property(_GetEndYear, doc=DynamicDocString())

    def __init__(self, variableName, startYear=None, endYear=None, 
timeout=600, maxRetryTime=None, cacheDirectory=None):
        self.__doc__.Obj.ValidateMethodInvocation()

        # Perform additional validation

        if startYear is None:
            startYear = 2003
        elif startYear > (datetime.datetime.now() + 
datetime.timedelta(5)).year:
            raise ValueError(_(u'The start year must be less than or equal to 
%(max)i.') % {u'max': (datetime.datetime.now() + datetime.timedelta(5)).year})

        if endYear is not None and endYear < startYear:
            raise ValueError(_(u'The end year must be greater than or equal 
to the start year. If the start year is not specified, the end year must be 
greater than or equal to 2003.'))

        # Initialize our properties.

        self._VariableName = variableName
        self._StartYear = startYear
        self._EndYear = endYear
        self._Timeout = timeout
        self._MaxRetryTime = maxRetryTime
        self._CacheDirectory = cacheDirectory
        self._DisplayName = _(u'%(name)s grid of the HYCOM + NCODA Gulf of 
Mexico 1/25 degree Analysis (GOMl0.04)') % {u'name': variableName}
        self._OpenURL = None
        self._OpenGrid = None

        # Initialize the base class.

        super(HYCOMGOMl0044D, 
self).__init__(queryableAttributes=(QueryableAttribute(u'VariableName', 
_(u'HYCOM variable'), UnicodeStringTypeMetadata(allowedValues=[u'salinity', 
u'temperature', u'u', u'v', u'w_velocity'], makeLowercase=True)),),
                                             
queryableAttributeValues={u'VariableName': variableName},
                                             
lazyPropertyValues={'SpatialReference': 
Dataset.ConvertSpatialReference('proj4', '+proj=merc +R=6371001 +no_defs', 
'obj'),
                                                                 
'Dimensions': u'tzyx',
                                                                 
'CoordDependencies': (None, None, None, None),
                                                                 
'CoordIncrements': (1.0, None, 4447.7949713872476, 4447.7949713872476),
                                                                 
'TIncrementUnit': u'day',
                                                                 
'TSemiRegularity': None,
                                                                 
'TCountPerSemiRegularPeriod': None,
                                                                 
'TCornerCoordType': u'center',
                                                                 
'CornerCoords': (datetime.datetime(startYear, 1, 1), 0.0, 2045985.6431758059, 
-10897097.679898757),       # Center of lower-left cell, in degrees: 98.0 W, 
18.091648101806641 N
                                                                 
'PhysicalDimensions': u'tzyx',
                                                                 
'PhysicalDimensionsFlipped': (False, False, False, False),
                                                                 
'UnscaledDataType': u'float32',
                                                                 
'UnscaledNoDataValue': 1.2676506002282294e+030,
                                                                 
'ScalingFunction': None})

    def _Close(self):
        if hasattr(self, '_OpenGrid') and self._OpenGrid is not None:
            self._OpenGrid.Close()
            self._OpenURL = None
            self._OpenGrid = None
        super(HYCOMGOMl0044D, self)._Close()

    def _GetDisplayName(self):
        return self._DisplayName
        
    def _GetLazyPropertyPhysicalValue(self, name):

        # The only property that we can retrieve here is the shape.
        # For the t axis, add the number of days in the years leading
        # up to the final year to the number of days available from
        # HYCOM in the final year. For the x and y axes, just use
        # hardcoded values.

        if name == 'Shape':
            if self._EndYear is not None and self._EndYear < 
datetime.datetime.now().year:
                return ((datetime.datetime(self._EndYear + 1, 1, 1) - 
datetime.datetime(self._StartYear, 1, 1)).days, 40, 385, 541)

            endYearGrid = 
_HYCOMGridGOMl0044D('http://hycom-tds1.coaps.fsu.edu/thredds/dodsC/GOMl0.04/expt_31.0/%i'
 % datetime.datetime.now().year, self._VariableName, self._Timeout, 
self._MaxRetryTime, self._CacheDirectory)
            try:
                endDay = endYearGrid.CenterCoords['t', -1]
                
                if endDay.month == 12 and endDay.day == 31:
                    endYearGrid = 
_HYCOMGridGOMl0044D('http://hycom-tds1.coaps.fsu.edu/thredds/dodsC/GOMl0.04/expt_31.0/%i'
 % datetime.datetime.now().year + 1, self._VariableName, self._Timeout, 
self._MaxRetryTime, self._CacheDirectory)
                    endDay = endYearGrid.CenterCoords['t', -1]
            finally:
                endYearGrid.Close()

            return ((endDay - datetime.datetime(self._StartYear, 1, 1)).days 
+ 1, 40, 385, 541)

        return None

    def _GetCoords(self, coord, coordNum, slices, sliceDims, 
fixedIncrementOffset):
        if coord != 'z':
            raise RuntimeError(_('HYCOMGOMl0044D._GetCoords() called with 
coord == \'%(coord)s\'. This should never happen. Please contact the author 
of this tool for assistance.') % {u'coord': coord})
        zCoords = [0.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 40.0, 50.0, 60.0, 
70.0, 80.0, 90.0, 100.0, 125.0, 150.0, 200.0, 250.0, 300.0, 400.0, 500.0, 
600.0, 700.0, 800.0, 900.0, 1000.0, 1100.0, 1200.0, 1300.0, 1400.0, 1500.0, 
1750.0, 2000.0, 2500.0, 3000.0, 3500.0, 4000.0, 4500.0, 5000.0, 5500.0]
        if fixedIncrementOffset == -0.5:
            zCoords = [0.0] + map(lambda a, b: (a+b)/2., zCoords[:-1], 
zCoords[1:])
        elif fixedIncrementOffset == 0.5:
            zCoords = map(lambda a, b: (a+b)/2., zCoords[:-1], zCoords[1:]) + 
[11000.0]
        import numpy
        if slices is None:
            return numpy.array(zCoords)
        return numpy.array(zCoords).__getitem__(*slices)

    def _ReadNumpyArray(self, sliceList):

        # For many OPeNDAP datasets, we would be able to request the
        # entire 4D slab directly. This won't work for the HYCOM
        # GOMl0.04 dataset, for two reasons: 1) The dataset is split
        # OPeNDAP URLs for each year, and 2) HYCOM omits slices when
        # their system occasionally fails to generate data for a day,
        # so most years do not have a full 365 (or 366) slices. To
        # deal with this, we have to loop over the requested range of
        # time indices and issue OPeNDAP requests to the proper URLs
        # and per-URL time indices.
        #
        # First, allocate the array we will return. We'll populate
        # this as we go along. (I prefer this approach rather than
        # growing an array through concatenation because it avoids
        # repeatedly allocating and copying memory.)

        import numpy
        result = numpy.zeros((sliceList[0].stop - sliceList[0].start, 
sliceList[1].stop - sliceList[1].start, sliceList[2].stop - 
sliceList[2].start, sliceList[3].stop - sliceList[3].start), 
dtype=str(self.UnscaledDataType))

        # Loop over the requested t indices, populating the result
        # array.

        i = 0
        tCoords = self.CenterCoords['t', sliceList[0]]
        
        while i < len(tCoords):

            # Open the _HYCOMGridGOMl0044D for the next block of t
            # coordinates. These grids are 1 year long, except in 2010
            # when HYCOM switched to an improved configuration after
            # five months.

            if tCoords[i] < datetime.datetime(2009, 5, 1):
                url = 
'http://tds.hycom.org/thredds/dodsC/GOMl0.04/expt_20.1/%i' % tCoords[i].year
            else:
                url = 
'http://hycom-tds1.coaps.fsu.edu/thredds/dodsC/GOMl0.04/expt_31.0/%i' % 
tCoords[i].year

            if self._OpenURL != url:
                if self._OpenGrid is not None:
                    self._OpenGrid.Close()
                    self._OpenURL = None
                    self._OpenGrid = None

                self._OpenGrid = _HYCOMGridGOMl0044D(url, self._VariableName, 
self._Timeout, self._MaxRetryTime, self._CacheDirectory)
                self._OpenURL = url

            if tCoords[i] >= datetime.datetime(2010, 1, 1) and tCoords[i] <= 
datetime.datetime(2010, 6, 30):
                lastDayOfDataset = datetime.datetime(2010, 6, 30)
            else:
                lastDayOfDataset = datetime.datetime(tCoords[i].year, 12, 31)

            # Read the necessary data from this grid as one 4D slab.

            gridTStart = 
bisect.bisect_left(self._OpenGrid.CenterCoords['t'].tolist(), tCoords[i])
            gridTStop = 
bisect.bisect_right(self._OpenGrid.CenterCoords['t'].tolist(), tCoords[-1])
            gridTCoords = self._OpenGrid.CenterCoords['t', 
gridTStart:gridTStop]
            data = self._OpenGrid.UnscaledData.__getitem__((slice(gridTStart, 
gridTStop), sliceList[1], sliceList[2], sliceList[3]))

            # Iterate through the t indices, copying out time slices
            # when they are available, otherwise setting slices to the
            # UnscaledNoDataValue.

            j = 0

            while i < len(tCoords) and tCoords[i] <= lastDayOfDataset:
                if j < len(gridTCoords) and gridTCoords[j] == tCoords[i]:
                    result[i] = data[j]
                    j += 1
                else:
                    result[i] = self.UnscaledNoDataValue
                i += 1

        # Return successfully.

        return result, self.UnscaledNoDataValue

    @classmethod
    def _Clip(cls, grid, spatialExtent, linearUnit, minDepth=None, 
maxDepth=None, startDate=None, endDate=None):
        from GeoEco.Datasets.Virtual import ClippedGrid
        
        xMin, yMin, xMax, yMax = None, None, None, None
        if spatialExtent is not None:
            sr = grid.GetSpatialReference('obj')

            from GeoEco.Types import EnvelopeTypeMetadata
            xMin, yMin, xMax, yMax = 
EnvelopeTypeMetadata.ParseFromArcGISString(spatialExtent)

            if linearUnit == u'degrees':
                centralMeridian = sr.GetNormProjParm('central_meridian')
                xMinAllowed = -180. + centralMeridian
                xMaxAllowed = 180. + centralMeridian

                if str(xMin) == str(xMinAllowed):
                    xMin = xMinAllowed
                elif str(xMin) == str(xMaxAllowed):
                    xMin = xMaxAllowed
                if str(xMax) == str(xMinAllowed):
                    xMax = xMinAllowed
                elif str(xMax) == str(xMaxAllowed):
                    xMax = xMaxAllowed

                if xMin < xMinAllowed or xMin > xMaxAllowed:
                    raise ValueError(_(u'The X Minimum of the Spatial Extent 
parameter (%(value)g degrees) is not within the geographic extent of the 
grid\'s coordinate system. The geographic extent in the X direction is 
%(xMin)g to %(xMax)g degrees. Please specify an X Minimum in that range.') % 
{u'value': xMin, u'xMin': xMinAllowed, u'xMax': xMaxAllowed})
                if xMax < xMinAllowed or xMax > xMaxAllowed:
                    raise ValueError(_(u'The X Maximum of the Spatial Extent 
parameter (%(value)g degrees) is not within the geographic extent of the 
grid\'s coordinate system. The geographic extent in the X direction is 
%(xMin)g to %(xMax)g degrees. Please specify an X Minimum in that range.') % 
{u'value': xMax, u'xMin': xMinAllowed, u'xMax': xMaxAllowed})
                
                yMin = max(yMin, -85.0)
                yMax = min(yMax, 85.0)
                try:
                    transformer = 
cls._osr().CoordinateTransformation(Dataset.ConvertSpatialReference('proj4', 
'+proj=latlong +R=6371001 +no_defs', 'obj'), grid.GetSpatialReference('obj'))
                    xMin, yMin = transformer.TransformPoint(xMin, yMin)[:2]
                    xMax, yMax = transformer.TransformPoint(xMax, yMax)[:2]
                except:
                    cls._gdal().ErrorReset()
                    raise

        if spatialExtent is not None or minDepth is not None or maxDepth is 
not None or startDate is not None or endDate is not None:
            if startDate is not None:
                startDate = datetime.datetime(startDate.year, 
startDate.month, startDate.day, 0, 0, 0)
            if endDate is not None:
                endDate = datetime.datetime(endDate.year, endDate.month, 
endDate.day, 23, 59, 59)
                
            grid = ClippedGrid(grid, u'Map coordinates', xMin=xMin, 
xMax=xMax, yMin=yMin, yMax=yMax, zMin=minDepth, zMax=maxDepth, 
tMin=startDate, tMax=endDate)

        return grid

    @classmethod
    def CreateArcGISRasters(cls, variableName,
                            outputWorkspace, mode=u'add', 
rasterNameExpressions=['%(VariableName)s', '%%Y', 'Depth_%(Depth)04.0fm', 
'%(VariableName)s_%%Y%%j_%(Depth)04.0fm.img'], rasterCatalog=None,
                            spatialExtent=None, linearUnit=u'Degrees', 
minDepth=None, maxDepth=None, startDate=None, endDate=None, 
                            timeout=600, maxRetryTime=None, 
cacheDirectory=None,
                            calculateStatistics=True, buildPyramids=False):
        cls.__doc__.Obj.ValidateMethodInvocation()
        if startDate is not None:
            startYear = startDate.year
        else:
            startYear = None
        if endDate is not None:
            endYear = endDate.year
        else:
            endYear = None
        grid = HYCOMGOMl0044D(variableName, startYear=startYear, 
endYear=endYear, timeout=timeout, maxRetryTime=maxRetryTime, 
cacheDirectory=cacheDirectory)
        try:
            cls._LogWarning(_(u'The HYCOM OPeNDAP server often requires five 
to ten minutes to return the data required to create the first raster. Please 
be patient. After the first one is created, the rest will go much faster. 
Because the first raster takes so long, the first status report may estimate 
an absurdly long time to completion. Please wait for the second status 
report, issued five minutes after the first one, for a better estimate. This 
tool cannot be cancelled until the first raster is created. If this tool 
fails with to a timeout error, increase the timeout value and try again.'))
            from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
            from GeoEco.Datasets.Virtual import GridSliceCollection, 
SeafloorGrid

            # If the caller requested a minimum depth that is within
            # the range of the HYCOM layers, instantiate those grids.

            grids = []
            if minDepth is None or minDepth <= 5500.:
                clippedGrid = cls._Clip(grid, spatialExtent, linearUnit, 
minDepth, maxDepth, startDate, endDate)
                grids.extend(GridSliceCollection(clippedGrid, 
tQACoordType=u'center', zQACoordType=u'center').QueryDatasets())

            # If the caller requested a maximum depth that is greater
            # than or equal to 20000., instantiate a grid representing
            # the values at the seafloor.

            if minDepth == 20000. or maxDepth >= 20000.:
                clippedGrid = cls._Clip(grid, spatialExtent, linearUnit, 
None, None, startDate, endDate)
                seafloorGrid = SeafloorGrid(clippedGrid, 
(QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata()),), {u'Depth': 
20000.})
                grids.extend(GridSliceCollection(seafloorGrid, 
tQACoordType=u'center').QueryDatasets())

            # Create the rasters.
            
            workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, 
pathCreationExpressions=rasterNameExpressions, cacheTree=True, 
queryableAttributes=tuple(grid.GetAllQueryableAttributes() + 
[QueryableAttribute(u'DateTime', _(u'Date'), DateTimeTypeMetadata()), 
QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata())]))
            workspace.ImportDatasets(grids, mode, 
calculateStatistics=calculateStatistics, buildPyramids=buildPyramids)
            if rasterCatalog is not None:
                workspace.ToRasterCatalog(rasterCatalog, 
grid.GetSpatialReference(u'ArcGIS'), tQACoordType=u'center', 
tCoordFunction=lambda qav: [qav[u'DateTime'] - datetime.timedelta(0.5), 
qav[u'DateTime'], qav[u'DateTime'] + datetime.timedelta(0.5) - 
datetime.timedelta(seconds=1)], overwriteExisting=True)
            
        finally:
            grid.Close()
        return outputWorkspace

    @classmethod
    def CreateClimatologicalArcGISRasters(cls, variableName,
                                          statistic, binType,
                                          outputWorkspace, mode=u'add', 
rasterNameExpressions=[u'%(VariableName)s', 
u'%(ClimatologyBinType)s_Climatology', 'Depth_%(Depth)04.0fm', 
u'%(VariableName)s_%(Depth)04.0fm_%(ClimatologyBinName)s_%(Statistic)s.img'],
                                          binDuration=1, startDayOfYear=1,
                                          spatialExtent=None, 
linearUnit=u'Degrees', minDepth=None, maxDepth=None, startDate=None, 
endDate=None,
                                          timeout=600, maxRetryTime=None, 
cacheDirectory=None,
                                          calculateStatistics=True, 
buildPyramids=False):
        cls.__doc__.Obj.ValidateMethodInvocation()
        if startDate is not None:
            startYear = startDate.year
        else:
            startYear = None
        if endDate is not None:
            endYear = endDate.year
        else:
            endYear = None
        grid = HYCOMGOMl0044D(variableName, startYear=startYear, 
endYear=endYear, timeout=timeout, maxRetryTime=maxRetryTime, 
cacheDirectory=cacheDirectory)
        try:
            from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
            from GeoEco.Datasets.Virtual import GridSliceCollection, 
ClimatologicalGridCollection, SeafloorGrid

            # If the caller requested a minimum depth that is within
            # the range of the HYCOM layers, instantiate a
            # ClimatologicalGridCollection from the clipped 4D (tzyx)
            # grid, query the 3D grids (zyx) from it, and get the 2D
            # (yx) slices of it.

            grids = []
            if minDepth is None or minDepth <= 5500.:
                clippedGrid = cls._Clip(grid, spatialExtent, linearUnit, 
minDepth, maxDepth, startDate, endDate)
                collection = ClimatologicalGridCollection(clippedGrid, 
statistic, binType, binDuration, startDayOfYear, reportProgress=False)
                for g in collection.QueryDatasets(reportProgress=False):
                    grids.extend(GridSliceCollection(g, 
zQACoordType=u'center').QueryDatasets(reportProgress=False))

            # If the caller requested a maximum depth that is greater
            # than or equal to 20000., instantiate a 3D SeafloorGrid
            # (tyx), create a ClimatologicalGridCollection from it,
            # and query the 2D (yx) grids from it.

            if minDepth == 20000. or maxDepth >= 20000.:
                clippedGrid = cls._Clip(grid, spatialExtent, linearUnit, 
None, None, startDate, endDate)
                seafloorGrid = SeafloorGrid(clippedGrid, 
(QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata()),), {u'Depth': 
20000.})
                collection = ClimatologicalGridCollection(seafloorGrid, 
statistic, binType, binDuration, startDayOfYear, reportProgress=False)
                grids.extend(collection.QueryDatasets(reportProgress=False))

            # Create the rasters.

            workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, 
pathCreationExpressions=rasterNameExpressions, cacheTree=True, 
queryableAttributes=tuple(collection.GetAllQueryableAttributes() + 
[QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata())]))
            workspace.ImportDatasets(grids, mode, 
calculateStatistics=calculateStatistics, buildPyramids=buildPyramids)

        finally:
            grid.Close()
        return outputWorkspace

    @classmethod
    def CreateCurrentVectorsAsArcGISFeatureClasses(cls, outputWorkspace, 
mode=u'add', featureClassNameExpressions=['uv_vectors', '%%Y', 
'Depth_%(Depth)04.0fm', 'uv_vectors_%%%Y%%j_%(Depth)04.0fm.shp'],
                                                   scaleFactor=4500., 
uniformLength=False,
                                                   spatialExtent=None, 
linearUnit=u'Degrees', minDepth=None, maxDepth=None, startDate=None, 
endDate=None,
                                                   timeout=600, 
maxRetryTime=None, cacheDirectory=None):
        cls.__doc__.Obj.ValidateMethodInvocation()

        # Create u and v component grids.

        if startDate is not None:
            startYear = startDate.year
        else:
            startYear = None
        if endDate is not None:
            endYear = endDate.year
        else:
            endYear = None
        
        uGrid = HYCOMGOMl0044D(u'u', startYear=startYear, endYear=endYear, 
timeout=timeout, maxRetryTime=maxRetryTime, cacheDirectory=cacheDirectory)
        try:
            vGrid = HYCOMGOMl0044D(u'v', startYear=startYear, 
endYear=endYear, timeout=timeout, maxRetryTime=maxRetryTime, 
cacheDirectory=cacheDirectory)
            try:
                cls._LogWarning(_(u'The HYCOM OPeNDAP server often requires 
five to ten minutes to return the data required to create the first feature 
class. Please be patient. After the first one is created, the rest will go 
much faster. Because the first raster takes so long, the first status report 
may estimate an absurdly long time to completion. Please wait for the second 
status report, issued five minutes after the first one, for a better 
estimate. This tool cannot be cancelled until the first raster is created. If 
this tool fails with to a timeout error, increase the timeout value and try 
again.'))
                
                # If the caller requested a minimum depth that is
                # within the range of the HYCOM layers, instantiate
                # those grids.

                from GeoEco.Datasets.Virtual import GridSliceCollection, 
SeafloorGrid

                uSlices = []
                vSlices = []

                if minDepth is None or minDepth <= 5500.:
                    clippedUGrid = cls._Clip(uGrid, spatialExtent, 
linearUnit, minDepth, maxDepth, startDate, endDate)
                    uSlices.extend(GridSliceCollection(clippedUGrid, 
tQACoordType=u'center', zQACoordType=u'center').QueryDatasets())

                    clippedVGrid = cls._Clip(vGrid, spatialExtent, 
linearUnit, minDepth, maxDepth, startDate, endDate)
                    vSlices.extend(GridSliceCollection(clippedVGrid, 
tQACoordType=u'center', zQACoordType=u'center').QueryDatasets())

                # If the caller requested a maximum depth that is
                # greater than or equal to 20000., instantiate grids
                # representing the values at the seafloor.

                if minDepth == 20000. or maxDepth >= 20000.:
                    clippedUGrid = cls._Clip(uGrid, spatialExtent, 
linearUnit, None, None, startDate, endDate)
                    seafloorUGrid = SeafloorGrid(clippedUGrid, 
(QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata()),), {u'Depth': 
20000.})
                    uSlices.extend(GridSliceCollection(seafloorUGrid, 
tQACoordType=u'center').QueryDatasets())

                    clippedVGrid = cls._Clip(vGrid, spatialExtent, 
linearUnit, None, None, startDate, endDate)
                    seafloorVGrid = SeafloorGrid(clippedVGrid, 
(QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata()),), {u'Depth': 
20000.})
                    vSlices.extend(GridSliceCollection(seafloorVGrid, 
tQACoordType=u'center').QueryDatasets())

                # Construct a list of
                # ShapefileFromVectorComponentGrids from the slices.

                from GeoEco.SpatialAnalysis.Lines import 
ShapefileFromVectorComponentGrids

                queryableAttributes = tuple(uGrid.GetAllQueryableAttributes() 
+ [QueryableAttribute(u'DateTime', _(u'Date'), DateTimeTypeMetadata()), 
QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata())])
                vectorShapefiles = []

                for i in range(len(uSlices)):
                    queryableAttributeValues = {}
                    for qa in queryableAttributes:
                        queryableAttributeValues[qa.Name] = 
uSlices[i].GetQueryableAttributeValue(qa.Name)

                    
vectorShapefiles.append(ShapefileFromVectorComponentGrids(uSlices[i], 
vSlices[i], scaleFactor, uniformLength, 
queryableAttributes=queryableAttributes, 
queryableAttributeValues=queryableAttributeValues))

                # Import the ShapefileFromVectorComponentGrids into
                # the output workspace.

                from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, 
ArcGISTable

                workspace = ArcGISWorkspace(outputWorkspace, ArcGISTable, 
pathCreationExpressions=featureClassNameExpressions, cacheTree=True, 
queryableAttributes=queryableAttributes)
                workspace.ImportDatasets(vectorShapefiles, mode)

                # Return successfully.
                
                return outputWorkspace

            finally:
                vGrid.Close()
        finally:
            uGrid.Close()

    @classmethod
    def InterpolateAtArcGISPoints(cls, variableNames,
                                  points, valueFields, tField, zField=None, 
zValue=None, method=u'Nearest', where=None, noDataValue=None,
                                  timeout=600, maxRetryTime=None, 
cacheDirectory=None,
                                  orderByFields=None, 
numBlocksToCacheInMemory=128, xBlockSize=16, yBlockSize=16, zBlockSize=3, 
tBlockSize=3):
        cls.__doc__.Obj.ValidateMethodInvocation()
        grids = [HYCOMGOMl0044D(variableName, timeout=timeout, 
maxRetryTime=maxRetryTime, cacheDirectory=cacheDirectory) for variableName in 
variableNames]
        try:
            if orderByFields is not None:
                orderBy = u', '.join(map(lambda f: f + u' ASC', 
orderByFields))
            else:
                from GeoEco.ArcGIS import GeoprocessorManager
                if GeoprocessorManager.GetArcGISMajorVersion() > 9 or 
GeoprocessorManager.GetArcGISMinorVersion() >= 2:
                    orderBy = tField + u' ASC'
                    if zField is not None:
                        orderBy = orderBy + ', ' + zField + ' ASC'
                else:
                    orderBy = None
            cls._LogWarning(_(u'The HYCOM OPeNDAP server often requires five 
to ten minutes to return the data required to process the first point. Please 
be patient. After the first one is processed, the rest will go much faster. 
Because the first one takes so long, the first status report may estimate an 
absurdly long time to completion. Please wait for the second status report, 
issued five minutes after the first one, for a better estimate. This tool 
cannot be cancelled until the first point is processed. If this tool fails 
with to a timeout error, increase the timeout value and try again.'))
            from GeoEco.Datasets.ArcGIS import ArcGISTable
            from GeoEco.SpatialAnalysis.Interpolation import Interpolator
            Interpolator.InterpolateGridsValuesForTableOfPoints(grids, 
ArcGISTable(points), valueFields, zField=zField, tField=tField, 
zValue=zValue, where=where, orderBy=orderBy, method=method, 
noDataValue=noDataValue, useAbsZ=True, seafloorZValue=20000., 
numBlocksToCacheInMemory=numBlocksToCacheInMemory, xBlockSize=xBlockSize, 
yBlockSize=yBlockSize, zBlockSize=zBlockSize, tBlockSize=tBlockSize)
        finally:
            for grid in grids:
                grid.Close()
        return points

    @classmethod
    def CreateCayulaCornillonFrontsAsArcGISRasters(cls, variableName, 
minPopMeanDifference,
                                                   outputWorkspace, 
mode=u'add', rasterNameExpressions=['%(VariableName)s_fronts', '%%Y', 
'Depth_%(Depth)04.0fm', 
'%(VariableName)s_%%Y%%j_%(Depth)04.0fm_%(ImageType)s.img'],
                                                   medianFilterWindowSize=3, 
histogramWindowSize=20, histogramWindowStride=1, minPropNonMaskedCells=0.65, 
minPopProp=0.25, minTheta=0.76, minSinglePopCohesion=0.88, 
minGlobalPopCohesion=0.90, threads=1,
                                                   fillHoles=20, thin=True, 
minSize=10,
                                                   spatialExtent=None, 
linearUnit=u'Degrees', minDepth=None, maxDepth=None, startDate=None, 
endDate=None, 
                                                   timeout=600, 
maxRetryTime=None, cacheDirectory=None,
                                                   calculateStatistics=True, 
buildRAT=False, buildPyramids=False,
                                                   
outputCandidateCounts=False, outputFrontCounts=False, 
outputWindowStatusCodes=False, outputWindowStatusValues=False):
        cls.__doc__.Obj.ValidateMethodInvocation()

        # Construct a HYCOMGOMl0044D instance and rotate and clip it
        # as requested.

        if startDate is not None:
            startYear = startDate.year
        else:
            startYear = None
        if endDate is not None:
            endYear = endDate.year
        else:
            endYear = None

        grid = HYCOMGOMl0044D(variableName, startYear=startYear, 
endYear=endYear, timeout=timeout, maxRetryTime=maxRetryTime, 
cacheDirectory=cacheDirectory)
        
        try:
            cls._LogWarning(_(u'The HYCOM OPeNDAP server often requires five 
to ten minutes to return the data required to create the first raster. Please 
be patient. After the first one is created, the rest will go much faster. 
Because the first raster takes so long, the first status report may estimate 
an absurdly long time to completion. Please wait for the second status 
report, issued five minutes after the first one, for a better estimate. This 
tool cannot be cancelled until the first raster is created. If this tool 
fails with to a timeout error, increase the timeout value and try again.'))
            grid = cls._Clip(grid, spatialExtent, linearUnit, minDepth, 
maxDepth, startDate, endDate)

            # Construct a CayulaCornillonFrontsInGrid collection using
            # the requested parameters.

            from GeoEco.OceanographicAnalysis.Fronts import 
CayulaCornillonFrontsInGrid
            import numpy

            collection = CayulaCornillonFrontsInGrid(grid,
                                                     tQACoordType=u'center',
                                                     zQACoordType=u'center',
                                                     unscalingFunction=lambda 
a: numpy.cast['int16'](a * 100),
                                                     
newScaledNoDataValue=-99.,
                                                     
medianFilterWindowSize=medianFilterWindowSize,
                                                     
histogramWindowSize=histogramWindowSize,
                                                     
histogramWindowStride=histogramWindowStride,
                                                     
minPropNonMaskedCells=minPropNonMaskedCells,
                                                     minPopProp=minPopProp,
                                                     
minPopMeanDifference=minPopMeanDifference,
                                                     minTheta=minTheta,
                                                     
minSinglePopCohesion=minSinglePopCohesion,
                                                     
minGlobalPopCohesion=minGlobalPopCohesion,
                                                     threads=threads,
                                                     fillHoles=fillHoles,
                                                     thin=thin,
                                                     minSize=minSize)
            try:
                try:
                    # Construct an ArcGISWorkspace instance and import
                    # time/depth slices from the
                    # CayulaCornillonFrontsInGrid instance.

                    expression = "ImageType = 'floc'"
                    if outputCandidateCounts:
                        expression += " OR ImageType = 'ccnt'"
                    if outputFrontCounts:
                        expression += " OR ImageType = 'fcnt'"
                    if outputWindowStatusCodes:
                        expression += " OR ImageType = 'wsco'"
                    if outputWindowStatusValues:
                        expression += " OR ImageType = 'wsvl'"

                    from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, 
ArcGISRaster

                    workspace = ArcGISWorkspace(outputWorkspace, 
ArcGISRaster, pathCreationExpressions=rasterNameExpressions, cacheTree=True, 
queryableAttributes=tuple(collection.GetAllQueryableAttributes()))
                    
workspace.ImportDatasets(collection.QueryDatasets(expression), mode, 
calculateStatistics=calculateStatistics, buildRAT=buildRAT, 
buildPyramids=buildPyramids)

                # If we caught an exception, log it now. Then delete
                # the collection object, to ensure its memory is
                # freed. Normally we don't bother doing this but the
                # memory it holds can be substantial.
                
                except:
                    from GeoEco.Logging import Logger
                    Logger.LogExceptionAsError()
            finally:
                del collection
        finally:
            grid.Close()

        # Return successfully.

        return outputWorkspace


class _HYCOMGridGLBa0083D(OPeNDAPGrid):
    __doc__ = DynamicDocString()

    def __init__(self, variableName, timeout, maxRetryTime, cacheDirectory):
        self._CachedTCenterCoords = None
        super(_HYCOMGridGLBa0083D, 
self).__init__(OPeNDAPURL('http://tds.hycom.org/thredds/dodsC/glb_analysis', 
timeout=timeout, maxRetryTime=maxRetryTime, cacheDirectory=cacheDirectory),
                                                    variableName,
                                                    'Grid',
                                                    
lazyPropertyValues={'SpatialReference': None,
                                                                        
'Dimensions': 'tyx',
                                                                        
'CoordDependencies': (None, None, None),
                                                                        
'CoordIncrements': (None, 1., 1.),      # t increment is None because, sadly, 
HYCOM omits slices when their system occasionally fails to generate data for 
a day
                                                                        
'TCornerCoordType': 'center',
                                                                        
'PhysicalDimensions': 'tyx',
                                                                        
'PhysicalDimensionsFlipped': (False, False, False),
                                                                        
'UnscaledDataType': 'float32',
                                                                        
'UnscaledNoDataValue': 1.2676506002282294e+030,
                                                                        
'ScalingFunction': None})
        
    def _GetLazyPropertyPhysicalValue(self, name):
        if name == 'CornerCoords':
            return (self._GetCoords('t', 0, [0], [0], 0.), 0., 0.)
        return super(_HYCOMGridGLBa0083D, 
self)._GetLazyPropertyPhysicalValue(name)

    def _GetCoords(self, coord, coordNum, slices, sliceDims, 
fixedIncrementOffset):
        if coord != 't':
            raise RuntimeError(_('_HYCOMGridGLBa0083D._GetCoords() called 
with coord == \'%(coord)s\'. This should never happen. Please contact the 
author of this tool for assistance.') % {u'coord': coord})
        if self._CachedTCenterCoords is None:
            import numpy
            self.ParentCollection._Open()
            self._CachedTCenterCoords = numpy.array(map(lambda days: 
datetime.timedelta(days) + datetime.datetime(1900, 12, 31), 
list(self.ParentCollection._PydapDataset['MT'][:])), dtype='object')
        if slices is None:
            result = self._CachedTCenterCoords.copy()
        else:
            result = self._CachedTCenterCoords.__getitem__(*slices)
        if fixedIncrementOffset != 0:
            result += datetime.timedelta(fixedIncrementOffset)
        return result

    @classmethod
    def GetSpatialReferenceParametersForHYCOMGlobalGrid(cls, url):

        # Open the URL with pydap.

        import pydap.client
        dataset = pydap.client.open_url(url)

        # Read the Latitude grid. I was told by Alan Wallcraft that
        # the grid coordinates are only accurate to four decimal
        # digits (Fortran REAL*4 precision). Round the coordinates to
        # four digits. Do the calculations with 64-bit floats; for
        # some reason, the numpy round function did not seem to work
        # very well with the 32-bit floats that HYCOM uses.

        import numpy
        lats = 
numpy.cast['float64'](dataset['Latitude']['Latitude'][:]).round(4)

        # Calculate the cell size. Alan Wallcraft said that the
        # Mercator portion of HYCOM's hybrid grid is based on a sphere
        # with radius 6371001.0 meters.
        #
        # This calculation assumes that the grid is global.

        equatorialCellWidthInDegrees = 360. / lats.shape[1]
        osr = cls._osr()
        transformer = 
osr.CoordinateTransformation(Dataset.ConvertSpatialReference('proj4', 
'+proj=latlong +R=6371001 +no_defs', 'obj'), 
Dataset.ConvertSpatialReference('proj4', '+proj=merc +R=6371001 +no_defs', 
'obj'))
        cellSize = transformer.TransformPoint(equatorialCellWidthInDegrees, 
0.)[0]

        # The HYCOM grid is not centered on 0 longitude. The left-most
        # edge is typically around 74 E. Determine the central
        # meridian. Keep in mind that the HYCOM grid coordinates are
        # for the centers of the cells, not the corners.
        #
        # This calculation assumes that one of the rows of the
        # Mercator section of the grid occurs at 0 latitude.

        indexOfZeroLat = lats[:,0].tolist().index(0.)
        centralMeridian = -180.0 + 
numpy.cast['float64'](dataset['Longitude']['Longitude'][indexOfZeroLat, 
0]).round(4) - equatorialCellWidthInDegrees/2

        # Find the y index of the start of the Mercator section of the
        # grid. Southward of this section is a section in which the
        # latitude increases by a constant value, typically 0.032
        # degrees. Find where this section stops by looking for the y
        # index at which latitude stops increasing by a constant
        # value.

        hasConstantIncrement = (abs(lats[1:indexOfZeroLat, 0] - 
lats[0:indexOfZeroLat-1, 0] - (lats[1, 0] - lats[0, 0])) < 0.00001).tolist()
        hasConstantIncrement.reverse()
        mercatorSliceStart = len(hasConstantIncrement) - 
hasConstantIncrement.index(True)
        
        # Find the y index of the end of the Mercator section. For the
        # Mercator section, each row has the same latitude values for
        # all cells of that row. Above the Mercator section is a
        # "bi-polar" section, which does not have this characteristic.
        # Therefore, we look for the north-most row that has the same
        # latitude for every cell.

        mercatorSliceStop = (lats[:,:-1] == 
lats[:,1:]).all(1).tolist().index(False)

        # Calculate the corner coordinates [x, y]. These are cell
        # centers.

        transformer = 
osr.CoordinateTransformation(Dataset.ConvertSpatialReference('proj4', 
'+proj=latlong +R=6371001 +no_defs', 'obj'), 
Dataset.ConvertSpatialReference('proj4', '+proj=merc +R=6371001 +lon_0=%s 
+no_defs' % str(centralMeridian), 'obj'))
        cornerCoords = transformer.TransformPoint(-360. + 
numpy.cast['float64'](dataset['Longitude']['Longitude'][indexOfZeroLat, 
0]).round(4), lats[mercatorSliceStart, 0])[:2]

        # Return the parameters we calculated.

        return lats.shape, cellSize, centralMeridian, mercatorSliceStart, 
mercatorSliceStop, (cornerCoords[1], cornerCoords[0])

    @classmethod
    def _CreateNorthPacificLookupGrid(cls, url):
        return cls._CreateLookupGrid(url, 698, 2074, 2684)      # Corresponds 
to longitude range 130 E - 120 W.

    @classmethod
    def _CreateNorthAtlanticLookupGrid(cls, url):
        return cls._CreateLookupGrid(url, 2698, 3949, 2657)     # Corresponds 
to longitude range 70 W - 30 E.

    @classmethod
    def _CreateLookupGrid(cls, url, xStart, xStop, yStop):

        # Get arrays that give the Mercator coordinates of the centers
        # of the cells of the extended region of the grid.

        import numpy
        
        normalGrid = HYCOMGLBa008Equatorial3D('ssh', extendYExtent=False)
        extendedGrid = HYCOMGLBa008Equatorial3D('ssh', extendYExtent=True)
        numExtendedCells = extendedGrid.Shape[1] - normalGrid.Shape[1]
        
        mercatorXCellCenters = numpy.tile(extendedGrid.CenterCoords['x', 
xStart:xStop], numExtendedCells).reshape(numExtendedCells, xStop - xStart)
        mercatorYCellCenters = numpy.tile(extendedGrid.CenterCoords['y', 
normalGrid.Shape[1]:extendedGrid.Shape[1]], xStop - 
xStart).reshape(numExtendedCells, xStop - xStart)

        # Project the Mercator coordinates back to geographic.

        osr = cls._osr()
        transformer = 
osr.CoordinateTransformation(Dataset.ConvertSpatialReference('proj4', 
'+proj=merc +R=6371001 +lon_0=-105.88 +no_defs', 'obj'), 
Dataset.ConvertSpatialReference('proj4', '+proj=latlong +R=6371001 +no_defs', 
'obj'))

        geographicXCellCenters = 
numpy.tile(numpy.array([transformer.TransformPoint(x, 0.)[0] for x in 
extendedGrid.CenterCoords['x', xStart:xStop]]), 
numExtendedCells).reshape(numExtendedCells, xStop - xStart)
        geographicYCellCenters = 
numpy.tile(numpy.array([transformer.TransformPoint(0., y)[1] for y in 
extendedGrid.CenterCoords['y', normalGrid.Shape[1]:extendedGrid.Shape[1]]]), 
xStop - xStart).reshape(xStop - xStart, numExtendedCells).transpose()

        geographicXCellCenters[geographicXCellCenters < 73] += 360.

        # Open the URL with pydap.

        import pydap.client
        dataset = pydap.client.open_url(url)

        # Get the HYCOM latitude and longitude grids for the bi-polar
        # region.

        lats = 
numpy.cast['float64'](dataset['Latitude']['Latitude'][2172:yStop, 
xStart:xStop]).round(4)
        lons = 
numpy.cast['float64'](dataset['Longitude']['Longitude'][2172:yStop, 
xStart:xStop]).round(4)

        # For each cell of the extended region (indices i,j), find the
        # indices of the bi-polor cell (indices m,n) that is the
        # closest in euclidean geographic coordinate distance.

        yIndices = numpy.zeros(geographicYCellCenters.shape, 'int16')
        xIndices = numpy.zeros(geographicXCellCenters.shape, 'int16')
        distances = numpy.zeros(geographicXCellCenters.shape)

        for i in range(geographicYCellCenters.shape[0]):
            m = yIndices[max(0, i-1), 0]
            n = 0

            for j in range(geographicXCellCenters.shape[1]):
                yCellCenter = geographicYCellCenters[i,j]
                xCellCenter = geographicXCellCenters[i,j]
                currentDist = ((yCellCenter - lats[m,n])**2 + (xCellCenter - 
lons[m,n])**2)**0.5

                while True:
                    if n < lons.shape[1] - 1:
                        dist = ((yCellCenter - lats[m,n+1])**2 + (xCellCenter 
- lons[m,n+1])**2)**0.5
                        if dist < currentDist:
                            n += 1
                            currentDist = dist
                            continue

                    if n > 0:
                        dist = ((yCellCenter - lats[m,n-1])**2 + (xCellCenter 
- lons[m,n-1])**2)**0.5
                        if dist < currentDist:
                            n -= 1
                            currentDist = dist
                            continue

                    if m < lats.shape[0] - 1:
                        dist = ((yCellCenter - lats[m+1,n])**2 + (xCellCenter 
- lons[m+1,n])**2)**0.5
                        if dist < currentDist:
                            m += 1
                            currentDist = dist
                            continue

                    if m > 0:
                        dist = ((yCellCenter - lats[m-1,n])**2 + (xCellCenter 
- lons[m-1,n])**2)**0.5
                        if dist < currentDist:
                            m -= 1
                            currentDist = dist
                            continue

                    break

                yIndices[i,j] = m
                xIndices[i,j] = n
                distances[i,j] = currentDist

        # Return the indices of the closest bi-polar cells. These will
        # be used with the numpy take() function to efficiently
        # implement nearest neighbor interpolation from the bi-polar
        # grid to the Mercator grid. (Also return the distances from
        # each Mercator cell to the nearest bi-polar cell. This array
        # is only used for diagnostic purposes.)

        return yIndices, xIndices, distances

    @classmethod
    def _ReadNumpyArrayForDataset(cls, dataset, sliceList):

        # This is a utility function called by
        # HYCOMGLBa008Equatorial3D._ReadNumpyArray and
        # HYCOMGLBa008Equatorial4D._ReadNumpyArray. Because the logic
        # is so similar for both functions, I wanted to centralize it
        # in one place.

        # Open the raw data grid, if needed.

        datasetIs4D = u'z' in dataset.Dimensions

        if dataset._OpenGrid is None:
            from GeoEco.Datasets.Virtual import ClippedGrid
            if datasetIs4D:
                dataset._OpenGrid = 
ClippedGrid(_HYCOMGridGLBa0084D(dataset._VariableName, dataset._Timeout, 
dataset._MaxRetryTime, dataset._CacheDirectory), u'Cell indices', yMin=390)
            else:
                dataset._OpenGrid = 
ClippedGrid(_HYCOMGridGLBa0083D(dataset._VariableName, dataset._Timeout, 
dataset._MaxRetryTime, dataset._CacheDirectory), u'Cell indices', yMin=390)

        # For many OPeNDAP datasets, we would be able to request the
        # entire slab directly. This won't work for the HYCOM GLBa0.08
        # dataset for two reasons. First, HYCOM omits slices when
        # their system occasionally fails to generate data for a day,
        # so most years do not have a full 365 (or 366) slices. To
        # deal with this, we have to loop over the requested range of
        # time indices and issue OPeNDAP requests for the proper time
        # indices.\
        #
        # Second, we allow the caller to extend the Mercator grid up
        # beyond the 47 N limit of HYCOM's Mercator region, by
        # interpolating values from HYCOM's bi-polar region. To do
        # that, we have to read data from the bi-polar region using
        # indices that do not match what the caller provides.
        #
        # Start by allocating the array we will return. We'll populate
        # this as we go along. (I prefer this approach rather than
        # growing an array through concatenation because it avoids
        # repeatedly allocating and copying memory.)

        import numpy
        if datasetIs4D:
            result = numpy.zeros((sliceList[0].stop - sliceList[0].start, 
sliceList[1].stop - sliceList[1].start, sliceList[2].stop - 
sliceList[2].start, sliceList[3].stop - sliceList[3].start), 
dtype=str(dataset.UnscaledDataType))
        else:
            result = numpy.zeros((sliceList[0].stop - sliceList[0].start, 
sliceList[1].stop - sliceList[1].start, sliceList[2].stop - 
sliceList[2].start), dtype=str(dataset.UnscaledDataType))

        # First populate portions of the array that are in the HYCOM
        # Mercator region. We can copy this data directly but must
        # loop over the requested t indices and handle missing time
        # slices by storing UnscaledNoDataValue when a time slice is
        # missing.

        tCoords = dataset.CenterCoords['t', sliceList[0]]
        gridTStart = 
bisect.bisect_left(dataset._OpenGrid.CenterCoords['t'].tolist(), tCoords[0])
        gridTStop = 
bisect.bisect_right(dataset._OpenGrid.CenterCoords['t'].tolist(), tCoords[-1])
        if gridTStop > gridTStart: 
            gridTCoords = dataset._OpenGrid.CenterCoords['t', 
gridTStart:gridTStop]
        else:
            gridTCoords = []

        if sliceList[-2].start < 2172-390:
            mercatorYSlice = slice(sliceList[-2].start, 
min(sliceList[-2].stop, 2172-390))
            ySliceToWrite = slice(mercatorYSlice.start - sliceList[-2].start, 
mercatorYSlice.stop - sliceList[-2].start)

            if gridTStop > gridTStart:
                if datasetIs4D:
                    data = 
dataset._OpenGrid.UnscaledData.__getitem__((slice(gridTStart, gridTStop), 
sliceList[1], mercatorYSlice, sliceList[-1]))
                else:
                    data = 
dataset._OpenGrid.UnscaledData.__getitem__((slice(gridTStart, gridTStop), 
mercatorYSlice, sliceList[-1]))
                
            i = 0
            j = 0
            while i < len(tCoords):
                if j < len(gridTCoords) and gridTCoords[j] == tCoords[i]:
                    if datasetIs4D:
                        result[i, :, ySliceToWrite] = data[j]
                    else:
                        result[i, ySliceToWrite] = data[j]
                    j += 1
                else:
                    if datasetIs4D:
                        result[i, :, ySliceToWrite] = 
dataset.UnscaledNoDataValue
                    else:
                        result[i, ySliceToWrite] = dataset.UnscaledNoDataValue
                i += 1

        # Now populate portions of the array that must be interpolated
        # from the HYCOM bi-polar region.

        if sliceList[-2].stop > 2172-390:
            extendedYSlice = slice(max(sliceList[-2].start, 2172-390), 
sliceList[-2].stop)
            ySliceToWrite = slice(extendedYSlice.start - sliceList[-2].start, 
extendedYSlice.stop - sliceList[-2].start)

            # First populate the entire interpolated region with the
            # UnscaledNoDataValue.

            if datasetIs4D:
                result[:, :, ySliceToWrite, :] = dataset.UnscaledNoDataValue
            else:
                result[:, ySliceToWrite, :] = dataset.UnscaledNoDataValue

            # Handle values in the north Pacific, which is defined as
            # the region between 130 E and 120 W. These values
            # correspond to x indices 698 through 2074 in the Mercator
            # region.

            cls._InterpolateExtendedRegion(dataset, sliceList, datasetIs4D, 
result, tCoords, gridTCoords, gridTStart, gridTStop, extendedYSlice, 
ySliceToWrite, 698, 2074, '_PacificLookupGrids', 'HYCOM_Glb008_y1.bin', 
'HYCOM_Glb008_x1.bin', (276, 1376))

            # Handle values in the north Atlantic, which is defined as
            # the region between 70 W and 30 E. These values
            # correspond to x indices 2698 through 3949 in the
            # Mercator region.

            cls._InterpolateExtendedRegion(dataset, sliceList, datasetIs4D, 
result, tCoords, gridTCoords, gridTStart, gridTStop, extendedYSlice, 
ySliceToWrite, 2698, 3949, '_AtlanticLookupGrids', 'HYCOM_Glb008_y2.bin', 
'HYCOM_Glb008_x2.bin', (276, 1251))

        # Return successfully.

        return result, dataset.UnscaledNoDataValue

    @classmethod
    def _InterpolateExtendedRegion(cls, dataset, sliceList, datasetIs4D, 
result, tCoords, gridTCoords, gridTStart, gridTStop, extendedYSlice, 
ySliceToWrite, xStart, xStop, lookupAttrName, xLookupFile, yLookupFile, 
lookupArrayShape):

        if sliceList[-1].start < xStop and sliceList[-1].stop >= xStart:
            extendedXSlice = slice(max(sliceList[-1].start, xStart), 
min(sliceList[-1].stop, xStop))
            xSliceToWrite = slice(extendedXSlice.start - sliceList[-1].start, 
extendedXSlice.stop - sliceList[-1].start)

            # Load the precomputed grids that allow us to look up the
            # indices of the nearest bi-polar cell, given the indices
            # of a mercator cell in the extended region.

            import numpy

            if getattr(dataset, lookupAttrName) is None:
                setattr(dataset, lookupAttrName, 
(numpy.fromfile(os.path.join(os.path.dirname(__file__), xLookupFile), 
'int16').reshape(lookupArrayShape),
                                                  
numpy.fromfile(os.path.join(os.path.dirname(__file__), yLookupFile), 
'int16').reshape(lookupArrayShape)))

            # Compute the slices of the bi-polar grid to download.

            yLookup = numpy.cast['int32'](getattr(dataset, 
lookupAttrName)[0][extendedYSlice.start-(2172-390):extendedYSlice.stop-(2172-390),
 extendedXSlice.start-xStart:extendedXSlice.stop-xStart])
            xLookup = numpy.cast['int32'](getattr(dataset, 
lookupAttrName)[1][extendedYSlice.start-(2172-390):extendedYSlice.stop-(2172-390),
 extendedXSlice.start-xStart:extendedXSlice.stop-xStart])

            bipolarYStart = yLookup.min()
            bipolarYStop = yLookup.max() + 1
            bipolarXStart = xLookup.min()
            bipolarXStop = xLookup.max() + 1

            dataset._LogDebug(_(u'%(class)s 0x%(id)08X: Interpolating 
Mercator region [%(yStart)i:%(yStop)i, %(xStart)i:%(xStop)i] from bi-polar 
region [%(byStart)i:%(byStop)i, %(bxStart)i:%(bxStop)i] of raw HYCOM grid.'), 
{u'class': dataset.__class__.__name__, u'id': id(dataset), u'yStart': 
extendedYSlice.start, u'yStop': extendedYSlice.stop, u'xStart': 
extendedXSlice.start, u'xStop': extendedXSlice.stop, u'byStart': 
bipolarYStart+2172, u'byStop': bipolarYStop+2172, u'bxStart': 
bipolarXStart+xStart, u'bxStop': bipolarXStop+xStart})

            indicesToTake = (yLookup - bipolarYStart) * (bipolarXStop - 
bipolarXStart)  + (xLookup - bipolarXStart)

            # Download the data.

            if gridTStop > gridTStart:
                if datasetIs4D:
                    data = 
dataset._OpenGrid.UnscaledData.__getitem__((slice(gridTStart, gridTStop), 
sliceList[1], slice(int(bipolarYStart + (2172-390)), int(bipolarYStop + 
(2172-390))), slice(int(bipolarXStart + xStart), int(bipolarXStop + xStart))))
                else:
                    data = 
dataset._OpenGrid.UnscaledData.__getitem__((slice(gridTStart, gridTStop), 
slice(int(bipolarYStart + (2172-390)), int(bipolarYStop + (2172-390))), 
slice(int(bipolarXStart + xStart), int(bipolarXStop + xStart))))

            # Populate the array to return using nearest neighbor
            # interpolation.

            i = 0
            j = 0
            while i < len(tCoords):
                if j < len(gridTCoords) and gridTCoords[j] == tCoords[i]:
                    if datasetIs4D:
                        for k in range(0, sliceList[1].stop - 
sliceList[1].start):
                            result[i, k, ySliceToWrite, xSliceToWrite] = 
numpy.take(data[i, k], indicesToTake)
                    else:
                        result[i, ySliceToWrite, xSliceToWrite] = 
numpy.take(data[i], indicesToTake)
                    j += 1
                i += 1



class HYCOMGLBa008Equatorial3D(Grid):
    __doc__ = DynamicDocString()

    def _GetVariableName(self):
        return self._VariableName

    VariableName = property(_GetVariableName, doc=DynamicDocString())

    def __init__(self, variableName, extendYExtent=False, timeout=60, 
maxRetryTime=120, cacheDirectory=None):
        self.__doc__.Obj.ValidateMethodInvocation()

        # Initialize our properties.

        self._VariableName = variableName
        self._Timeout = timeout
        self._MaxRetryTime = maxRetryTime
        self._CacheDirectory = cacheDirectory
        self._DisplayName = _(u'%(name)s grid of the equatorial region of the 
HYCOM + NCODA Global 1/12 degree Analysis (GLBa0.08)') % {u'name': 
variableName}
        self._OpenGrid = None
        self._PacificLookupGrids = None
        self._AtlanticLookupGrids = None

        # If we're not extending the Y extent, set the maximum Y index
        # to the top of the HYCOM Mercator region, about 47 N. If we
        # are extending it, set the maximum Y index to 60 N.

        self._YMaxIndex = {False: 2172-390, True: 2448-390}[extendYExtent]

        # Initialize the base class.

        super(HYCOMGLBa008Equatorial3D, 
self).__init__(queryableAttributes=(QueryableAttribute(u'VariableName', 
_(u'HYCOM variable'), UnicodeStringTypeMetadata(allowedValues=[u'emp', 
u'mld', u'mlp', u'qtot', u'ssh', u'surface_salinity_trend', 
u'surface_temperature_trend'], makeLowercase=True)),),
                                                       
queryableAttributeValues={u'VariableName': variableName},
                                                       
lazyPropertyValues={'SpatialReference': 
Dataset.ConvertSpatialReference('proj4', '+proj=merc +R=6371001 
+lon_0=-105.88 +no_defs', 'obj'),         # lon_0 and other georeferencing 
parameters were calculated by 
_HYCOMGridGLBa0083D.GetSpatialReferenceParametersForHYCOMGlobalGrid()
                                                                           
'Dimensions': u'tyx',
                                                                           
'CoordDependencies': (None, None, None),
                                                                           
'CoordIncrements': (1.0, 8895.5955278281017, 8895.5955278281017),
                                                                           
'TIncrementUnit': u'day',
                                                                           
'TSemiRegularity': None,
                                                                           
'TCountPerSemiRegularPeriod': None,
                                                                           
'TCornerCoordType': u'center',
                                                                           
'CornerCoords': (datetime.datetime(2003, 11, 3), -9909647.065054208, 
-20010642.139849316),
                                                                           
'PhysicalDimensions': u'tyx',
                                                                           
'PhysicalDimensionsFlipped': (False, False, False),
                                                                           
'UnscaledDataType': u'float32',
                                                                           
'UnscaledNoDataValue': 1.2676506002282294e+030,
                                                                           
'ScalingFunction': None})

    def _Close(self):
        if hasattr(self, '_OpenGrid') and self._OpenGrid is not None:
            self._OpenGrid.Close()
            self._OpenGrid = None
        super(HYCOMGLBa008Equatorial3D, self)._Close()

    def _GetDisplayName(self):
        return self._DisplayName
        
    def _GetLazyPropertyPhysicalValue(self, name):
        if name == 'Shape':
            if self._OpenGrid is None:
                from GeoEco.Datasets.Virtual import ClippedGrid
                self._OpenGrid = 
ClippedGrid(_HYCOMGridGLBa0083D(self._VariableName, self._Timeout, 
self._MaxRetryTime, self._CacheDirectory), u'Cell indices', yMin=390)
            return ((self._OpenGrid.CenterCoords['t', -1] - 
self.GetLazyPropertyValue('CornerCoords')[0]).days + 1, self._YMaxIndex, 4500)
        return None

    def _ReadNumpyArray(self, sliceList):
        return _HYCOMGridGLBa0083D._ReadNumpyArrayForDataset(self, sliceList)

    @classmethod
    def CreateArcGISRasters(cls, variableName,
                            outputWorkspace, mode=u'add', 
rasterNameExpressions=['%(VariableName)s', '%%Y', 
'%(VariableName)s_%%Y%%j.img'], rasterCatalog=None,
                            rotationOffset=None, extendYExtent=False, 
spatialExtent=None, linearUnit=u'Degrees', startDate=None, endDate=None,
                            timeout=60, maxRetryTime=120, cacheDirectory=None,
                            calculateStatistics=True, buildPyramids=False):
        cls.__doc__.Obj.ValidateMethodInvocation()
        grid = HYCOMGLBa008Equatorial3D(variableName, 
extendYExtent=extendYExtent, timeout=timeout, maxRetryTime=120, 
cacheDirectory=cacheDirectory)
        try:
            from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
            from GeoEco.Datasets.Virtual import GridSliceCollection
            grid = HYCOMGLBa008Equatorial4D._RotateAndClip(grid, 
rotationOffset, spatialExtent, linearUnit, startDate=startDate, 
endDate=endDate)
            workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, 
pathCreationExpressions=rasterNameExpressions, cacheTree=True, 
queryableAttributes=tuple(grid.GetAllQueryableAttributes() + 
[QueryableAttribute(u'DateTime', _(u'Date'), DateTimeTypeMetadata())]))
            workspace.ImportDatasets(GridSliceCollection(grid, 
tQACoordType=u'center').QueryDatasets(), mode, 
calculateStatistics=calculateStatistics, buildPyramids=buildPyramids)
            if rasterCatalog is not None:
                workspace.ToRasterCatalog(rasterCatalog, 
grid.GetSpatialReference(u'ArcGIS'), tQACoordType=u'center', 
tCoordFunction=lambda qav: [qav[u'DateTime'] - datetime.timedelta(0.5), 
qav[u'DateTime'], qav[u'DateTime'] + datetime.timedelta(0.5) - 
datetime.timedelta(seconds=1)], overwriteExisting=True)
        finally:
            grid.Close()
        return outputWorkspace

    @classmethod
    def CreateClimatologicalArcGISRasters(cls, variableName,
                                          statistic, binType,
                                          outputWorkspace, mode=u'add', 
rasterNameExpressions=[u'%(VariableName)s', 
u'%(ClimatologyBinType)s_Climatology', 
u'%(VariableName)s_%(ClimatologyBinName)s_%(Statistic)s.img'],
                                          binDuration=1, startDayOfYear=1,
                                          rotationOffset=None, 
extendYExtent=False, spatialExtent=None, linearUnit=u'Degrees', 
startDate=None, endDate=None,
                                          timeout=60, maxRetryTime=120, 
cacheDirectory=None,
                                          calculateStatistics=True, 
buildPyramids=False):
        cls.__doc__.Obj.ValidateMethodInvocation()
        grid = HYCOMGLBa008Equatorial3D(variableName, 
extendYExtent=extendYExtent, timeout=timeout, maxRetryTime=maxRetryTime, 
cacheDirectory=cacheDirectory)
        try:
            from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
            from GeoEco.Datasets.Virtual import ClimatologicalGridCollection
            grid = HYCOMGLBa008Equatorial4D._RotateAndClip(grid, 
rotationOffset, spatialExtent, linearUnit, startDate=startDate, 
endDate=endDate)
            collection = ClimatologicalGridCollection(grid, statistic, 
binType, binDuration, startDayOfYear, reportProgress=True)
            workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, 
pathCreationExpressions=rasterNameExpressions, cacheTree=True, 
queryableAttributes=tuple(collection.GetAllQueryableAttributes()))
            workspace.ImportDatasets(collection.QueryDatasets(), mode, 
calculateStatistics=calculateStatistics, buildPyramids=buildPyramids)
        finally:
            grid.Close()
        return outputWorkspace

    @classmethod
    def InterpolateAtArcGISPoints(cls, variableNames,
                                  points, valueFields, tField, 
method=u'Nearest', extendYExtent=False, where=None, noDataValue=None,
                                  timeout=60, maxRetryTime=120, 
cacheDirectory=None,
                                  orderByFields=None, 
numBlocksToCacheInMemory=128, xBlockSize=16, yBlockSize=16, tBlockSize=3):
        cls.__doc__.Obj.ValidateMethodInvocation()
        grids = [HYCOMGLBa008Equatorial3D(variableName, 
extendYExtent=extendYExtent, timeout=timeout, maxRetryTime=maxRetryTime, 
cacheDirectory=cacheDirectory) for variableName in variableNames]
        try:
            if orderByFields is not None:
                orderBy = u', '.join(map(lambda f: f + u' ASC', 
orderByFields))
            else:
                from GeoEco.ArcGIS import GeoprocessorManager
                if GeoprocessorManager.GetArcGISMajorVersion() > 9 or 
GeoprocessorManager.GetArcGISMinorVersion() >= 2:
                    orderBy = tField + u' ASC'
                else:
                    orderBy = None
            from GeoEco.Datasets.ArcGIS import ArcGISTable
            from GeoEco.SpatialAnalysis.Interpolation import Interpolator
            Interpolator.InterpolateGridsValuesForTableOfPoints(grids, 
ArcGISTable(points), valueFields, tField=tField, where=where, 
orderBy=orderBy, method=method, noDataValue=noDataValue, gridsWrap=True, 
numBlocksToCacheInMemory=numBlocksToCacheInMemory, xBlockSize=xBlockSize, 
yBlockSize=yBlockSize, tBlockSize=tBlockSize)
        finally:
            for grid in grids:
                grid.Close()
        return points


class _HYCOMGridGLBa0084D(OPeNDAPGrid):
    __doc__ = DynamicDocString()

    def __init__(self, variableName, timeout, maxRetryTime, cacheDirectory):
        self._CachedTCenterCoords = None
        super(_HYCOMGridGLBa0084D, 
self).__init__(OPeNDAPURL('http://tds.hycom.org/thredds/dodsC/glb_analysis', 
timeout=timeout, maxRetryTime=maxRetryTime, cacheDirectory=cacheDirectory),
                                                    variableName,
                                                    'Grid',
                                                    
lazyPropertyValues={'SpatialReference': None,
                                                                        
'Dimensions': 'tzyx',
                                                                        
'CoordDependencies': (None, None, None, None),
                                                                        
'CoordIncrements': (None, None, 1., 1.),      # t increment is None because, 
sadly, HYCOM omits slices when their system occasionally fails to generate 
data for a day
                                                                        
'TCornerCoordType': 'center',
                                                                        
'PhysicalDimensions': 'tzyx',
                                                                        
'PhysicalDimensionsFlipped': (False, False, False, False),
                                                                        
'UnscaledDataType': 'float32',
                                                                        
'UnscaledNoDataValue': 1.2676506002282294e+030,
                                                                        
'ScalingFunction': None})
        
    def _GetLazyPropertyPhysicalValue(self, name):
        if name == 'CornerCoords':
            return (self._GetCoords('t', 0, [0], [0], 0.), 0., 0., 0.)
        return super(_HYCOMGridGLBa0084D, 
self)._GetLazyPropertyPhysicalValue(name)

    def _GetCoords(self, coord, coordNum, slices, sliceDims, 
fixedIncrementOffset):
        if coord not in ['t', 'z']:
            raise RuntimeError(_('_HYCOMGridGLBa0084D._GetCoords() called 
with coord == \'%(coord)s\'. This should never happen. Please contact the 
author of this tool for assistance.') % {u'coord': coord})

        import numpy

        if coord == 't':
            if self._CachedTCenterCoords is None:
                self.ParentCollection._Open()
                self._CachedTCenterCoords = numpy.array(map(lambda days: 
datetime.timedelta(days) + datetime.datetime(1900, 12, 31), 
list(self.ParentCollection._PydapDataset['MT'][:])), dtype='object')
            if slices is None:
                result = self._CachedTCenterCoords.copy()
            else:
                result = self._CachedTCenterCoords.__getitem__(*slices)
            if fixedIncrementOffset != 0:
                result += datetime.timedelta(fixedIncrementOffset)
            return result

        zCoords = [0.0, 10.0, 20.0, 30.0, 50.0, 75.0, 100.0, 125.0, 150.0, 
200.0, 250.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0, 900.0, 1000.0, 
1100.0, 1200.0, 1300.0, 1400.0, 1500.0, 1750.0, 2000.0, 2500.0, 3000.0, 
3500.0, 4000.0, 4500.0, 5000.0, 5500.0]
        if fixedIncrementOffset == -0.5:
            zCoords = [0.0] + map(lambda a, b: (a+b)/2., zCoords[:-1], 
zCoords[1:])
        elif fixedIncrementOffset == 0.5:
            zCoords = map(lambda a, b: (a+b)/2., zCoords[:-1], zCoords[1:]) + 
[11000.0]
        if slices is None:
            return numpy.array(zCoords)
        return numpy.array(zCoords).__getitem__(*slices)


class HYCOMGLBa008Equatorial4D(Grid):
    __doc__ = DynamicDocString()

    def _GetVariableName(self):
        return self._VariableName

    VariableName = property(_GetVariableName, doc=DynamicDocString())

    def __init__(self, variableName, extendYExtent=False, timeout=60, 
maxRetryTime=120, cacheDirectory=None):
        self.__doc__.Obj.ValidateMethodInvocation()

        # Initialize our properties.

        self._VariableName = variableName
        self._Timeout = timeout
        self._MaxRetryTime = maxRetryTime
        self._CacheDirectory = cacheDirectory
        self._DisplayName = _(u'%(name)s grid of the equatorial region of the 
HYCOM + NCODA Global 1/12 degree Analysis (GLBa0.08)') % {u'name': 
variableName}
        self._OpenGrid = None
        self._PacificLookupGrids = None
        self._AtlanticLookupGrids = None

        # If we're not extending the Y extent, set the maximum Y index
        # to the top of the HYCOM Mercator region, about 47 N. If we
        # are extending it, set the maximum Y index to 60 N.

        self._YMaxIndex = {False: 2172-390, True: 2448-390}[extendYExtent]

        # Initialize the base class.

        super(HYCOMGLBa008Equatorial4D, 
self).__init__(queryableAttributes=(QueryableAttribute(u'VariableName', 
_(u'HYCOM variable'), UnicodeStringTypeMetadata(allowedValues=[u'salinity', 
u'temperature', u'u', u'v'], makeLowercase=True)),),
                                                       
queryableAttributeValues={u'VariableName': variableName},
                                                       
lazyPropertyValues={'SpatialReference': 
Dataset.ConvertSpatialReference('proj4', '+proj=merc +R=6371001 
+lon_0=-105.88 +no_defs', 'obj'),         # lon_0 and other georeferencing 
parameters were calculated by 
_HYCOMGridGLBa0083D.GetSpatialReferenceParametersForHYCOMGlobalGrid()
                                                                           
'Dimensions': u'tzyx',
                                                                           
'CoordDependencies': (None, None, None, None),
                                                                           
'CoordIncrements': (1.0, None, 8895.5955278281017, 8895.5955278281017),
                                                                           
'TIncrementUnit': u'day',
                                                                           
'TSemiRegularity': None,
                                                                           
'TCountPerSemiRegularPeriod': None,
                                                                           
'TCornerCoordType': u'center',
                                                                           
'CornerCoords': (datetime.datetime(2003, 11, 3), 0.0, -9909647.065054208, 
-20010642.139849316),
                                                                           
'PhysicalDimensions': u'tzyx',
                                                                           
'PhysicalDimensionsFlipped': (False, False, False, False),
                                                                           
'UnscaledDataType': u'float32',
                                                                           
'UnscaledNoDataValue': 1.2676506002282294e+030,
                                                                           
'ScalingFunction': None})

    def _Close(self):
        if hasattr(self, '_OpenGrid') and self._OpenGrid is not None:
            self._OpenGrid.Close()
            self._OpenGrid = None
        super(HYCOMGLBa008Equatorial4D, self)._Close()

    def _GetDisplayName(self):
        return self._DisplayName
        
    def _GetLazyPropertyPhysicalValue(self, name):
        if name == 'Shape':
            if self._OpenGrid is None:
                from GeoEco.Datasets.Virtual import ClippedGrid
                self._OpenGrid = 
ClippedGrid(_HYCOMGridGLBa0084D(self._VariableName, self._Timeout, 
self._MaxRetryTime, self._CacheDirectory), u'Cell indices', yMin=390)
            return ((self._OpenGrid.CenterCoords['t', -1] - 
self.GetLazyPropertyValue('CornerCoords')[0]).days + 1, 33, self._YMaxIndex, 
4500)
        return None

    def _GetCoords(self, coord, coordNum, slices, sliceDims, 
fixedIncrementOffset):
        if coord != 'z':
            raise RuntimeError(_('HYCOMGLBa008Equatorial4D._GetCoords() 
called with coord == \'%(coord)s\'. This should never happen. Please contact 
the author of this tool for assistance.') % {u'coord': coord})
        zCoords = [0.0, 10.0, 20.0, 30.0, 50.0, 75.0, 100.0, 125.0, 150.0, 
200.0, 250.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0, 900.0, 1000.0, 
1100.0, 1200.0, 1300.0, 1400.0, 1500.0, 1750.0, 2000.0, 2500.0, 3000.0, 
3500.0, 4000.0, 4500.0, 5000.0, 5500.0]
        if fixedIncrementOffset == -0.5:
            zCoords = [0.0] + map(lambda a, b: (a+b)/2., zCoords[:-1], 
zCoords[1:])
        elif fixedIncrementOffset == 0.5:
            zCoords = map(lambda a, b: (a+b)/2., zCoords[:-1], zCoords[1:]) + 
[11000.0]
        import numpy
        if slices is None:
            return numpy.array(zCoords)
        return numpy.array(zCoords).__getitem__(*slices)

    def _ReadNumpyArray(self, sliceList):
        return _HYCOMGridGLBa0083D._ReadNumpyArrayForDataset(self, sliceList) 
       # This function handles both 3D and 4D grids.

    @classmethod
    def _RotateAndClip(cls, grid, rotationOffset, spatialExtent, linearUnit, 
minDepth=None, maxDepth=None, startDate=None, endDate=None):
        from GeoEco.Datasets.Virtual import RotatedGlobalGrid, ClippedGrid
        
        # Rotate the grid, if requested.
        
        if rotationOffset is not None:
            if linearUnit == u'degrees':
                try:
                    sr = grid.GetSpatialReference('obj').Clone()
                    if not sr.IsGeographic():
                        srAtPrimeMeridian = sr.Clone()
                        srAtPrimeMeridian.SetNormProjParm('central_meridian', 
0.)
                        srGeographic = cls._osr().SpatialReference()
                        srGeographic.CopyGeogCSFrom(sr)
                        transformer = 
cls._osr().CoordinateTransformation(srGeographic, srAtPrimeMeridian)
                        rotationOffset = 
transformer.TransformPoint(rotationOffset, 0.)[0]
                except:
                    cls._gdal().ErrorReset()
                    raise

            grid = RotatedGlobalGrid(grid, rotationOffset, u'Map units')

        # Clip the grid, if requested.
        
        xMin, yMin, xMax, yMax = None, None, None, None
        if spatialExtent is not None:
            sr = grid.GetSpatialReference('obj')

            from GeoEco.Types import EnvelopeTypeMetadata
            xMin, yMin, xMax, yMax = 
EnvelopeTypeMetadata.ParseFromArcGISString(spatialExtent)

            if linearUnit == u'degrees':
                centralMeridian = sr.GetNormProjParm('central_meridian')
                xMinAllowed = -180. + centralMeridian
                xMaxAllowed = 180. + centralMeridian

                if str(xMin) == str(xMinAllowed):
                    xMin = xMinAllowed
                elif str(xMin) == str(xMaxAllowed):
                    xMin = xMaxAllowed
                if str(xMax) == str(xMinAllowed):
                    xMax = xMinAllowed
                elif str(xMax) == str(xMaxAllowed):
                    xMax = xMaxAllowed

                if xMin < xMinAllowed or xMin > xMaxAllowed:
                    if rotationOffset is not None:
                        raise ValueError(_(u'The X Minimum of the Spatial 
Extent parameter (%(value)g degrees) is not within the geographic extent of 
the rotated grid. After rotation, the geographic extent in the X direction is 
%(xMin)g to %(xMax)g degrees. Please specify an X Minimum in that range.') % 
{u'value': xMin, u'xMin': xMinAllowed, u'xMax': xMaxAllowed})
                    else:
                        raise ValueError(_(u'The X Minimum of the Spatial 
Extent parameter (%(value)g degrees) is not within the geographic extent of 
the grid. The geographic extent in the X direction is %(xMin)g to %(xMax)g 
degrees. Please specify an X Minimum in that range.') % {u'value': xMin, 
u'xMin': xMinAllowed, u'xMax': xMaxAllowed})
                if xMax < xMinAllowed or xMax > xMaxAllowed:
                    if rotationOffset is not None:
                        raise ValueError(_(u'The X Maximum of the Spatial 
Extent parameter (%(value)g degrees) is not within the geographic extent of 
the rotated grid. After rotation, the geographic extent in the X direction is 
%(xMin)g to %(xMax)g degrees. Please specify an X Minimum in that range.') % 
{u'value': xMax, u'xMin': xMinAllowed, u'xMax': xMaxAllowed})
                    else:
                        raise ValueError(_(u'The X Maximum of the Spatial 
Extent parameter (%(value)g degrees) is not within the geographic extent of 
the grid. The geographic extent in the X direction is %(xMin)g to %(xMax)g 
degrees. Please specify an X Minimum in that range.') % {u'value': xMax, 
u'xMin': xMinAllowed, u'xMax': xMaxAllowed})
                
                yMin = max(yMin, -85.0)
                yMax = min(yMax, 85.0)
                try:
                    transformer = 
cls._osr().CoordinateTransformation(Dataset.ConvertSpatialReference('proj4', 
'+proj=latlong +R=6371001 +no_defs', 'obj'), grid.GetSpatialReference('obj'))
                    xMin, yMin = transformer.TransformPoint(xMin, yMin)[:2]
                    xMax, yMax = transformer.TransformPoint(xMax, yMax)[:2]
                except:
                    cls._gdal().ErrorReset()
                    raise

        if spatialExtent is not None or minDepth is not None or maxDepth is 
not None or startDate is not None or endDate is not None:
            if startDate is not None:
                startDate = datetime.datetime(startDate.year, 
startDate.month, startDate.day, 0, 0, 0)
            if endDate is not None:
                endDate = datetime.datetime(endDate.year, endDate.month, 
endDate.day, 23, 59, 59)
                
            grid = ClippedGrid(grid, u'Map coordinates', xMin=xMin, 
xMax=xMax, yMin=yMin, yMax=yMax, zMin=minDepth, zMax=maxDepth, 
tMin=startDate, tMax=endDate)

        # Return the grid.

        return grid

    @classmethod
    def CreateArcGISRasters(cls, variableName,
                            outputWorkspace, mode=u'add', 
rasterNameExpressions=['%(VariableName)s', '%%Y', 'Depth_%(Depth)04.0fm', 
'%(VariableName)s_%%Y%%j_%(Depth)04.0fm.img'], rasterCatalog=None,
                            rotationOffset=None, extendYExtent=False, 
spatialExtent=None, linearUnit=u'Degrees', minDepth=None, maxDepth=None, 
startDate=None, endDate=None,
                            timeout=60, maxRetryTime=120, cacheDirectory=None,
                            calculateStatistics=True, buildPyramids=False):
        cls.__doc__.Obj.ValidateMethodInvocation()
        grid = HYCOMGLBa008Equatorial4D(variableName, 
extendYExtent=extendYExtent, timeout=timeout, maxRetryTime=maxRetryTime, 
cacheDirectory=cacheDirectory)
        try:
            from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
            from GeoEco.Datasets.Virtual import GridSliceCollection, 
SeafloorGrid

            # If the caller requested a minimum depth that is within
            # the range of the HYCOM layers, instantiate those grids.

            grids = []
            if minDepth is None or minDepth <= 5500.:
                clippedGrid = cls._RotateAndClip(grid, rotationOffset, 
spatialExtent, linearUnit, minDepth, maxDepth, startDate, endDate)
                grids.extend(GridSliceCollection(clippedGrid, 
tQACoordType=u'center', zQACoordType=u'center').QueryDatasets())

            # If the caller requested a maximum depth that is greater
            # than or equal to 20000., instantiate a grid representing
            # the values at the seafloor.

            if minDepth == 20000. or maxDepth >= 20000.:
                clippedGrid = cls._RotateAndClip(grid, rotationOffset, 
spatialExtent, linearUnit, None, None, startDate, endDate)
                seafloorGrid = SeafloorGrid(clippedGrid, 
(QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata()),), {u'Depth': 
20000.})
                grids.extend(GridSliceCollection(seafloorGrid, 
tQACoordType=u'center').QueryDatasets())

            # Create the rasters.
            
            workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, 
pathCreationExpressions=rasterNameExpressions, cacheTree=True, 
queryableAttributes=tuple(grid.GetAllQueryableAttributes() + 
[QueryableAttribute(u'DateTime', _(u'Date'), DateTimeTypeMetadata()), 
QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata())]))
            workspace.ImportDatasets(grids, mode, 
calculateStatistics=calculateStatistics, buildPyramids=buildPyramids)
            if rasterCatalog is not None:
                workspace.ToRasterCatalog(rasterCatalog, 
grids[0].GetSpatialReference(u'ArcGIS'), tQACoordType=u'center', 
tCoordFunction=lambda qav: [qav[u'DateTime'] - datetime.timedelta(0.5), 
qav[u'DateTime'], qav[u'DateTime'] + datetime.timedelta(0.5) - 
datetime.timedelta(seconds=1)], overwriteExisting=True)
            
        finally:
            grid.Close()
        return outputWorkspace

    @classmethod
    def CreateClimatologicalArcGISRasters(cls, variableName,
                                          statistic, binType,
                                          outputWorkspace, mode=u'add', 
rasterNameExpressions=[u'%(VariableName)s', 
u'%(ClimatologyBinType)s_Climatology', 'Depth_%(Depth)04.0fm', 
u'%(VariableName)s_%(Depth)04.0fm_%(ClimatologyBinName)s_%(Statistic)s.img'],
                                          binDuration=1, startDayOfYear=1,
                                          rotationOffset=None, 
extendYExtent=False, spatialExtent=None, linearUnit=u'Degrees', 
minDepth=None, maxDepth=None, startDate=None, endDate=None,
                                          timeout=60, maxRetryTime=120, 
cacheDirectory=None,
                                          calculateStatistics=True, 
buildPyramids=False):
        cls.__doc__.Obj.ValidateMethodInvocation()
        grid = HYCOMGLBa008Equatorial4D(variableName, 
extendYExtent=extendYExtent, timeout=timeout, maxRetryTime=maxRetryTime, 
cacheDirectory=cacheDirectory)
        try:
            from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
            from GeoEco.Datasets.Virtual import GridSliceCollection, 
ClimatologicalGridCollection, SeafloorGrid

            # If the caller requested a minimum depth that is within
            # the range of the HYCOM layers, instantiate a
            # ClimatologicalGridCollection from the clipped 4D (tzyx)
            # grid, query the 3D grids (zyx) from it, and get the 2D
            # (yx) slices of it.

            grids = []
            if minDepth is None or minDepth <= 5500.:
                clippedGrid = cls._RotateAndClip(grid, rotationOffset, 
spatialExtent, linearUnit, minDepth, maxDepth, startDate, endDate)
                collection = ClimatologicalGridCollection(clippedGrid, 
statistic, binType, binDuration, startDayOfYear, reportProgress=False)
                for g in collection.QueryDatasets(reportProgress=False):
                    grids.extend(GridSliceCollection(g, 
zQACoordType=u'center').QueryDatasets(reportProgress=False))

            # If the caller requested a maximum depth that is greater
            # than or equal to 20000., instantiate a 3D SeafloorGrid
            # (tyx), create a ClimatologicalGridCollection from it,
            # and query the 2D (yx) grids from it.

            if minDepth == 20000. or maxDepth >= 20000.:
                clippedGrid = cls._RotateAndClip(grid, rotationOffset, 
spatialExtent, linearUnit, None, None, startDate, endDate)
                seafloorGrid = SeafloorGrid(clippedGrid, 
(QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata()),), {u'Depth': 
20000.})
                collection = ClimatologicalGridCollection(seafloorGrid, 
statistic, binType, binDuration, startDayOfYear, reportProgress=False)
                grids.extend(collection.QueryDatasets(reportProgress=False))

            # Create the rasters.

            workspace = ArcGISWorkspace(outputWorkspace, ArcGISRaster, 
pathCreationExpressions=rasterNameExpressions, cacheTree=True, 
queryableAttributes=tuple(collection.GetAllQueryableAttributes() + 
[QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata())]))
            workspace.ImportDatasets(grids, mode, 
calculateStatistics=calculateStatistics, buildPyramids=buildPyramids)

        finally:
            grid.Close()
        return outputWorkspace

    @classmethod
    def CreateCurrentVectorsAsArcGISFeatureClasses(cls, outputWorkspace, 
mode=u'add', featureClassNameExpressions=['uv_vectors', '%%Y', 
'Depth_%(Depth)04.0fm', 'uv_vectors_%%%Y%%j_%(Depth)04.0fm.shp'],
                                                   scaleFactor=8900., 
uniformLength=False,
                                                   rotationOffset=None, 
extendYExtent=False, spatialExtent=None, linearUnit=u'Degrees', 
minDepth=None, maxDepth=None, startDate=None, endDate=None,
                                                   timeout=60, 
maxRetryTime=120, cacheDirectory=None):
        cls.__doc__.Obj.ValidateMethodInvocation()

        # Create u and v component grids.
        
        uGrid = HYCOMGLBa008Equatorial4D(u'u', extendYExtent=extendYExtent, 
timeout=timeout, maxRetryTime=maxRetryTime, cacheDirectory=cacheDirectory)
        try:
            vGrid = HYCOMGLBa008Equatorial4D(u'v', 
extendYExtent=extendYExtent, timeout=timeout, maxRetryTime=maxRetryTime, 
cacheDirectory=cacheDirectory)
            try:
                
                # If the caller requested a minimum depth that is
                # within the range of the HYCOM layers, instantiate
                # those grids.

                from GeoEco.Datasets.Virtual import GridSliceCollection, 
SeafloorGrid

                uSlices = []
                vSlices = []

                if minDepth is None or minDepth <= 5500.:
                    clippedUGrid = cls._RotateAndClip(uGrid, rotationOffset, 
spatialExtent, linearUnit, minDepth, maxDepth, startDate, endDate)
                    uSlices.extend(GridSliceCollection(clippedUGrid, 
tQACoordType=u'center', zQACoordType=u'center').QueryDatasets())

                    clippedVGrid = cls._RotateAndClip(vGrid, rotationOffset, 
spatialExtent, linearUnit, minDepth, maxDepth, startDate, endDate)
                    vSlices.extend(GridSliceCollection(clippedVGrid, 
tQACoordType=u'center', zQACoordType=u'center').QueryDatasets())

                # If the caller requested a maximum depth that is
                # greater than or equal to 20000., instantiate grids
                # representing the values at the seafloor.

                if minDepth == 20000. or maxDepth >= 20000.:
                    clippedUGrid = cls._RotateAndClip(uGrid, rotationOffset, 
spatialExtent, linearUnit, None, None, startDate, endDate)
                    seafloorUGrid = SeafloorGrid(clippedUGrid, 
(QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata()),), {u'Depth': 
20000.})
                    uSlices.extend(GridSliceCollection(seafloorUGrid, 
tQACoordType=u'center').QueryDatasets())

                    clippedVGrid = cls._RotateAndClip(vGrid, rotationOffset, 
spatialExtent, linearUnit, None, None, startDate, endDate)
                    seafloorVGrid = SeafloorGrid(clippedVGrid, 
(QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata()),), {u'Depth': 
20000.})
                    vSlices.extend(GridSliceCollection(seafloorVGrid, 
tQACoordType=u'center').QueryDatasets())

                # Construct a list of
                # ShapefileFromVectorComponentGrids from the slices.

                from GeoEco.SpatialAnalysis.Lines import 
ShapefileFromVectorComponentGrids

                queryableAttributes = tuple(uGrid.GetAllQueryableAttributes() 
+ [QueryableAttribute(u'DateTime', _(u'Date'), DateTimeTypeMetadata()), 
QueryableAttribute(u'Depth', _(u'Depth'), FloatTypeMetadata())])
                vectorShapefiles = []

                for i in range(len(uSlices)):
                    queryableAttributeValues = {}
                    for qa in queryableAttributes:
                        queryableAttributeValues[qa.Name] = 
uSlices[i].GetQueryableAttributeValue(qa.Name)

                    
vectorShapefiles.append(ShapefileFromVectorComponentGrids(uSlices[i], 
vSlices[i], scaleFactor, uniformLength, 
queryableAttributes=queryableAttributes, 
queryableAttributeValues=queryableAttributeValues))

                # Import the ShapefileFromVectorComponentGrids into
                # the output workspace.

                from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, 
ArcGISTable

                workspace = ArcGISWorkspace(outputWorkspace, ArcGISTable, 
pathCreationExpressions=featureClassNameExpressions, cacheTree=True, 
queryableAttributes=queryableAttributes)
                workspace.ImportDatasets(vectorShapefiles, mode)

                # Return successfully.
                
                return outputWorkspace

            finally:
                vGrid.Close()
        finally:
            uGrid.Close()

    @classmethod
    def InterpolateAtArcGISPoints(cls, variableNames,
                                  points, valueFields, tField, zField=None, 
zValue=None, method=u'Nearest', extendYExtent=False, where=None, 
noDataValue=None,
                                  timeout=60, maxRetryTime=120, 
cacheDirectory=None,
                                  orderByFields=None, 
numBlocksToCacheInMemory=128, xBlockSize=16, yBlockSize=16, zBlockSize=3, 
tBlockSize=3):
        cls.__doc__.Obj.ValidateMethodInvocation()
        grids = [HYCOMGLBa008Equatorial4D(variableName, 
extendYExtent=extendYExtent, timeout=timeout, maxRetryTime=maxRetryTime, 
cacheDirectory=cacheDirectory) for variableName in variableNames]
        try:
            if orderByFields is not None:
                orderBy = u', '.join(map(lambda f: f + u' ASC', 
orderByFields))
            else:
                from GeoEco.ArcGIS import GeoprocessorManager
                if GeoprocessorManager.GetArcGISMajorVersion() > 9 or 
GeoprocessorManager.GetArcGISMinorVersion() >= 2:
                    orderBy = tField + u' ASC'
                else:
                    orderBy = None
            from GeoEco.Datasets.ArcGIS import ArcGISTable
            from GeoEco.SpatialAnalysis.Interpolation import Interpolator
            Interpolator.InterpolateGridsValuesForTableOfPoints(grids, 
ArcGISTable(points), valueFields, zField=zField, tField=tField, 
zValue=zValue, where=where, orderBy=orderBy, method=method, 
noDataValue=noDataValue, gridsWrap=True, useAbsZ=True, seafloorZValue=20000., 
numBlocksToCacheInMemory=numBlocksToCacheInMemory, xBlockSize=xBlockSize, 
yBlockSize=yBlockSize, zBlockSize=zBlockSize, tBlockSize=tBlockSize)
        finally:
            for grid in grids:
                grid.Close()
        return points

    @classmethod
    def CreateCayulaCornillonFrontsAsArcGISRasters(cls, variableName, 
minPopMeanDifference,
                                                   outputWorkspace, 
mode=u'add', rasterNameExpressions=['%(VariableName)s_fronts', '%%Y', 
'Depth_%(Depth)04.0fm', 
'%(VariableName)s_%%Y%%j_%(Depth)04.0fm_%(ImageType)s.img'],
                                                   medianFilterWindowSize=3, 
histogramWindowSize=20, histogramWindowStride=1, minPropNonMaskedCells=0.65, 
minPopProp=0.25, minTheta=0.76, minSinglePopCohesion=0.88, 
minGlobalPopCohesion=0.90, threads=1,
                                                   fillHoles=20, thin=True, 
minSize=10,
                                                   rotationOffset=None, 
extendYExtent=False, spatialExtent=None, linearUnit=u'Degrees', 
minDepth=None, maxDepth=None, startDate=None, endDate=None, 
                                                   timeout=60, 
maxRetryTime=120, cacheDirectory=None,
                                                   calculateStatistics=True, 
buildRAT=False, buildPyramids=False,
                                                   
outputCandidateCounts=False, outputFrontCounts=False, 
outputWindowStatusCodes=False, outputWindowStatusValues=False):
        cls.__doc__.Obj.ValidateMethodInvocation()

        # Construct a HYCOMGLBa008Equatorial4D instance and rotate and
        # clip it as requested.

        grid = HYCOMGLBa008Equatorial4D(variableName, 
extendYExtent=extendYExtent, timeout=timeout, maxRetryTime=maxRetryTime, 
cacheDirectory=cacheDirectory)
        
        try:
            grid = cls._RotateAndClip(grid, rotationOffset, spatialExtent, 
linearUnit, minDepth, maxDepth, startDate, endDate)

            # Construct a CayulaCornillonFrontsInGrid collection using
            # the requested parameters.

            from GeoEco.OceanographicAnalysis.Fronts import 
CayulaCornillonFrontsInGrid
            import numpy

            collection = CayulaCornillonFrontsInGrid(grid,
                                                     tQACoordType=u'center',
                                                     zQACoordType=u'center',
                                                     wrapEdges=grid.Shape[-1] 
== 4500,
                                                     unscalingFunction=lambda 
a: numpy.cast['int16'](a * 100),
                                                     
newScaledNoDataValue=-99.,
                                                     
medianFilterWindowSize=medianFilterWindowSize,
                                                     
histogramWindowSize=histogramWindowSize,
                                                     
histogramWindowStride=histogramWindowStride,
                                                     
minPropNonMaskedCells=minPropNonMaskedCells,
                                                     minPopProp=minPopProp,
                                                     
minPopMeanDifference=minPopMeanDifference,
                                                     minTheta=minTheta,
                                                     
minSinglePopCohesion=minSinglePopCohesion,
                                                     
minGlobalPopCohesion=minGlobalPopCohesion,
                                                     threads=threads,
                                                     fillHoles=fillHoles,
                                                     thin=thin,
                                                     minSize=minSize)
            try:
                try:
                    # Construct an ArcGISWorkspace instance and import
                    # time/depth slices from the
                    # CayulaCornillonFrontsInGrid instance.

                    expression = "ImageType = 'floc'"
                    if outputCandidateCounts:
                        expression += " OR ImageType = 'ccnt'"
                    if outputFrontCounts:
                        expression += " OR ImageType = 'fcnt'"
                    if outputWindowStatusCodes:
                        expression += " OR ImageType = 'wsco'"
                    if outputWindowStatusValues:
                        expression += " OR ImageType = 'wsvl'"

                    from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, 
ArcGISRaster

                    workspace = ArcGISWorkspace(outputWorkspace, 
ArcGISRaster, pathCreationExpressions=rasterNameExpressions, cacheTree=True, 
queryableAttributes=tuple(collection.GetAllQueryableAttributes()))
                    
workspace.ImportDatasets(collection.QueryDatasets(expression), mode, 
calculateStatistics=calculateStatistics, buildRAT=buildRAT, 
buildPyramids=buildPyramids)

                # If we caught an exception, log it now. Then delete
                # the collection object, to ensure its memory is
                # freed. Normally we don't bother doing this but the
                # memory it holds can be substantial.
                
                except:
                    from GeoEco.Logging import Logger
                    Logger.LogExceptionAsError()
            finally:
                del collection
        finally:
            grid.Close()

        # Return successfully.

        return outputWorkspace


###############################################################################
# Metadata: module
###############################################################################

from GeoEco.ArcGIS import ArcGISDependency
from GeoEco.Dependencies import PythonAggregatedModuleDependency
from GeoEco.Datasets.ArcGIS import _UseUnscaledDataDescription, 
_CalculateStatisticsDescription, _BuildRATDescription, 
_BuildPyramidsDescription
from GeoEco.Metadata import *
from GeoEco.OceanographicAnalysis.Fronts import CayulaCornillonEdgeDetection, 
_SIEDDescription, _SIEDReferences, _WindowStatusCodes, _WindowStatusValues
from GeoEco.Types import *

AddModuleMetadata(shortDescription=_(u'Grids representing HYCOM datasets.'))

###############################################################################
# Metadata: _HYCOMGridGOMl0043D class
###############################################################################

AddClassMetadata(_HYCOMGridGOMl0043D,
    shortDescription=_(u'An OPeNDAPGrid for a 3D variable of a HYCOM GOMl0.04 
OPeNDAP URL.'),
    longDescription=_(
u"""This class is intended for private use within GeoEco and is not
intended for external callers."""))

###############################################################################
# Metadata: HYCOMGOMl0043D class
###############################################################################

_HYCOMGOMl004_LongDescription = _(
u"""At the time this %(name)s was developed, the
`HYCOM + NCODA Gulf of Mexico 1/25 Degree Analysis (GLMl0.04) 
<http://www.hycom.org/dataserver/goml0pt04/>`_
consisted of two gridded datasets:

* expt_20.1 - The 20.1 experiment running from 1 January 2003 through
  30 June 2010.

* expt_30.1 - The 30.1 experiment running from 1 July 2010 and running
  to the present day plus five days.

The datasets have identical spatiotemporal extents and resolutions and
the same oceanographic variables. This %(name)s treats them as one
continuous dataset and takes time slices prior to 1 July 2010 from
expt_20.1 and on or after that date from expt_30.1. (On the HYCOM
server, the datasets actually overlap slightly, with expt_20.1 ending
slightly after 30 June 2010 and expt_30.1 starting slightly before 1
July 2010. The %(name)s ignores the overlapping time slices and
switches from expt_20.1 to expt_30.1 on 1 July.)

The grids are in Mercator projection based on a sphere with radius
6371001 m, with square cells approximately 4.5 km on a side. The
geographic extent is approximately 18 to 32 N, 98 to 76 W. The time
step is 1 day, with time slices representing the instantaneous
condition of the ocean estimated at 00:00 UTC on each day.

The HYCOM documentation states that HYCOM provides a five day forecast
and five day hindcast from the current date, although we have observed
netCDF files on their servers that suggested this window may extend
seven days in both directions. HYCOM revises the data within this
window daily, using the latest ocean observations assimilated from
buoys, satellites, and other sensors. Use caution when working with
time slices close to the current date, as it appears that time slices
continue to be revised until they are 7 days older than the current
date.

Occasionally, HYCOM fails to generate data for a time slice,
presumably due to an outage or other problem in their data processing
infrastructure. For example, in 2004, HYCOM failed to generate data
for three of the 366 time slices of that year. Although HYCOM omits
these time slices from their server, this %(name)s represents them as
grids filled with the No Data value.

The datasets include both 3D variables (dimensions x, y, and time) and
4D variables (dimensions x, y, depth, and time). The 4D variables are
estimated at 40 depth levels: 0, 5, 10, 15, 20, 25, 30, 40, 50, 60,
70, 80, 90, 100, 125, 150, 200, 250, 300, 400, 500, 600, 700, 800,
900, 1000, 1100, 1200, 1300, 1400, 1500, 1750, 2000, 2500, 3000, 3500,
4000, 4500, 5000, and 5500 m.

This %(name)s accesses the HYCOM datasets using the
`OPeNDAP <http://opendap.org/>`_ protocol, allowing data to be
retrieved very efficiently. However, during periods of high load, the
HYCOM OPeNDAP server often requires five to ten minutes to return the
first slice of data. Please be patient; after the first one is
returned, the rest will go much faster. During periods of extreme
load, the tool may fail with a timeout error. If this happens,
increase the timeout value and try again, or wait until later when the
server is less busy.""")

_HYCOMGOMl004_References = _(
u"""Chassignet, E.P., Hurlburt, H.E., Metzger, E.J., Smedstad, O.M.,
Cummings, J.A., Halliwell, G.R., Bleck, R., Baraille, R., Wallcraft.,
A.J., Lozano, C., Tolman, H.L., Srinivasan, A., Hankin, S., Cornillon,
P., Weisberg, R., Barth, A., He, R., Werner, F. and Wilkin, J. (2009).
US GODAE: Global Ocean Prediction with the HYbrid Coordinate Ocean
Model (HYCOM). Oceanography 22: 64-75.

The HYCOM User's Guide and many other technical documents are
available on the
`HYCOM web site <http://www.hycom.org/hycom/documentation>`_.""")

AddClassMetadata(HYCOMGOMl0043D,
    shortDescription=_(u'Represents a HYCOM GOMl0.04 3D variable as a Grid 
Dataset.'),
    longDescription=_HYCOMGOMl004_LongDescription % {u'name': 'class'} + 
_('\n\n**References**\n\n') + _HYCOMGOMl004_References)

# Constructor

AddMethodMetadata(HYCOMGOMl0043D.__init__,
    shortDescription=_(u'Constructs a new HYCOMGOMl0043D instance.'),
    isExposedToPythonCallers=True,
    dependencies=[PythonAggregatedModuleDependency('numpy')])

AddArgumentMetadata(HYCOMGOMl0043D.__init__, u'self',
    typeMetadata=ClassInstanceTypeMetadata(cls=HYCOMGOMl0043D),
    description=_(u'HYCOMGOMl0043D instance.'))

AddArgumentMetadata(HYCOMGOMl0043D.__init__, u'variableName',
    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'emp', u'mld', 
u'mlp', u'qtot', u'ssh', u'surface_salinity_trend', 
u'surface_temperature_trend'], makeLowercase=True),
    description=_(
u"""HYCOM 3D variable (dimensions x, y, and time), one of:

* emp - Water flux into the ocean, in kg/m^2/s.

* mld - Mixed layer thickness, in m, defined as the depth at which the
  temperature change from the surface temperature is 0.2 degrees C.

* mlp - Mixed layer thickness, in m, defined as the depth at which the
  pressure change from the surface pressure is 0.03 kg/m^3.

* qtot - Surface downward heat flux, in W/m^2.

* ssh - Sea surface height, in m, above the HYCOM reference spheroid.

* surface_salinity_trend - Surface salinity trend, in psu/day.

* surface_temperature_trend - Surface temperature trend, in degrees
  C/day.

Please see the HYCOM documentation for more information about these
variables."""),
    arcGISDisplayName=_(u'HYCOM variable'))

AddArgumentMetadata(HYCOMGOMl0043D.__init__, u'startYear',
    typeMetadata=IntegerTypeMetadata(canBeNone=True, minValue=2003),
    description=_(
u"""Starting year for this grid. This parameter is optional; if a
value is not specified, 2003 will be used."""))

AddArgumentMetadata(HYCOMGOMl0043D.__init__, u'endYear',
    typeMetadata=IntegerTypeMetadata(canBeNone=True),
    description=_(
u"""Ending year for this grid. This parameter is optional; if a value
is not specified, the grid will extend to the maximum temporal extent
of the HYCOM data. If you do not need data for the current year,
specify an earlier year for this parameter. This will make it
unnecessary to query the HYCOM server to determine the maximum
temporal extent."""))

CopyArgumentMetadata(THREDDSCatalog.__init__, u'timeout', 
HYCOMGOMl0043D.__init__, u'timeout')
CopyArgumentMetadata(THREDDSCatalog.__init__, u'maxRetryTime', 
HYCOMGOMl0043D.__init__, u'maxRetryTime')

AddArgumentMetadata(HYCOMGOMl0043D.__init__, u'cacheDirectory',
    typeMetadata=DirectoryTypeMetadata(canBeNone=True),
    description=_(
u"""Directory to cache OPeNDAP datasets.

A cache directory can dramatically speed up scenarios that involve
accessing the same subsets the HYCOM data over and over again. When
OPeNDAP data is requested from the HYCOM server, the cache directory
will be checked for data that was downloaded and cached during prior
requests. If cached data exists that can fulfill part of the current
request, the request will be serviced by reading from cache files
rather than the OPeNDAP server. If the entire request can be serviced
from the cache, the OPeNDAP server will not be accessed at all and the
request will be completed extremely quickly. Any parts of the request
that cannot be serviced from the cache will be downloaded from the
OPeNDAP server and added to the cache, speeding up future requests for
the same data.

If you use a cache directory, be aware of these common pitfalls:

* The HYCOM documentation states that HYCOM provides a five day forecast
  and five day hindcast from the current date, although we have
  observed netCDF files on their servers that suggested this window
  may extend seven days in both directions. HYCOM revises the data
  within this time window daily, using the latest ocean observations
  assimilated from buoys, satellites, and other sensors. We recommend
  you do not cache data in this time window. The caching algorithm
  cannot detect whether cached data should be replaced with revised
  versions available on the server.

* The caching algorithm permits the cache to grow to infinite size and
  never deletes any cached data. If you access a large amount of data
  it will all be added to the cache. Be careful that you do not fill
  up your hard disk. To mitigate this, manually delete the entire
  cache or selected directories or files within it.

* The caching algorithm stores data in uncompressed files, so that
  subsets of those files may be quickly accessed. To save space on
  your hard disk, you can enable compression of the cache directory
  using the operating system. On Windows, right click on the directory
  in Windows Explorer, select Properties, click Advanced, and enable
  "Compress contents to save disk space".
"""),
    arcGISDisplayName=_(u'Cache directory'),
    arcGISCategory=_(u'OPeNDAP options'))

AddResultMetadata(HYCOMGOMl0043D.__init__, u'grid',
    typeMetadata=ClassInstanceTypeMetadata(cls=HYCOMGOMl0043D),
    description=_(u'HYCOMGOMl0043D instance.'))

# Public method: HYCOMGOMl0043D.CreateArcGISRasters

AddMethodMetadata(HYCOMGOMl0043D.CreateArcGISRasters,
    shortDescription=_(u'Creates rasters for a HYCOM GOMl0.04 3D variable.'),
    longDescription=_HYCOMGOMl004_LongDescription % {u'name': 'tool'} + 
_('\n\n**References**\n\n') + _HYCOMGOMl004_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Create Rasters for HYCOM GOMl0.04 3D Variable'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Gulf of Mexico 1/25 Degree Analysis (GLMl0.04)\\3D Variables'),
    dependencies=[ArcGISDependency(9, 1), 
PythonAggregatedModuleDependency('numpy')])

AddArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'cls',
    typeMetadata=ClassOrClassInstanceTypeMetadata(cls=HYCOMGOMl0043D),
    description=_(u'HYCOMGOMl0043D class or instance.'))

CopyArgumentMetadata(HYCOMGOMl0043D.__init__, u'variableName', 
HYCOMGOMl0043D.CreateArcGISRasters, u'variableName')

AddArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'outputWorkspace',
    typeMetadata=ArcGISWorkspaceTypeMetadata(createParentDirectories=True),
    description=_(
u"""Directory or geodatabase to receive the rasters.

Unless you have a specific reason to store the rasters in a
geodatabase, we recommend you store them in a directory because it
will be much faster and allows the rasters to be organized in a tree.
If you do store the rasters in a geodatabase, you must change the
Raster Name Expressions parameter; see below for more
information."""),
    arcGISDisplayName=_(u'Output workspace'))

AddArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'mode',
    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Add', 
u'Replace'], makeLowercase=True),
    description=_(
u"""Overwrite mode, one of:

* Add - create rasters that do not exist and skip those that already
  exist. This is the default.

* Replace - create rasters that do not exist and overwrite those that
  already exist.

'Add' is appropriate when working with HYCOM data older than one week
from the current date. When working with newer data, consider using
'Replace'. The HYCOM documentation states that HYCOM provides a five
day forecast and five day hindcast from the current date, although we
have regularly observed netCDF files on their servers that suggested
this window actually extends seven days in both directions. HYCOM
revises the data within this window daily, using the latest ocean
observations assimilated from buoys, satellites, and other sensors.
Therefore, by using 'Replace' when working with data within this
window, you will be sure to overwrite obsolete data with the latest
estimates.

The ArcGIS Overwrite Outputs geoprocessing setting has no effect on
this tool. If 'Replace' is selected the rasters will be overwritten,
regardless of the ArcGIS Overwrite Outputs setting."""),
    arcGISDisplayName=_(u'Overwrite mode'))

AddArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, 
u'rasterNameExpressions',
    typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(), 
minLength=1),
    description=_(
u"""List of expressions specifying how the output rasters should be
named.

The default expression assumes you are storing rasters in a file
system directory and creates them in a tree structure with levels for
the variable name and year. When storing rasters in a directory, the
final expression specifies the file name of the raster and any
preceding expressions specify subdirectories. The extension of the
final expression determines the output raster format: .asc for ArcInfo
ASCII Grid, .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE
file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for
GeoTIFF, or no extension for ArcInfo Binary Grid. The default
expression uses .img.

When storing rasters in a geodatabase, you should provide only one
expression. That expression specifies the raster's name.

Each expression may contain any sequence of characters permitted by
the output workspace. Each expression may optionally contain one or
more of the following case-sensitive codes. The tool replaces the
codes with appropriate values when creating each raster:

* %(VariableName)s - HYCOM variable represented in the output raster.

* %%Y - four-digit year of the raster.

* %%m - two-digit month of the raster.

* %%d - two-digit day of the month of the raster.

* %%j - three-digit day of the year of the raster.
"""),
    arcGISDisplayName=_(u'Raster name expressions'))

AddArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'rasterCatalog',
    typeMetadata=ArcGISRasterCatalogTypeMetadata(canBeNone=True, 
mustBeDifferentThanArguments=[u'outputWorkspace'], 
createParentDirectories=True),
    description=_(
u"""Raster catalog to create.

This parameter requires ArcGIS 9.3 or later.

If this parameter is specified, after the tool finishes creating
rasters, it will create an unmanaged raster catalog and import all of
the rasters in the output workspace into it. The catalog will have
fields for all of the codes specified in the Raster Name Expressions
as well as fields for the start date, center date, and end date of
each raster. You can then use the catalog to create animations using
the ArcGIS 10 Time Slider.

WARNING: The raster catalog will be deleted and re-created each time
the tool is executed. Beware of this if you plan to add your own
fields to the catalog after it has been created."""),
    direction=u'Output',
    arcGISDisplayName=_(u'Output raster catalog'),
    dependencies=[ArcGISDependency(9, 3)])

AddArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'spatialExtent',
    typeMetadata=EnvelopeTypeMetadata(canBeNone=True),
    description=_(
u"""Spatial extent of the outputs, in the units specified by the
Linear Units parameter.

If you do not specify a spatial extent, it will default to
approximately 18 to 32 N, 98 to 76 W. The outputs can only be clipped
in whole grid cells. The values you provide will be rounded off to the
closest cell."""),
    arcGISDisplayName=_(u'Spatial extent'),
    arcGISCategory=_(u'Spatiotemporal extent'))

AddArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'linearUnit',
    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Degrees', 
u'Meters'], makeLowercase=True),
    description=_(
u"""Specifies the unit of the Spatial Extent parameter, one of:

* Degrees - Decimal degrees.

* Meters - Meters, in the HYCOM coordinate system.
"""),
    arcGISDisplayName=_(u'Linear unit'),
    arcGISCategory=_(u'Spatiotemporal extent'))

AddArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'startDate',
    typeMetadata=DateTimeTypeMetadata(canBeNone=True),
    description=_(
u"""Start date for the outputs to create.

Outputs will be created for images that occur on or after the start
date and on or before the end date. The HYCOM GOMl0.04 dataset
provides a five-day forecast; its temporal extent ranges from 1
January 2003 to today's date plus five days. If you do not specify a
start date, 1 January 2003 will be used.

The time component of the start date is ignored."""),
    arcGISDisplayName=_(u'Start date'),
    arcGISCategory=_(u'Spatiotemporal extent'))

AddArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'endDate',
    typeMetadata=DateTimeTypeMetadata(canBeNone=True),
    description=_(
u"""End date for the outputs to create.

Outputs will be created for images that occur on or after the start
date and on or before the end date. The HYCOM GOMl0.04 dataset
provides a five-day forecast; its temporal extent ranges from 1
January 2003 to today's date plus five days. If you do not specify an
end date, the most recent day available will be used (typically
today's date plus five days).

The time component of the end date is ignored."""),
    arcGISDisplayName=_(u'End date'),
    arcGISCategory=_(u'Spatiotemporal extent'))

CopyArgumentMetadata(HYCOMGOMl0043D.__init__, u'timeout', 
HYCOMGOMl0043D.CreateArcGISRasters, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0043D.__init__, u'maxRetryTime', 
HYCOMGOMl0043D.CreateArcGISRasters, u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0043D.__init__, u'cacheDirectory', 
HYCOMGOMl0043D.CreateArcGISRasters, u'cacheDirectory')

AddArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, 
u'calculateStatistics',
    typeMetadata=BooleanTypeMetadata(),
    description=_CalculateStatisticsDescription,
    arcGISDisplayName=_(u'Calculate statistics'),
    arcGISCategory=_(u'Additional raster processing options'))

AddArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'buildPyramids',
    typeMetadata=BooleanTypeMetadata(),
    description=_BuildPyramidsDescription,
    arcGISDisplayName=_(u'Build pyramids'),
    arcGISCategory=_(u'Additional raster processing options'))

AddResultMetadata(HYCOMGOMl0043D.CreateArcGISRasters, 
u'updatedOutputWorkspace',
    typeMetadata=ArcGISWorkspaceTypeMetadata(),
    description=_(u'Updated output workspace.'),
    arcGISDisplayName=_(u'Updated output workspace'),
    arcGISParameterDependencies=[u'outputWorkspace'])

# Public method: HYCOMGOMl0043D.CreateClimatologicalArcGISRasters

AddMethodMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters,
    shortDescription=_(u'Creates climatological rasters for a HYCOM GOMl0.04 
3D variable'),
    longDescription=_(
u"""This tool produces rasters showing the climatological average
value (or other statistic) of a HYCOM GLMl0.04 3D variable. Given a
desired variable, a statistic, and a climatological bin definition,
this tool downloads daily images for the variable, classifies them
into bins, and produces a single raster for each bin. Each cell of the
raster is produced by calculating the statistic on the values of that
cell extracted from all of the rasters in the bin.

""") + _HYCOMGOMl004_LongDescription % {u'name': 'tool'} + 
_('\n\n**References**\n\n') + _HYCOMGOMl004_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Create Climatological Rasters for HYCOM GOMl0.04 3D 
Variable'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Gulf of Mexico 1/25 Degree Analysis (GLMl0.04)\\3D Variables'),
    dependencies=[ArcGISDependency(9, 1), 
PythonAggregatedModuleDependency('numpy')])

CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'cls', 
HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, u'cls')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'variableName', 
HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, u'variableName')

AddArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'statistic',
    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Count', 
u'Maximum', u'Mean', u'Minimum', u'Range', u'Standard Deviation', u'Sum'], 
makeLowercase=True),
    description=_(
u"""Statistic to calculate for each cell, one of:

* Count - number of images in which the cell had data.

* Maximum - maximum value for the cell.

* Mean - mean value for the cell, calculated as the sum divided by the
  count.

* Minimum - minimum value for the cell.

* Range - range for the cell, calculated as the maximum minus the
  minimum.

* Standard Deviation - sample standard deviation for the cell
  (i.e. the standard deviation estimated using Bessel's correction).
  In order to calculate this, there must be at least two images with
  data for the cell.

* Sum - the sum for the cell.
"""),
    arcGISDisplayName=_(u'Statistic'))

AddArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'binType',
    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Daily', 
u'Monthly', u'Cumulative', u'ENSO Daily', u'ENSO Monthly', u'ENSO 
Cumulative'], makeLowercase=True),
    description=_(
u"""Climatology bins to use, one of:

* Daily - daily bins. Images will be classified into bins according to
  their days of the year. The number of days in each bin is determined
  by the Climatology Bin Duration parameter (which defaults to 1). The
  number of bins is calculated by dividing 365 by the bin duration. If
  there is no remainder, then that number of bins will be created;
  images for the 366th day of leap years will be counted in the bin
  that includes day 365. For example, if the bin duration is 5, 73
  bins will be created. The first will be for days 1-5, the second
  will be for days 5-10, and so on; the 73rd bin will be for days
  361-365 during normal years and 361-366 during leap years. If
  dividing 365 by the bin duration does yield a remainder, then one
  additional bin will be created to hold the remaining days. For
  example, if the bin duration is 8, 46 bins will be created. The
  first will be for days 1-8, the second for days 9-16, and so on; the
  46th will be for days 361-365 during normal years and 361-366 during
  leap years.

* Monthly - monthly bins. Images will be classified into bins according to
  their months of the year. The number of months in each bin is
  determined by the Climatology Bin Duration parameter (which defaults
  to 1). The number of bins is calculated by dividing 12 by the bin
  duration. If there is no remainder, then that number of bins will be
  created. For example, if the bin duration is 3, there will be four
  bins: January-March, April-June, July-September, and
  October-December. If there is a remainder, then one additional bin
  will be created. For example, if the bin duration is 5, 3 bins will
  be created: January-May, June-October, November-December.

* Cumulative - one bin. A single climatology raster will be calculated
  from the entire dataset. The Bin Duration parameter is ignored.

* ENSO Daily, ENSO Monthly, ENSO Cumulative - the same as above,
  except each of the bins above will be split into three, based on the
  phase of the `El Nino Southern Oscillation (ENSO) 
<http://en.wikipedia.org/wiki/ENSO>`_,
  as determined by the Oceanic Nino Index (ONI) calculated by the
  `NOAA NCEP Climate Prediction Center 
<http://www.cpc.ncep.noaa.gov/products/analysis_monitoring/ensostuff/ensoyears.shtml>`_.
  The ONI classifies each month into one of three phases: neutral, El
  Nino, or La Nina. This tool first classifies input images according
  to their dates into ENSO phases (it downloads ONI data from the
  `NOAA Earth System Research Laboratory 
<http://www.esrl.noaa.gov/psd/data/climateindices/list/>`_),
  then produces a climatology bin for each phase. For example, if you
  request ENSO Cumulative bins, three bins will be produced: one for
  all images occurring in neutral months, one for all in El Nino
  months, and one for all in La Nina months. If you request ENSO
  Monthly bins, 36 bins will be produced: one for each combination of
  the 12 months and the three ENSO phases.

For Daily and Monthly, to adjust when the bins start (e.g. to center a
4-bin seasonal climatology on solstices and equinoxes), use the Start
Climatology At This Day Of The Year parameter."""),
    arcGISDisplayName=_(u'Climatology bin type'))

CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'outputWorkspace', 
HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, u'outputWorkspace')

AddArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, u'mode',
    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Add', 
u'Replace'], makeLowercase=True),
    description=_(
u"""Overwrite mode, one of:

* Add - create rasters that do not exist and skip those that already
  exist. This is the default.

* Replace - create rasters that do not exist and overwrite those that
  already exist. Choose this option when you want to regenerate the
  climatologies using the latest HYCOM images.

The ArcGIS Overwrite Outputs geoprocessing setting has no effect on
this tool. If 'Replace' is selected the rasters will be overwritten,
regardless of the ArcGIS Overwrite Outputs setting."""),
    arcGISDisplayName=_(u'Overwrite mode'))

AddArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'rasterNameExpressions',
    typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(), 
minLength=1),
    description=_(
u"""List of expressions specifying how the output rasters should be
named.

The default expression assumes you are storing rasters in a file
system directory and creates them in a tree structure with levels for
variable and climatology bin type. When storing rasters in a
directory, the final expression specifies the file name of the raster
and any preceding expressions specify subdirectories. The extension of
the final expression determines the output raster format: .asc for
ArcInfo ASCII Grid, .bmp for BMP, .gif for GIF, .img for an ERDAS
IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif
for GeoTIFF, or no extension for ArcInfo Binary Grid. The default
expression uses .img.

When storing rasters in a geodatabase, you should provide only one
expression. That expression specifies the raster's name.

Each expression may contain any sequence of characters permitted by
the output workspace. Each expression may optionally contain one or
more of the following case-sensitive codes. The tool replaces the
codes with appropriate values when creating each raster:

* %(VariableName)s - HYCOM variable represented in the output raster.

* %(ClimatologyBinType)s - type of the climatology bin, either "Daily"
  if 1-day bins, "Xday" if multi-day bins (X is replaced by the
  duration), "Monthly" if 1-month bins, "Xmonth" if multi-month bins,
  or "Cumulative". If an ENSO bin type is used, "ENSO\\_" will be
  prepended to those strings (e.g. "ENSO_Daily", "ENSO_Monthly").

* %(ClimatologyBinName)s - name of the climatology bin corresponding
  represented by the output raster, either "dayXXX" for 1-day bins
  (XXX is replaced by the day of the year), "daysXXXtoYYY" for
  multi-day bins (XXX is replaced by the first day of the bin, YYY is
  replaced by the last day), "monthXX" for 1-month bins (XX is
  replaced by the month), "monthXXtoYY" (XX is replaced by the first
  month of the bin, YY by the last month), or "cumulative". If an ENSO
  bin type is used, "neutral\\_", "ElNino\\_", and "LaNina\\_" will be
  prepended to those strings for each of the three ENSO phased rasters
  (e.g. "neutral_cumulative", "ElNino_cumulative", and
  "LaNina_cumulative" when "ENSO Cumulative" bins are requested).

* %(Statistic)s - statistic that was calculated, in lowercase and with
  spaces replaced by underscores; one of: "count", "maximum", "mean",
  "minimum", "range", "standard_deviation", "Sum".

If the Bin Type is "Daily", the following additional codes are
available:

* %(FirstDay)i - first day of the year of the climatology bin
  represented by the output raster.

* %(LastDay)i - last day of the year of the climatology bin
  represented by the output raster. For 1-day climatologies, this will
  be the same as %(FirstDay)i.

If the Bin Type is "Monthly", the following additional codes are
available:

* %(FirstMonth)i - first month of the climatology bin represented by
  the output raster.

* %(DayOfFirstMonth)i - first day of the first month of the
  climatology bin represented by the output raster.

* %(LastMonth)i - last month of the climatology bin represented by
  the output raster.

* %(DayOfLastMonth)i - last day of the last month of the climatology
  bin represented by the output raster.

Note that the additional codes are integers and may be formatted using
"printf"-style formatting codes. For example, to format the FirstDay
as a three-digit number with leading zeros::

    %(FirstDay)03i
"""),
    arcGISDisplayName=_(u'Raster name expressions'))

AddArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'binDuration',
    typeMetadata=IntegerTypeMetadata(minValue=1),
    description=_(
u"""Duration of each bin, in days or months, when the Bin Type is
Daily or Monthly, respectively. The default is 1. See the Bin Type
parameter for more information."""),
    arcGISDisplayName=_(u'Climatology bin duration'),
    arcGISCategory=_(u'Climatology options'))

AddArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'startDayOfYear',
    typeMetadata=IntegerTypeMetadata(minValue=1, maxValue=365),
    description=_(
u"""Use this parameter to create bin defintions that deviate from the
traditional calendar. The interpretation of this parameter depends on
the Bin Type:

* Daily - this parameter defines the day of the year of the first
  climatology bin. For example, if this parameter is 100 and the Bin
  Duration is 10, the first bin will be numbered 100-109. The bin
  spanning the end of the year will be numbered 360-004. The last bin
  will be numbered 095-099. To define a four-bin climatology with bins
  that are centered approximately on the equinoxes and solstices
  (i.e., a seasonal climatology), set the Bin Duration to 91 and the
  start day to 36 (February 5). This will produce bins with dates
  036-126, 127-217, 218-308, and 309-035.

* Monthly - this parameter defines the day of the year of the first
  climatology bin, and the day of the month of that bin will be used
  as the first day of the month of all of the bins. For example, if
  this parameter is 46, which is February 15, and the Bin Duration is
  1, then the bins will be February 15 - March 14, March 15 - April
  14, April 15 - May 14, and so on. Calculations involving this
  parameter always assume a 365 day year (a non-leap year). To define
  a four-bin climatology using the months traditionally associated
  with spring, summer, fall, and winter in many northern hemisphere
  cultures, set the Bin Duration to 3 and the start day to 60 (March
  1). This will produce bins with months 03-05, 06-08, 09-11, and
  12-02.

* Cumulative - this parameter is ignored.
"""),
    arcGISDisplayName=_(u'Start climatology at this day of the year'),
    arcGISCategory=_(u'Climatology options'))

CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'spatialExtent', 
HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, u'spatialExtent')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'linearUnit', 
HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, u'linearUnit')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'startDate', 
HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, u'startDate')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'endDate', 
HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, u'endDate')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'timeout', 
HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'maxRetryTime', 
HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'cacheDirectory', 
HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, u'cacheDirectory')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, 
u'calculateStatistics', HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'calculateStatistics')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'buildPyramids', 
HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, u'buildPyramids')

CopyResultMetadata(HYCOMGOMl0043D.CreateArcGISRasters, 
u'updatedOutputWorkspace', HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'updatedOutputWorkspace')

# Public method: HYCOMGOMl0043D.InterpolateAtArcGISPoints

AddMethodMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints,
    shortDescription=_(u'Interpolates HYCOM GOMl0.04 3D variables at 
points.'),
    longDescription=_HYCOMGOMl004_LongDescription % {u'name': 'tool'} + 
_('\n\n**References**\n\n') + _HYCOMGOMl004_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Interpolate HYCOM GOMl0.04 3D Variables at Points'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Gulf of Mexico 1/25 Degree Analysis (GLMl0.04)\\3D Variables'),
    dependencies=[ArcGISDependency(9, 1, requiresCOMInstantiation=True), 
PythonAggregatedModuleDependency('numpy')])

CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'cls', 
HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'cls')

AddArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'variableNames',
    
typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(allowedValues=[u'emp',
 u'mld', u'mlp', u'qtot', u'ssh', u'surface_salinity_trend', 
u'surface_temperature_trend'], makeLowercase=True), minLength=1),
    description=_(
u"""HYCOM 3D variables to interpolate:

* emp - Water flux into the ocean, in kg/m^2/s.

* mld - Mixed layer thickness, in m, defined as the depth at which the
  temperature change from the surface temperature is 0.2 degrees C.

* mlp - Mixed layer thickness, in m, defined as the depth at which the
  pressure change from the surface pressure is 0.03 kg/m^3.

* qtot - Surface downward heat flux, in W/m^2.

* ssh - Sea surface height, in m, above the HYCOM reference spheroid.

* surface_salinity_trend - Surface salinity trend, in psu/day.

* surface_temperature_trend - Surface temperature trend, in degrees
  C/day.

Please see the HYCOM documentation for more information about these
variables.

For each variable that you select, you must also specify a field of
the points to receive the interpolated value."""),
    arcGISDisplayName=_(u'HYCOM variables to interpolate'))

AddArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'points',
    typeMetadata=ArcGISFeatureLayerTypeMetadata(mustExist=True, 
allowedShapeTypes=[u'Point']),
    description=_(
u"""Points at which values should be interpolated.

HYCOM uses a Mercator coordinate system based on a sphere with radius
6371001 m. It is recommended but not required that the points use the
same coordinate system. If they do not, this tool will attempt to
project the points to the HYCOM coordinate system prior to doing the
interpolation. This may fail if a datum transformation is required, in
which case you will have to manually project the points to the HYCOM
coordinate system before using this tool."""),
    arcGISDisplayName=_(u'Point features'))

AddArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'valueFields',
    
typeMetadata=ListTypeMetadata(elementType=ArcGISFieldTypeMetadata(mustExist=True,
 allowedFieldTypes=[u'short', u'long', u'float', u'double']), 
mustBeSameLengthAsArgument=u'variableNames'),
    description=_(
u"""Fields of the points to receive the interpolated values. You must
specify one field for each HYCOM variable that you selected for
interpolation.

Each field must have a floating-point or integer data type. If a field
cannot represent the interpolated value at full precision, the closest
approximation will be stored and a warning will be issued. Because all
of the HYCOM variables use a floating-point data type, we strongly
recommend you use floating-point fields."""),
    arcGISDisplayName=_(u'Fields to receive the interpolated values'),
    arcGISParameterDependencies=[u'points'])

AddArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'tField',
    typeMetadata=ArcGISFieldTypeMetadata(mustExist=True, 
allowedFieldTypes=[u'date']),
    description=_(
u"""Field of the points that specifies the date and time of the point.

The field must have a date or datetime data type. If the field can
only represent dates with no time component, the time will assumed to
be 00:00:00.

HYCOM uses UTC time. It is assumed that this field also uses UTC
time."""),
    arcGISDisplayName=_(u'Date field'),
    arcGISParameterDependencies=[u'points'])

AddArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'method',
    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Nearest', 
u'Linear'], makeLowercase=True),
    description=_(
u"""Interpolation method to use, one of:

* Nearest - nearest neighbor interpolation. The interpolated value
  will simply be the value of the cell that contains the point. This
  is the default.

* Linear - linear interpolation (also known as trilinear
  interpolation). This method averages the values of the eight nearest
  cells in the x, y, and time dimensions, weighting the contribution
  of each cell by the area of it that would be covered by a
  hypothetical cell centered on the point being interpolated. If the
  cell containing the point contains NoData, the result is NoData. If
  any of the other seven cells contain NoData, they are omitted from
  the average, and the result is based on the weighted average of the
  cells that do contain data. This is the same algorithm implemented
  by the ArcGIS Spatial Analyst's Extract Values to Points tool.
"""),
    arcGISDisplayName=_(u'Interpolation method'))

AddArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'where',
    typeMetadata=SQLWhereClauseTypeMetadata(canBeNone=True),
    description=_(
u"""SQL WHERE clause expression that specifies the subset of points to
use. If this parameter is not provided, all of the points will be
used.

The exact syntax of this expression depends on the type of feature
class you're using. ESRI recommends you reference fields using the
following syntax:

* For shapefiles, ArcInfo coverages, or feature classes stored in file
  geodatabases, ArcSDE geodatabases, or ArcIMS, enclose field names in
  double quotes: "MY_FIELD"

* For feature classes stored in personal geodatabases, enclose field
  names in square brackets: [MY_FIELD].
"""),
    arcGISDisplayName=_(u'Where clause'),
    arcGISCategory=_(u'Interpolation options'),
    arcGISParameterDependencies=[u'points'])

AddArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'noDataValue',
    typeMetadata=FloatTypeMetadata(canBeNone=True),
    description=_(
u"""Value to use when the interpolated value is NoData.

If a value is not provided for this parameter, a database NULL value
will be stored in the field when the interpolated value is NoData. If
the field cannot store NULL values, as is the case with shapefiles,
the value -9999 will be used."""),
    arcGISDisplayName=_(u'Value to use when the interpolated value is 
NoData'),
    arcGISCategory=_(u'Interpolation options'))

CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'timeout', 
HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'maxRetryTime', 
HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'cacheDirectory', 
HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'cacheDirectory')

AddArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'orderByFields',
    
typeMetadata=ListTypeMetadata(elementType=ArcGISFieldTypeMetadata(mustExist=True),
 minLength=1, canBeNone=True),
    description=_(
u"""Fields for defining the order in which the points are processed.

The points may be processed faster if they are ordered
spatiotemporally, such that points that are close in space and time
are processed sequentially. Ordering the points this way increases the
probability that the value of a given point can be interpolated from
data that is cached in memory, rather than from data that must be read
from the disk or network, which is much slower. Choose fields that
faciliate this. For example, if your points represent the locations of
animals tracked by satellite telemetry, order the processing first by
the animal ID and then by the transmission date or number.

If you omit this parameter, the Date Field will be used automatically.

This parameter requires ArcGIS 9.2 or later."""),
    arcGISDisplayName=_(u'Order by fields'),
    arcGISCategory=_(u'Performance tuning options'),
    arcGISParameterDependencies=[u'points'],
    dependencies=[ArcGISDependency(9, 2)])

AddArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'numBlocksToCacheInMemory',
    typeMetadata=IntegerTypeMetadata(minValue=0, canBeNone=True),
    description=_(
u"""Maximum number of blocks of HYCOM data to cache in memory.

To minimize the number of times that the disk or network must be
accessed, this tool employs a simple caching strategy, in addition to
disk caching described by the Cache Directory parameter. When it
processes the first point, it reads a square block of cells centered
on that point and caches it in memory. When it processes the second
and subsequent points, it first checks whether the cells needed for
that point are contained by the block cached in memory. If so, it
processes that point using the in-memory block, rather than reading
from disk or the network again. If not, it reads another square block
centered on that point and adds it to the cache.

The tool processes the remaining points, adding additional blocks to
the cache, as needed. To prevent the cache from exhausing all memory,
it is only permitted to grow to the size specified by this parameter.
When the cache is full but a new block is needed, the oldest block is
discarded to make room for the newest block.

The maximum size of the cache in bytes may be calculated by
multiplying this parameter by 4 (the number of bytes required for one
cell of data) and then by all of the block size parameters.

If this parameter is 0, no blocks will be cached in memory."""),
    arcGISDisplayName=_(u'Number of blocks of data to cache in memory'),
    arcGISCategory=_(u'Performance tuning options'))

AddArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'xBlockSize',
    typeMetadata=IntegerTypeMetadata(minValue=0, canBeNone=True),
    description=_(
u"""Size of the blocks of HYCOM data to cache in memory, in the x
direction (longitude). The size is given as the number of cells.

If this parameter is 0, no blocks will be cached in memory."""),
    arcGISDisplayName=_(u'In-memory cache block size, in X direction'),
    arcGISCategory=_(u'Performance tuning options'))

AddArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'yBlockSize',
    typeMetadata=IntegerTypeMetadata(minValue=0, canBeNone=True),
    description=_(
u"""Size of the blocks of HYCOM data to cache in memory, in the y
direction (latitude). The size is given as the number of cells.

If this parameter is 0, no blocks will be cached in memory."""),
    arcGISDisplayName=_(u'In-memory cache block size, in Y direction'),
    arcGISCategory=_(u'Performance tuning options'))

AddArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'tBlockSize',
    typeMetadata=IntegerTypeMetadata(minValue=0, canBeNone=True),
    description=_(
u"""Size of the blocks of HYCOM data to cache in memory, in the t
direction (time). The size is given as the number of cells.

If this parameter is 0, no blocks will be cached in memory."""),
    arcGISDisplayName=_(u'In-memory cache block size, in T direction'),
    arcGISCategory=_(u'Performance tuning options'))

AddResultMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'updatedPoints',
    typeMetadata=ArcGISFeatureLayerTypeMetadata(),
    description=_(u'Updated points.'),
    arcGISDisplayName=_(u'Updated points'),
    arcGISParameterDependencies=[u'points'])

###############################################################################
# Metadata: _HYCOMGridGOMl0044D class
###############################################################################

AddClassMetadata(_HYCOMGridGOMl0044D,
    shortDescription=_(u'An OPeNDAPGrid for a 4D variable of a HYCOM GOMl0.04 
OPeNDAP URL.'),
    longDescription=_(
u"""This class is intended for private use within GeoEco and is not
intended for external callers."""))

###############################################################################
# Metadata: HYCOMGOMl0044D class
###############################################################################

AddClassMetadata(HYCOMGOMl0044D,
    shortDescription=_(u'Represents a HYCOM GOMl0.04 4D variable as a Grid 
Dataset.'),
    longDescription=_HYCOMGOMl004_LongDescription % {u'name': 'class'} + 
_('\n\n**References**\n\n') + _HYCOMGOMl004_References)

# Constructor

AddMethodMetadata(HYCOMGOMl0044D.__init__,
    shortDescription=_(u'Constructs a new HYCOMGOMl0044D instance.'),
    isExposedToPythonCallers=True,
    dependencies=[PythonAggregatedModuleDependency('numpy')])

AddArgumentMetadata(HYCOMGOMl0044D.__init__, u'self',
    typeMetadata=ClassInstanceTypeMetadata(cls=HYCOMGOMl0044D),
    description=_(u'HYCOMGOMl0044D instance.'))

AddArgumentMetadata(HYCOMGOMl0044D.__init__, u'variableName',
    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'salinity', 
u'temperature', u'u', u'v', u'w_velocity'], makeLowercase=True),
    description=_(
u"""HYCOM 4D variable (dimensions x, y, depth, and time), one of:

* salinity - Sea water salinity, in psu.

* temperature - Sea water potential temperature, in degrees C.

* u - Eastward sea water velocity, in m/s.

* v - Northward sea water velocity, in m/s.

* w_velocity - Upward sea water velocity, in m/s.

Please see the HYCOM documentation for more information about these
variables."""),
    arcGISDisplayName=_(u'HYCOM variable'))

CopyArgumentMetadata(HYCOMGOMl0043D.__init__, u'startYear', 
HYCOMGOMl0044D.__init__, u'startYear')
CopyArgumentMetadata(HYCOMGOMl0043D.__init__, u'endYear', 
HYCOMGOMl0044D.__init__, u'endYear')
CopyArgumentMetadata(HYCOMGOMl0043D.__init__, u'timeout', 
HYCOMGOMl0044D.__init__, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0043D.__init__, u'maxRetryTime', 
HYCOMGOMl0044D.__init__, u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0043D.__init__, u'cacheDirectory', 
HYCOMGOMl0044D.__init__, u'cacheDirectory')

CopyResultMetadata(HYCOMGOMl0043D.__init__, u'grid', HYCOMGOMl0044D.__init__, 
u'grid')

# Public method: HYCOMGOMl0044D.CreateArcGISRasters

AddMethodMetadata(HYCOMGOMl0044D.CreateArcGISRasters,
    shortDescription=_(u'Creates rasters for a HYCOM GOMl0.04 4D variable.'),
    longDescription=_HYCOMGOMl004_LongDescription % {u'name': 'tool'} + 
_('\n\n**References**\n\n') + _HYCOMGOMl004_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Create Rasters for HYCOM GOMl0.04 4D Variable'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Gulf of Mexico 1/25 Degree Analysis (GLMl0.04)\\4D Variables'),
    dependencies=[ArcGISDependency(9, 1), 
PythonAggregatedModuleDependency('numpy')])

AddArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'cls',
    typeMetadata=ClassOrClassInstanceTypeMetadata(cls=HYCOMGOMl0044D),
    description=_(u'HYCOMGOMl0044D class or instance.'))

CopyArgumentMetadata(HYCOMGOMl0044D.__init__, u'variableName', 
HYCOMGOMl0044D.CreateArcGISRasters, u'variableName')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'outputWorkspace', 
HYCOMGOMl0044D.CreateArcGISRasters, u'outputWorkspace')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'mode', 
HYCOMGOMl0044D.CreateArcGISRasters, u'mode')

AddArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, 
u'rasterNameExpressions',
    typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(), 
minLength=1),
    description=_(
u"""List of expressions specifying how the output rasters should be
named.

The default expression assumes you are storing rasters in a file
system directory and creates them in a tree structure with levels for
variable name, year, and depth. When storing rasters in a directory,
the final expression specifies the file name of the raster and any
preceding expressions specify subdirectories. The extension of the
final expression determines the output raster format: .asc for ArcInfo
ASCII Grid, .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE
file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for
GeoTIFF, or no extension for ArcInfo Binary Grid. The default
expression uses .img.

When storing rasters in a geodatabase, you should provide only one
expression. That expression specifies the raster's name.

Each expression may contain any sequence of characters permitted by
the output workspace. Each expression may optionally contain one or
more of the following case-sensitive codes. The tool replaces the
codes with appropriate values when creating each raster:

* %(VariableName)s - HYCOM variable represented in the output raster.

* %(Depth)f - depth of the output raster. The f may be preceded by
  Python's string formatting codes. Please see the Python
  documentation for more information.

* %%Y - four-digit year of the raster.

* %%m - two-digit month of the raster.

* %%d - two-digit day of the month of the raster.

* %%j - three-digit day of the year of the raster.
"""),
    arcGISDisplayName=_(u'Raster name expressions'))

CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'rasterCatalog', 
HYCOMGOMl0044D.CreateArcGISRasters, u'rasterCatalog')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'spatialExtent', 
HYCOMGOMl0044D.CreateArcGISRasters, u'spatialExtent')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'linearUnit', 
HYCOMGOMl0044D.CreateArcGISRasters, u'linearUnit')

AddArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'minDepth',
    typeMetadata=FloatTypeMetadata(minValue=0.0, maxValue=20000.0, 
canBeNone=True),
    description=_(
u"""Minimum depth, in meters, for the outputs to create.

The value must be between 0 and 20000, inclusive. Outputs will be
created for images with depths that are greater than or equal to the
minimum depth and less than or equal to the maximum depth. If you do
not specify a minimum depth, 0 will be used.

The value 20000 is a special code representing conditions at the
seafloor. Use this value if you need an estimate of "bottom
temperature" or the value of another variable at the seafloor. If this
value is requested, an output will be created with a fake depth of
20000 meters. The cells of this output will be assigned by stacking
all of the HYCOM depth layers and selecting the deepest cells that
have data. Because HYCOM depth layers are spaced farther apart at
deeper depths, the deepest HYCOM layer with data at a specific
location might be substantially shallower than the actual seafloor
depth. Bear this in mind when considering the likely accuracy of the
output."""),
    arcGISDisplayName=_(u'Minimum depth'),
    arcGISCategory=_(u'Spatiotemporal extent'))

AddArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'maxDepth',
    typeMetadata=FloatTypeMetadata(minValue=0.0, maxValue=20000.0, 
canBeNone=True),
    description=_(
u"""Maximum depth, in meters, for the outputs to create.

The value must be between 0 and 20000, inclusive. Outputs will be
created for images with depths that are greater than or equal to the
minimum depth and less than or equal to the maximum depth. If you do
not specify a maximum depth, 5500 will be used. This is the depth of
the deepest HYCOM layer.

The value 20000 is a special code representing conditions at the
seafloor. Please see the documenation for the Minimum Depth parameter
for discussions of this value."""),
    arcGISDisplayName=_(u'Maximum depth'),
    arcGISCategory=_(u'Spatiotemporal extent'))

CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'startDate', 
HYCOMGOMl0044D.CreateArcGISRasters, u'startDate')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'endDate', 
HYCOMGOMl0044D.CreateArcGISRasters, u'endDate')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'timeout', 
HYCOMGOMl0044D.CreateArcGISRasters, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'maxRetryTime', 
HYCOMGOMl0044D.CreateArcGISRasters, u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'cacheDirectory', 
HYCOMGOMl0044D.CreateArcGISRasters, u'cacheDirectory')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, 
u'calculateStatistics', HYCOMGOMl0044D.CreateArcGISRasters, 
u'calculateStatistics')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'buildPyramids', 
HYCOMGOMl0044D.CreateArcGISRasters, u'buildPyramids')

CopyResultMetadata(HYCOMGOMl0043D.CreateArcGISRasters, 
u'updatedOutputWorkspace', HYCOMGOMl0044D.CreateArcGISRasters, 
u'updatedOutputWorkspace')

# Public method: HYCOMGOMl0044D.CreateClimatologicalArcGISRasters

AddMethodMetadata(HYCOMGOMl0044D.CreateClimatologicalArcGISRasters,
    shortDescription=_(u'Creates climatological rasters for a HYCOM GOMl0.04 
4D variable'),
    longDescription=_(
u"""This tool produces rasters showing the climatological average
value (or other statistic) of a HYCOM GLMl0.04 4D variable. Given a
desired variable, a statistic, and a climatological bin definition,
this tool downloads daily images for each depth layer of the variable,
classifies them into bins, and produces a single raster for each bin.
Each cell of the raster is produced by calculating the statistic on
the values of that cell extracted from all of the rasters in the
bin.

""") + _HYCOMGOMl004_LongDescription % {u'name': 'tool'} + 
_('\n\n**References**\n\n') + _HYCOMGOMl004_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Create Climatological Rasters for HYCOM GOMl0.04 4D 
Variable'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Gulf of Mexico 1/25 Degree Analysis (GLMl0.04)\\4D Variables'),
    dependencies=[ArcGISDependency(9, 1), 
PythonAggregatedModuleDependency('numpy')])

CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'cls', 
HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'cls')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'variableName', 
HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'variableName')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'statistic', HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'statistic')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'binType', HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'binType')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'outputWorkspace', HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, 
u'outputWorkspace')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'mode', HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'mode')

AddArgumentMetadata(HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, 
u'rasterNameExpressions',
    typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(), 
minLength=1),
    description=_(
u"""List of expressions specifying how the output rasters should be
named.

The default expression assumes you are storing rasters in a file
system directory and creates them in a tree structure with levels for
variable, climatology bin type, and depth. When storing rasters in a
directory, the final expression specifies the file name of the raster
and any preceding expressions specify subdirectories. The extension of
the final expression determines the output raster format: .asc for
ArcInfo ASCII Grid, .bmp for BMP, .gif for GIF, .img for an ERDAS
IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif
for GeoTIFF, or no extension for ArcInfo Binary Grid. The default
expression uses .img.

When storing rasters in a geodatabase, you should provide only one
expression. That expression specifies the raster's name.

Each expression may contain any sequence of characters permitted by
the output workspace. Each expression may optionally contain one or
more of the following case-sensitive codes. The tool replaces the
codes with appropriate values when creating each raster:

* %(VariableName)s - HYCOM variable represented in the output raster.

* %(ClimatologyBinType)s - type of the climatology bin, either "Daily"
  if 1-day bins, "Xday" if multi-day bins (X is replaced by the
  duration), "Monthly" if 1-month bins, "Xmonth" if multi-month bins,
  or "Cumulative". If an ENSO bin type is used, "ENSO\\_" will be
  prepended to those strings (e.g. "ENSO_Daily", "ENSO_Monthly").

* %(ClimatologyBinName)s - name of the climatology bin corresponding
  represented by the output raster, either "dayXXX" for 1-day bins
  (XXX is replaced by the day of the year), "daysXXXtoYYY" for
  multi-day bins (XXX is replaced by the first day of the bin, YYY is
  replaced by the last day), "monthXX" for 1-month bins (XX is
  replaced by the month), "monthXXtoYY" (XX is replaced by the first
  month of the bin, YY by the last month), or "cumulative". If an ENSO
  bin type is used, "neutral\\_", "ElNino\\_", and "LaNina\\_" will be
  prepended to those strings for each of the three ENSO phased rasters
  (e.g. "neutral_cumulative", "ElNino_cumulative", and
  "LaNina_cumulative" when "ENSO Cumulative" bins are requested).

* %(Statistic)s - statistic that was calculated, in lowercase and with
  spaces replaced by underscores; one of: "count", "maximum", "mean",
  "minimum", "range", "standard_deviation", "Sum".

If the Bin Type is "Daily", the following additional codes are
available:

* %(FirstDay)i - first day of the year of the climatology bin
  represented by the output raster.

* %(LastDay)i - last day of the year of the climatology bin
  represented by the output raster. For 1-day climatologies, this will
  be the same as %(FirstDay)i.

If the Bin Type is "Monthly", the following additional codes are
available:

* %(FirstMonth)i - first month of the climatology bin represented by
  the output raster.

* %(DayOfFirstMonth)i - first day of the first month of the
  climatology bin represented by the output raster.

* %(LastMonth)i - last month of the climatology bin represented by
  the output raster.

* %(DayOfLastMonth)i - last day of the last month of the climatology
  bin represented by the output raster.

Note that the additional codes are integers and may be formatted using
"printf"-style formatting codes. For example, to format the FirstDay
as a three-digit number with leading zeros::

    %(FirstDay)03i
"""),
    arcGISDisplayName=_(u'Raster name expressions'))

CopyArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'binDuration', HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, 
u'binDuration')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'startDayOfYear', HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, 
u'startDayOfYear')

CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'spatialExtent', 
HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'spatialExtent')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'linearUnit', 
HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'linearUnit')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'minDepth', 
HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'minDepth')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'maxDepth', 
HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'maxDepth')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'startDate', 
HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'startDate')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'endDate', 
HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'endDate')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'timeout', 
HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'maxRetryTime', 
HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'cacheDirectory', 
HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'cacheDirectory')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, 
u'calculateStatistics', HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, 
u'calculateStatistics')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'buildPyramids', 
HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, u'buildPyramids')

CopyResultMetadata(HYCOMGOMl0044D.CreateArcGISRasters, 
u'updatedOutputWorkspace', HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, 
u'updatedOutputWorkspace')

# Public method: HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses

AddMethodMetadata(HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses,
    shortDescription=_(u'Creates line feature classes representing the 
vectors of HYCOM GOMl0.04 currents.'),
    longDescription=_(
u"""The lines output by this tool are similar to those in a "quiver
plot". When displayed on a map, they can help visualize the direction
and speed of ocean currents. In ArcMap, select the "Arrow at End"
symbology. You may also want to reduce the line decoration (the arrow)
to a small size, such as 2.0.

""") + _HYCOMGOMl004_LongDescription % {u'name': 'tool'} + 
_('\n\n**References**\n\n') + _HYCOMGOMl004_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Create Current Vectors for HYCOM GOMl0.04'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Gulf of Mexico 1/25 Degree Analysis (GLMl0.04)\\4D Variables'),
    dependencies=[ArcGISDependency(9, 1), 
PythonAggregatedModuleDependency('numpy')])

CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'cls', 
HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses, u'cls')

AddArgumentMetadata(HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses,
 u'outputWorkspace',
    typeMetadata=ArcGISWorkspaceTypeMetadata(createParentDirectories=True),
    description=_(
u"""Directory or geodatabase to receive the feature classes.

Unless you have a specific reason to store the feature classes in a
geodatabase, we recommend you store them in a directory because it
will be faster and allows them to be organized as a tree (of
shapefiles). If you do store the feature classes in a geodatabase, you
must change the Feature Class Name Expressions parameter; see below
for more information."""),
    arcGISDisplayName=_(u'Output workspace'))

AddArgumentMetadata(HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses,
 u'mode',
    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Add', 
u'Replace'], makeLowercase=True),
    description=_(
u"""Overwrite mode, one of:

* Add - create feature classes that do not exist and skip those that
  already exist. This is the default.

* Replace - create feature classes that do not exist and overwrite
  those that already exist.

The ArcGIS Overwrite Outputs geoprocessing setting has no effect on
this tool. If 'Replace' is selected the feature classes will be
overwritten, regardless of the ArcGIS Overwrite Outputs setting."""),
    arcGISDisplayName=_(u'Overwrite mode'))

AddArgumentMetadata(HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses,
 u'featureClassNameExpressions',
    typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(), 
minLength=1),
    description=_(
u"""List of expressions specifying how the output feature classes
should be named.

The default expression assumes the output workspace is a directory and
creates shapefiles in a tree structure with levels for the year and
depth.

If the output workspace is a geodatabase, you should provide only one
or two expressions. If you provide one expression, it specifies the
feature class name. If you provide two, the first one specifies the
feature dataset name and the second specifies the feature class name.

Each expression may contain any sequence of characters permitted by
the output workspace. Each expression may optionally contain one or
more of the following case-sensitive codes. The tool replaces the
codes with appropriate values when creating each feature class:

* %(Depth)f - depth of the output feature class. The f may be preceded
  by Python's string formatting codes. Please see the Python
  documentation for more information.

* %%Y - four-digit year of the output feature class.

* %%m - two-digit month of the output feature class.

* %%d - two-digit day of the month of the output feature class.

* %%j - three-digit day of the year of the output feature class.
"""),
    arcGISDisplayName=_(u'Feature class name expressions'))

AddArgumentMetadata(HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses,
 u'scaleFactor',
    typeMetadata=FloatTypeMetadata(mustBeGreaterThan=0.0),
    description=_(
u"""Factor for scaling lines lengths.

The length of each line is calculated by multiplying the magnitude of
the vector by this parameter. Use this parameter to scale the lines
output by this tool to lengths that are visually appealing. If the
lines are too short, they will resemble a grid of dots and you will
not be able to discern the flow of the vector field. If the lines are
too long, they will overlap each other and resemble a plate of
spaghetti.

If the vectors all have about the same magnitude, then a good approach
is to scale the lines so that the longest one is about as long as the
raster cell size. But if there are a few very long vectors, then you
may prefer to scale the lines so that the average-length vector is as
long as the raster cell size.

For HYCOM GOMl0.04 currents, the grid cell size is about 4500 m and
currents are given in m/s. So, if the maximum (or mean) velocity in
your region of interest is about 0.75 m/s:

    scale factor = 4500 / 0.75 = 6000
"""),
    arcGISDisplayName=_(u'Scale factor'),
    arcGISCategory=_(u'Vector options'))

AddArgumentMetadata(HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses,
 u'uniformLength',
    typeMetadata=BooleanTypeMetadata(),
    description=_(
u"""If False (the default) then the lengths of the lines are
determined by multiplying the magnitude of the vector by the Scale
Factor parameter.

If True, all lines will have the same length, which will be determined
by multiplying the cell size of the HYCOM grids by the the Scale
Factor. Use this option when you want to the lines' colors to indicate
the magnitude of the vector, rather than the lines' lengths. Start
with a Scale Factor of 1 and increase it or decrease it slightly to
achieve the desired visual effect."""),
    arcGISDisplayName=_(u'Create all lines with the same length'),
    arcGISCategory=_(u'Vector options'))

CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'spatialExtent', 
HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses, u'spatialExtent')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'linearUnit', 
HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses, u'linearUnit')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'minDepth', 
HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses, u'minDepth')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'maxDepth', 
HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses, u'maxDepth')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'startDate', 
HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses, u'startDate')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'endDate', 
HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses, u'endDate')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'timeout', 
HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'maxRetryTime', 
HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses, u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'cacheDirectory', 
HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses, u'cacheDirectory')

CopyResultMetadata(HYCOMGOMl0044D.CreateArcGISRasters, 
u'updatedOutputWorkspace', 
HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'updatedOutputWorkspace')

# Public method: HYCOMGOMl0044D.InterpolateAtArcGISPoints

AddMethodMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints,
    shortDescription=_(u'Interpolates HYCOM GOMl0.04 4D variables at 
points.'),
    longDescription=_HYCOMGOMl004_LongDescription % {u'name': 'tool'} + 
_('\n\n**References**\n\n') + _HYCOMGOMl004_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Interpolate HYCOM GOMl0.04 4D Variables at Points'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Gulf of Mexico 1/25 Degree Analysis (GLMl0.04)\\4D Variables'),
    dependencies=[ArcGISDependency(9, 1, requiresCOMInstantiation=True), 
PythonAggregatedModuleDependency('numpy')])

CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'cls', 
HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'cls')

AddArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, 
u'variableNames',
    
typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(allowedValues=[u'salinity',
 u'temperature', u'u', u'v', u'w_velocity'], makeLowercase=True), 
minLength=1),
    description=_(
u"""HYCOM 4D variables to interpolate:

* salinity - Sea water salinity, in psu.

* temperature - Sea water potential temperature, in degrees C.

* u - Eastward sea water velocity, in m/s.

* v - Northward sea water velocity, in m/s.

* w_velocity - Upward sea water velocity, in m/s.

Please see the HYCOM documentation for more information about these
variables.

For each variable that you select, you must also specify a field of
the points to receive the interpolated value."""),
    arcGISDisplayName=_(u'HYCOM variables to interpolate'))

CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'points', 
HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'points')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'valueFields', HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'valueFields')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'tField', 
HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'tField')

AddArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'zField',
    typeMetadata=ArcGISFieldTypeMetadata(canBeNone=True, mustExist=True, 
allowedFieldTypes=[u'short', u'long', u'float', u'double']),
    description=_(
u"""Field of the points that specifies the depth of the point, in
meters.

The depth 0 represents the surface. The sign of the depth coordinate
is ignored (e.g. the values 10 and -10 are both interpreted as 10 m
below the surface).

The depth 20000 is a special code representing conditions at the
seafloor. Use this value if you need an estimate of "bottom
temperature" or the value of another variable at the seafloor. The
interpolated value will be taken from the deepest HYCOM layer with
data at the X,Y location. Because HYCOM depth layers are spaced
farther apart at deeper depths, the deepest HYCOM layer with data
might be substantially shallower than the actual seafloor depth. Bear
this in mind when considering the likely accuracy of interpolated
value.

If a depth field is not specified, the Depth Value parameter will be
used. If that parameter is not provided, the z value of the points
will be used. If the points do not have a z value, an error will be
reported."""),
    arcGISDisplayName=_(u'Depth field'),
    arcGISParameterDependencies=[u'points'])

AddArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'zValue',
    typeMetadata=FloatTypeMetadata(canBeNone=True),
    description=_(
u"""Depth of the points. This parameter is ignored if the Depth Field
parameter is provided.

Use this parameter when your points do not have a depth field and you
want to use the same depth for all of the points.

The depth 0 represents the surface. The sign of the depth coordinate
is ignored (e.g. the values 10 and -10 are both interpreted as 10 m
below the surface).

The depth 20000 is a special code representing conditions at the
seafloor. Use this value if you need an estimate of "bottom
temperature" or the value of another variable at the seafloor. The
interpolated value will be taken from the deepest HYCOM layer with
data at the X,Y location. Because HYCOM depth layers are spaced
farther apart at deeper depths, the deepest HYCOM layer with data
might be substantially shallower than the actual seafloor depth. Bear
this in mind when considering the likely accuracy of interpolated
value."""),
    arcGISDisplayName=_(u'Depth value'))

AddArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'method',
    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Nearest', 
u'Linear'], makeLowercase=True),
    description=_(
u"""Interpolation method to use, one of:

* Nearest - nearest neighbor interpolation. The interpolated value
  will simply be the value of the cell that contains the point. This
  is the default.

* Linear - linear interpolation (also known as quadrilinear
  interpolation). This method averages the values of the 16 nearest
  cells in the x, y, depth, and time dimensions, weighting the
  contribution of each cell by the area of it that would be covered by
  a hypothetical cell centered on the point being interpolated. If the
  cell containing the point contains NoData, the result is NoData. If
  any of the other 15 cells contain NoData, they are omitted from the
  average, and the result is based on the weighted average of the
  cells that do contain data. This is the same algorithm implemented
  by the ArcGIS Spatial Analyst's Extract Values to Points tool.
"""),
    arcGISDisplayName=_(u'Interpolation method'))

CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'where', 
HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'where')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'noDataValue', HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'noDataValue')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'timeout', 
HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'maxRetryTime', 
HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'cacheDirectory', 
HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'cacheDirectory')

AddArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, 
u'orderByFields',
    
typeMetadata=ListTypeMetadata(elementType=ArcGISFieldTypeMetadata(mustExist=True),
 minLength=1, canBeNone=True),
    description=_(
u"""Fields for defining the order in which the points are processed.

The points may be processed faster if they are ordered
spatiotemporally, such that points that are close in space and time
are processed sequentially. Ordering the points this way increases the
probability that the value of a given point can be interpolated from
data that is cached in memory, rather than from data that must be read
from the disk or network, which is much slower. Choose fields that
faciliate this. For example, if your points represent the locations of
animals tracked by satellite telemetry, order the processing first by
the animal ID and then by the transmission date or number.

If you omit this parameter, the Date and Depth Fields will be used
automatically.

This parameter requires ArcGIS 9.2 or later."""),
    arcGISDisplayName=_(u'Order by fields'),
    arcGISCategory=_(u'Performance tuning options'),
    arcGISParameterDependencies=[u'points'],
    dependencies=[ArcGISDependency(9, 2)])

CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'numBlocksToCacheInMemory', HYCOMGOMl0044D.InterpolateAtArcGISPoints, 
u'numBlocksToCacheInMemory')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'xBlockSize', 
HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'xBlockSize')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'yBlockSize', 
HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'yBlockSize')

AddArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'zBlockSize',
    typeMetadata=IntegerTypeMetadata(minValue=0, canBeNone=True),
    description=_(
u"""Size of the blocks of HYCOM data to cache in memory, in the z
direction (depth). The size is given as the number of cells.

If this parameter is 0, no blocks will be cached in memory."""),
    arcGISDisplayName=_(u'In-memory cache block size, in Z direction'),
    arcGISCategory=_(u'Performance tuning options'))

CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'tBlockSize', 
HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'tBlockSize')

CopyResultMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'updatedPoints', HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'updatedPoints')

# Public method: HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters

_CayulaCornillonFrontsOverview = (
u"""**Overview**

This tool efficiently downloads 2D time/depth slices of a specified 4D
HYCOM variable, executes the Cayula and Cornillon SIED algorithm to
identify fronts in each 2D slice, and creates rasters showing the
locations of the fronts.

This tool is complicated and has a lot of parameters. For the best
chance of success, please read all of the documentation carefully.

We configured the default parameters of this tool to balance a number
of tradeoffs. Our default values are different than those used in
Cayula and Cornillon's original study. For example, the original study
used a 32x32 moving window while ours is somewhat smaller because we
found that the algorithm appeared to detect more fronts in HYCOM
images when a smaller window was used. This is probably due to the
fact that Cayula and Cornillon's original data had a spatial
resolution of about 1 km, while HYCOM has a substantially larger
resolution. The theoretical basis of the algorithm requires that only
one front appear in the window; the 32x32 window appeared to be too
large to work well with HYCOM's coarser resolution, often enclosing
multiple fronts.

We believe our default values work better for HYCOM than Cayula and
Cornillon's original values, but we have not attempted to formally
validate the results. Please keep that in mind when applying this tool
in your own studies.

Note that the Front Cleanup Options, which are enabled by default,
require that MATLAB 2007b or the MATLAB Component Runtime (MCR) 7.7 be
installed. You can download a free copy of the MCR 7.7 from
http://code.nicholas.duke.edu/projects/mget/wiki/MCR. If you do not
wish to install MATLAB or the MCR, you must disable the Front Cleanup
Options.""")

AddMethodMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
    shortDescription=_(u'Creates rasters indicating the positions of fronts 
in the 2D slices of a HYCOM GOMl0.04 4D variable using the Cayula and 
Cornillon (1992) single image edge detection (SIED) algorithm.'),
    longDescription=_CayulaCornillonFrontsOverview + _(
u"""

**The HYCOM GOMl0.04 Dataset**

""") + _HYCOMGOMl004_LongDescription % {u'name': 'tool'} + _(
u"""

**The SIED Algorithm**

""") + _SIEDDescription + _(
u"""
**References**

""") + _HYCOMGOMl004_References + '\n\n' + _SIEDReferences,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Find Cayula-Cornillon Fronts in HYCOM GOMl0.04 4D 
Variable'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Gulf of Mexico 1/25 Degree Analysis (GLMl0.04)\\4D Variables'),
    dependencies=[ArcGISDependency(9, 1), 
PythonAggregatedModuleDependency('numpy')])

CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'cls', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, u'cls')

AddArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'variableName',
    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'salinity', 
u'temperature'], makeLowercase=True),
    description=_(
u"""HYCOM 4D variable (dimensions x, y, depth, and time), one of:

* salinity - Sea water salinity, in psu.

* temperature - Sea water potential temperature, in degrees C.

The Cayula and Cornillon SIED algorithm has traditionally been applied to
surface temperature, but in principle, it can be applied to salinity
as well."""),
    arcGISDisplayName=_(u'HYCOM variable'))

AddArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'minPopMeanDifference',
    typeMetadata=FloatTypeMetadata(mustBeGreaterThan=0.),
    description=_(
u"""Minimum difference, in degrees C or psu, between the mean
temperatures or salinities of two adjacent populations of pixels for a
front to be detected between those two populations.

The Cayula and Cornillon algorithm passes a moving window over the
image, checking each window for a bimodal distribution in the values
of the pixels within it. When the algorithm detects a bimodal
distribution, it computes the mean values of the two populations and
compares the difference between the means to this threshold. If the
difference is less than this threshold, the algorithm concludes there
is no front present and moves on to the next window.

You can use this parameter to eliminate weak fronts by selecting a
value that corresponds to a desired minimum mean temperature or
salinity difference. Larger values will detect fewer fronts; smaller
values will detect more fronts."""),
    arcGISDisplayName=_(u'Front detection threshold'))

AddArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'outputWorkspace',
    typeMetadata=ArcGISWorkspaceTypeMetadata(createParentDirectories=True),
    description=_(
u"""Directory or geodatabase to receive the rasters.

Unless you have a specific reason to store the rasters in a
geodatabase, we recommend you store them in a directory because it
will be much faster and allows the rasters to be organized in a tree.
If you do store the rasters in a geodatabase, you must change the
Raster Name Expressions parameter; the documentation for that
parameter for more information.

The front location images will be written as 8-bit signed integer
rasters. Each pixel can have one of three values:

* NoData - the pixel was never a candidate for containing a front,
  either because it was masked or because because it did not appear in
  any histogram windows that had sufficiently large numbers of
  non-masked pixels to proceed with the histogramming step of the
  Cayula and Cornillon algorithm.

* 0 - The pixel was a candidate for containing a front -- it was not
  masked and it appeared in at least one histogram window with a
  sufficient number of non-masked pixels to proceed with the
  histogramming step -- but it was never marked as a front pixel in
  any of the histogram windows it appeared in.

* 1 - The pixel was a candidate for containing a front and it was marked
  as a front pixel in at least one of the histogram windows it
  appeared in.

You may also instruct this tool to write several kinds of diagnostic
outputs. These can help you understand why a front was or was not
identified at a specific location. Please see the documentation for
the diagnostic outputs for more information.

The front location images described above are constructed by
performing a classification of two of the diagnostic outputs, the
"candidate counts" and "front counts" images, and then applying the
Fill Holes, Thin, and Minimum Front Size options."""),
    arcGISDisplayName=_(u'Output workspace'))

CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'mode', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, u'mode')

AddArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'rasterNameExpressions',
    typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(), 
minLength=1),
    description=_(
u"""List of expressions specifying how the output rasters should be
named.

The default expression assumes you are storing rasters in a file
system directory and creates them a tree structure with levels for the
variable name and year. When storing rasters in a directory, the final
expression specifies the file name of the raster and any preceding
expressions specify subdirectories. The extension of the final
expression determines the output raster format: .asc for ArcInfo ASCII
Grid, .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE file, .jpg
for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for GeoTIFF, or no
extension for ArcInfo Binary Grid. The default expression uses .img.

When storing rasters in a geodatabase, you should provide only one
expression. That expression specifies the raster's name.

Each expression may contain any sequence of characters permitted by
the output workspace. Each expression may optionally contain one or
more of the following case-sensitive codes. The tool replaces the
codes with appropriate values when creating each raster:

* %(VariableName)s - HYCOM variable used to produce the output raster.
  
* %(Depth)f - depth of the output raster. The f may be preceded by
  Python's string formatting codes. Please see the Python
  documentation for more information.

* %(ImageType)s - type of image represented in the output raster,
  either "floc" (front locations), "ccnt" (candidate counts), "fcnt"
  (front counts), "wsco" (window status codes), or "wsvl" (window
  status values).

* %%Y - four-digit year of the raster.

* %%m - two-digit month of the first day of the raster.

* %%d - two-digit day of the month of the first day of the raster.

* %%j - three-digit day of the year of the first day of the raster.
"""),
    arcGISDisplayName=_(u'Raster name expressions'))

CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'medianFilterWindowSize', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'medianFilterWindowSize')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'histogramWindowSize', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'histogramWindowSize')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'histogramWindowStride', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'histogramWindowStride')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'minPropNonMaskedCells', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minPropNonMaskedCells')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'minPopProp', HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minPopProp')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'minTheta', HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minTheta')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'minSinglePopCohesion', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minSinglePopCohesion')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'minGlobalPopCohesion', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minGlobalPopCohesion')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'threads', HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'threads')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'fillHoles', HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'fillHoles')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'thin', HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, u'thin')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'minSize', HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minSize')

CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'spatialExtent', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, u'spatialExtent')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'linearUnit', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, u'linearUnit')

AddArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'minDepth',
    typeMetadata=FloatTypeMetadata(minValue=0.0, maxValue=5500.0, 
canBeNone=True),
    description=_(
u"""Minimum depth, in meters, for the rasters to create.

The value must be between 0 and 5500, inclusive. Rasters will be
created for images with depths that are greater than or equal to the
minimum depth and less than or equal to the maximum depth. If you do
not specify a minimum depth, 0 will be used.

Unlike some of the other 4D HYCOM tools, this tool does not support
the use of the value 20000 to represent the values at the
seafloor."""),
    arcGISDisplayName=_(u'Minimum depth'),
    arcGISCategory=_(u'Spatiotemporal extent'))

AddArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'maxDepth',
    typeMetadata=FloatTypeMetadata(minValue=0.0, maxValue=5500.0, 
canBeNone=True),
    description=_(
u"""Maximum depth, in meters, for the rasters to create.

The value must be between 0 and 5500, inclusive. Rasters will be
created for images with depths that are greater than or equal to the
minimum depth and less than or equal to the maximum depth. If you do
not specify a maximum depth, 5500 will be used. This is the depth of
the deepest HYCOM layer.

Unlike some of the other 4D HYCOM tools, this tool does not support
the use of the value 20000 to represent the values at the
seafloor."""),
    arcGISDisplayName=_(u'Maximum depth'),
    arcGISCategory=_(u'Spatiotemporal extent'))

CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'startDate', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, u'startDate')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'endDate', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, u'endDate')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'timeout', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'maxRetryTime', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'cacheDirectory', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, u'cacheDirectory')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, 
u'calculateStatistics', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'calculateStatistics')

AddArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'buildRAT',
    typeMetadata=BooleanTypeMetadata(),
    description=_BuildRATDescription,
    arcGISDisplayName=_(u'Build raster attribute tables'),
    arcGISCategory=_(u'Additional raster processing options'))

CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'buildPyramids', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, u'buildPyramids')

AddArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'outputCandidateCounts',
    typeMetadata=BooleanTypeMetadata(),
    description=_(
u"""If True, candidate counts diagnostic images will be created.

Candidate counts images contain 16-bit unsigned integers and indicate
how many times each pixel of the corresponding SST image was a
candidate for containing a front, i.e. the number of times it appeared
in a histogram window that had a sufficiently large number of
non-masked pixels to proceed with the histogramming step of the
Cayula and Cornillon algorithm. If the histogram window stride is less
than the window size, successive histogram windows will overlap, and
many pixels will have candidate counts greater than 1. Masked pixels
can never be candidates for containing a front so they will always
have the value 0."""),
    arcGISDisplayName=_(u'Create candidate counts rasters'),
    arcGISCategory=_(u'Optional diagnostic outputs'))

AddArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'outputFrontCounts',
    typeMetadata=BooleanTypeMetadata(),
    description=_(
u"""If True, front counts diagnostic images will be created.

Front counts images contain 16-bit unsigned integers and indicate how
many times each pixel of the corresponding SST image was found to
contain a front. The value will range from 0 (it never contained a
front) to the candidate count value for the pixel (it always contained
a front in every histogram window that contained it).

The Front Cleanup Options are not applied to the front counts
image."""),
    arcGISDisplayName=_(u'Create front counts rasters'),
    arcGISCategory=_(u'Optional diagnostic outputs'))

AddArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'outputWindowStatusCodes',
    typeMetadata=BooleanTypeMetadata(),
    description=_(
u"""If True, diagnostic images of window status codes will be created.

Window status code images contain 8-bit unsigned integers that
indicate the result of the algorithm for the histogram window centered
on the pixel. You can use this image to diagnose why the algorithm did
not find fronts in a particular region of your image.

The algorithm result will be one of these code numbers:

""" + _WindowStatusCodes),
    arcGISDisplayName=_(u'Create window status code rasters'),
    arcGISCategory=_(u'Optional diagnostic outputs'))

AddArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'outputWindowStatusValues',
    typeMetadata=BooleanTypeMetadata(),
    description=_(
u"""If True, diagnostic images of window status values will be
created.

Window status values images contain 32-bit floating point values
to be used in conjunction with the window status codes when diagnosing
the results of the algorithm. The value of each pixel depends on the
window status code for that pixel:

""" + _WindowStatusValues),
    arcGISDisplayName=_(u'Create window status value rasters'),
    arcGISCategory=_(u'Optional diagnostic outputs'))

CopyResultMetadata(HYCOMGOMl0044D.CreateArcGISRasters, 
u'updatedOutputWorkspace', 
HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'updatedOutputWorkspace')

###############################################################################
# Metadata: _HYCOMGridGLBa0083D class
###############################################################################

AddClassMetadata(_HYCOMGridGLBa0083D,
    shortDescription=_(u'An OPeNDAPGrid for a 3D variable of a HYCOM GOMl0.04 
OPeNDAP URL.'),
    longDescription=_(
u"""This class is intended for private use within GeoEco and is not
intended for external callers."""))

###############################################################################
# Metadata: HYCOMGLBa008Equatorial3D class
###############################################################################

_HYCOMGLBa008Equatorial_LongDescription = _(
u"""This %(name)s accesses the "All Experiments (Aggregated)" dataset
of the
`HYCOM + NCODA Global 1/12 Degree Analysis (GLBa0.08) 
<http://www.hycom.org/dataserver/glb-analysis/>`_
using the `OPeNDAP <http://opendap.org/>`_ protocol.

The dataset consists of a collection of 3D and 4D gridded variables.
The 3D variables represent conditions at the surface of the ocean and
have dimensions of x, y, and time. The 4D variables represent
conditions at depth and have dimensions of x, y, depth, and time.

HYCOM uses an unusual georeferencing scheme in which the Earth is
represented by a grid that uses three different projections. The
southern portion of the grid, encompassing approximately 66 S to 78 S,
is in an equirectangular projection, with rectangular cells having the
dimensions of 0.08 degrees longitude and 0.032 degrees latitude. The
equatorial portion of the grid, encompassing approximately 47 N to 66
S, is in a Mercator projection with square cells approximately 8.9 km
on a side (equivalent to 0.08 degrees of longitude at the equator).
The northern portion of the grid, encompassing approximately 90 N to
47 N, is in a complicated "bi-polar" projection.

This %(name)s accesses the equatorial (Mercator) portion of the HYCOM
grid, and is therefore very appropriate if your region of interest is
between 47 N and 66 S. This tool can optionally extend the northern
extent of of the Mercator grid to 60 N by interpolating values from
the bi-polar region. If your region of interest is between 47 N and 60
N, enable that option but review the HYCOM data carefully to ensure
the interpolated values appear to be reasonable for your application.
Also be aware of the increasing map distortion caused by the Mercator
projection as you approach high latitudes; at 60 degrees latitude, the
cells are actually only one-half as wide (4.5 km) as the projection
claims (8.9 km).

If your area of interest is north of 60 N or south of 66 S, do not use
this %(name)s because it cannot access HYCOM data for those regions.

For more information on HYCOM's georeferencing, please see the
`HYCOM User's Guide <http://www.hycom.org/hycom/documentation>`_,
chapter 3: The HYCOM Grid, sections 2.3: I/O File Formats in HYCOM,
and 5.1: File "regional.grid.[ab]".

The temporal extent of this dataset is 11 November 2003 to several
days beyond the current date, with a time step of 1 day. The time
slices represent the instantaneous condition of the ocean estimated at
00:00 UTC on each day.

The HYCOM documentation states that HYCOM provides a five day forecast
and five day hindcast from the current date, although we have
regularly observed netCDF files on their servers that suggested this
window actually extends seven days in both directions. HYCOM revises
the data within this window daily, using the latest ocean observations
assimilated from buoys, satellites, and other sensors. Use caution
when working with time slices close to the current date, as it appears
that time slices continue to be revised until they are 7 days older
than the current date.

Occasionally, HYCOM fails to generate data for a time slice,
presumably due to an outage or other problem in their data processing
infrastructure. For example, in 2004, HYCOM failed to generate data
for three of the 366 time slices of that year. Although HYCOM omits
these time slices from their server, this %(name)s represents them as
grids filled with the No Data value.

The dataset's 4D variables are estimated at 33 depth levels: 0, 10,
20, 30, 50, 75, 100, 125, 150, 200, 250, 300, 400, 500, 600, 700, 800,
900, 1000, 1100, 1200, 1300, 1400, 1500, 1750, 2000, 2500, 3000, 3500,
4000, 4500, 5000, and 5500 m.""")

_HYCOMGLBa008Equatorial_References = _(
u"""Chassignet, E.P., Hurlburt, H.E., Metzger, E.J., Smedstad, O.M.,
Cummings, J.A., Halliwell, G.R., Bleck, R., Baraille, R., Wallcraft.,
A.J., Lozano, C., Tolman, H.L., Srinivasan, A., Hankin, S., Cornillon,
P., Weisberg, R., Barth, A., He, R., Werner, F. and Wilkin, J. (2009).
US GODAE: Global Ocean Prediction with the HYbrid Coordinate Ocean
Model (HYCOM). Oceanography, 22, 64-75.

The HYCOM User's Guide and many other technical documents are
available on the
`HYCOM web site <http://www.hycom.org/hycom/documentation>`_.""")

AddClassMetadata(HYCOMGLBa008Equatorial3D,
    shortDescription=_(u'Represents a 3D variable of the equatorial 
(Mercator) region of HYCOM GLBa0.08 as a Grid Dataset.'),
    longDescription=_HYCOMGLBa008Equatorial_LongDescription % {u'name': 
'class'} + _('\n\n**References**\n\n') + _HYCOMGLBa008Equatorial_References)

# Constructor

AddMethodMetadata(HYCOMGLBa008Equatorial3D.__init__,
    shortDescription=_(u'Constructs a new HYCOMGLBa008Equatorial3D 
instance.'),
    isExposedToPythonCallers=True,
    dependencies=[PythonAggregatedModuleDependency('numpy')])

AddArgumentMetadata(HYCOMGLBa008Equatorial3D.__init__, u'self',
    typeMetadata=ClassInstanceTypeMetadata(cls=HYCOMGLBa008Equatorial3D),
    description=_(u'HYCOMGLBa008Equatorial3D instance.'))

AddArgumentMetadata(HYCOMGLBa008Equatorial3D.__init__, u'variableName',
    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'emp', u'mld', 
u'mlp', u'qtot', u'ssh', u'surface_salinity_trend', 
u'surface_temperature_trend'], makeLowercase=True),
    description=_(
u"""HYCOM 3D variable (dimensions x, y, and time), one of:

* emp - Water flux into the ocean, in kg/m^2/s.

* mld - Mixed layer thickness, in m, defined as the depth at which the
  temperature change from the surface temperature is 0.2 degrees C.

* mlp - Mixed layer thickness, in m, defined as the depth at which the
  pressure change from the surface pressure is 0.03 kg/m^3.

* qtot - Surface downward heat flux, in W/m^2.

* ssh - Sea surface height, in m, above the HYCOM reference spheroid.

* surface_salinity_trend - Surface salinity trend, in psu/day.

* surface_temperature_trend - Surface temperature trend, in degrees
  C/day.

Please see the HYCOM documentation for more information about these
variables."""),
    arcGISDisplayName=_(u'HYCOM variable'))

AddArgumentMetadata(HYCOMGLBa008Equatorial3D.__init__, u'extendYExtent',
    typeMetadata=BooleanTypeMetadata(),
    description=_(
u"""If this option is enabled, the northern extent of the HYCOM data
will be extended from 47 N to 60 N by interpolating values from the
bi-polar portion of HYCOM's grid.

The northern extent of the Mercator region of HYCOM's grid is about 47
N. Above this latitude, HYCOM uses a complicated bi-polar projection
that cannot be represented by most GIS programs. Because of that, this
tool does not provide direct access to the bi-polar data above 47 N.
But if this option is enabled, the tool will extend the Mercator
region up to 60 N by interpolating values above 47 N from the bi-polar
region using the nearest neighbor algorithm. Under this scheme, the
value of each Mercator cell above 47 N will be copied from the
bi-polar cell that is closest in latitude and longitude. A nearest
neighbor algorithm was used for its computational simplicity and
efficiency and to preserve sharp gradients that would be smoothed out
by alternative techniques."""),
    arcGISDisplayName=_(u'Extend northern extent of HYCOM data from 47 N to 
60 N'),
    arcGISCategory=_(u'Spatiotemporal extent'))

CopyArgumentMetadata(HYCOMGOMl0043D.__init__, u'timeout', 
HYCOMGLBa008Equatorial3D.__init__, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0043D.__init__, u'maxRetryTime', 
HYCOMGLBa008Equatorial3D.__init__, u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0043D.__init__, u'cacheDirectory', 
HYCOMGLBa008Equatorial3D.__init__, u'cacheDirectory')

AddResultMetadata(HYCOMGLBa008Equatorial3D.__init__, u'grid',
    typeMetadata=ClassInstanceTypeMetadata(cls=HYCOMGLBa008Equatorial3D),
    description=_(u'HYCOMGLBa008Equatorial3D instance.'))

# Public method: HYCOMGLBa008Equatorial3D.CreateArcGISRasters

AddMethodMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters,
    shortDescription=_(u'Creates rasters for a 3D variable of the equatorial 
(Mercator) region of the HYCOM GLBa0.08 dataset.'),
    longDescription=_HYCOMGLBa008Equatorial_LongDescription % {u'name': 
'tool'} + _('\n\n**References**\n\n') + _HYCOMGLBa008Equatorial_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Create Rasters for HYCOM GLBa0.08 Equatorial 3D 
Variable'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Global 1/12 Degree Analysis (GLBa0.08)\\Equatorial Region (47 N to 66 S)\\3D 
Variables'),
    dependencies=[ArcGISDependency(9, 1), 
PythonAggregatedModuleDependency('numpy')])

AddArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'cls',
    
typeMetadata=ClassOrClassInstanceTypeMetadata(cls=HYCOMGLBa008Equatorial3D),
    description=_(u'HYCOMGLBa008Equatorial3D class or instance.'))

CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.__init__, u'variableName', 
HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'variableName')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'outputWorkspace', 
HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'outputWorkspace')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'mode', 
HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'mode')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, 
u'rasterNameExpressions', HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'rasterNameExpressions')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'rasterCatalog', 
HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'rasterCatalog')

AddArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'rotationOffset',
    typeMetadata=FloatTypeMetadata(canBeNone=True),
    description=_(
u"""Distance to rotate the output rasters about the polar axis, in the
units specified by the Linear Units parameter. If not provided, the
output rasters will be centered on approximately 105.88 W.

Use this parameter to shift the center longitude of the rasters to a
different location. Positive values shift it to the east, negative
values to the west. The rasters can only be rotated in whole grid
cells. The value you provide will be rounded off to the closest cell.

For example, to center the rasters on the Prime Meridian, provide
105.88 for this parameter and specify 'Degrees' for the Linear Unit
parameter. But because 105.88 is not evenly divisible by the the cell
size (0.08 degrees), it will be rounded to 105.92 and the central
meridian of the rasters will actually be 0.04, rather than 0."""),
    arcGISDisplayName=_(u'Rotate raster by'),
    arcGISCategory=_(u'Spatiotemporal extent'))

CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.__init__, u'extendYExtent', 
HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'extendYExtent')

AddArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'spatialExtent',
    typeMetadata=EnvelopeTypeMetadata(canBeNone=True),
    description=_(
u"""Spatial extent of the output rasters, in the units specified by
the Linear Units parameter.

If you do not specify a spatial extent, it will default to
approximately 47 N to 66 S, (unless you enable the option that extends
the northernmost extent to 60 N). The rasters can only be clipped in
whole grid cells. The values you provide will be rounded off to the
closest cell."""),
    arcGISDisplayName=_(u'Spatial extent'),
    arcGISCategory=_(u'Spatiotemporal extent'))

CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'linearUnit', 
HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'linearUnit')

AddArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'startDate',
    typeMetadata=DateTimeTypeMetadata(canBeNone=True),
    description=_(
u"""Start date for the outputs to create.

Outputs will be created for images that occur on or after the start
date and on or before the end date. The HYCOM GOMa0.08 dataset
provides a five-day forecast; its temporal extent ranges from 11
November 2003 to today's date plus five days. If you do not specify a
start date, 11 November 2003 will be used.

The time component of the start date is ignored."""),
    arcGISDisplayName=_(u'Start date'),
    arcGISCategory=_(u'Spatiotemporal extent'))

AddArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'endDate',
    typeMetadata=DateTimeTypeMetadata(canBeNone=True),
    description=_(
u"""End date for the outputs to create.

Outputs will be created for images that occur on or after the start
date and on or before the end date. The HYCOM GLBa0.08 dataset
provides a five-day forecast; its temporal extent ranges from 11
November 2003 to today's date plus five days. If you do not specify an
end date, the most recent day available will be used (typically
today's date plus five days).

The time component of the end date is ignored."""),
    arcGISDisplayName=_(u'End date'),
    arcGISCategory=_(u'Spatiotemporal extent'))

CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'timeout', 
HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'maxRetryTime', 
HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'cacheDirectory', 
HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'cacheDirectory')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, 
u'calculateStatistics', HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'calculateStatistics')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateArcGISRasters, u'buildPyramids', 
HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'buildPyramids')

CopyResultMetadata(HYCOMGOMl0043D.CreateArcGISRasters, 
u'updatedOutputWorkspace', HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'updatedOutputWorkspace')

# Public method: HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters

AddMethodMetadata(HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters,
    shortDescription=_(u'Creates climatological rasters for a 3D variable of 
the equatorial (Mercator) region of the HYCOM GLBa0.08 dataset'),
    longDescription=_(
u"""This tool produces rasters showing the climatological average
value (or other statistic) of a HYCOM GLBa0.08 3D variable. Given a
desired variable, a statistic, and a climatological bin definition,
this tool downloads daily images for the variable, classifies them
into bins, and produces a single raster for each bin. Each cell of the
raster is produced by calculating the statistic on the values of that
cell extracted from all of the rasters in the bin.

""") + _HYCOMGLBa008Equatorial_LongDescription % {u'name': 'tool'} + 
_('\n\n**References**\n\n') + _HYCOMGLBa008Equatorial_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Create Climatological Rasters for HYCOM GLBa0.08 
Equatorial 3D Variable'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Global 1/12 Degree Analysis (GLBa0.08)\\Equatorial Region (47 N to 66 S)\\3D 
Variables'),
    dependencies=[ArcGISDependency(9, 1), 
PythonAggregatedModuleDependency('numpy')])

CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'cls', 
HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, u'cls')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.__init__, u'variableName', 
HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, u'variableName')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'statistic', HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'statistic')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'binType', HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'binType')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'outputWorkspace', 
HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'outputWorkspace')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'mode', HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, u'mode')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'rasterNameExpressions', 
HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'rasterNameExpressions')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'binDuration', HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'binDuration')
CopyArgumentMetadata(HYCOMGOMl0043D.CreateClimatologicalArcGISRasters, 
u'startDayOfYear', 
HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, u'startDayOfYear')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'rotationOffset', 
HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, u'rotationOffset')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'extendYExtent', HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'extendYExtent')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'spatialExtent', HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'spatialExtent')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'linearUnit', HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'linearUnit')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'startDate', HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'startDate')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'endDate', HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'endDate')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'timeout', HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'timeout')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'maxRetryTime', HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'maxRetryTime')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'cacheDirectory', 
HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, u'cacheDirectory')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'calculateStatistics', 
HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'calculateStatistics')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'buildPyramids', HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'buildPyramids')

CopyResultMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'updatedOutputWorkspace', 
HYCOMGLBa008Equatorial3D.CreateClimatologicalArcGISRasters, 
u'updatedOutputWorkspace')

# Public method: HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints

AddMethodMetadata(HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints,
    shortDescription=_(u'Interpolates 3D variables of the equatorial 
(Mercator) region of the HYCOM GLBa0.08 dataset at points.'),
    longDescription=_HYCOMGLBa008Equatorial_LongDescription % {u'name': 
'tool'} + _('\n\n**References**\n\n') + _HYCOMGLBa008Equatorial_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Interpolate HYCOM GLBa0.08 Equatorial 3D Variables 
at Points'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Global 1/12 Degree Analysis (GLBa0.08)\\Equatorial Region (47 N to 66 S)\\3D 
Variables'),
    dependencies=[ArcGISDependency(9, 1, requiresCOMInstantiation=True), 
PythonAggregatedModuleDependency('numpy')])

CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, u'cls', 
HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, u'cls')

AddArgumentMetadata(HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, 
u'variableNames',
    
typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(allowedValues=[u'emp',
 u'mld', u'mlp', u'qtot', u'ssh', u'surface_salinity_trend', 
u'surface_temperature_trend'], makeLowercase=True), minLength=1),
    description=_(
u"""HYCOM 3D variables to interpolate:

* emp - Water flux into the ocean, in kg/m^2/s.

* mld - Mixed layer thickness, in m, defined as the depth at which the
  temperature change from the surface temperature is 0.2 degrees C.

* mlp - Mixed layer thickness, in m, defined as the depth at which the
  pressure change from the surface pressure is 0.03 kg/m^3.

* qtot - Surface downward heat flux, in W/m^2.

* ssh - Sea surface height, in m, above the HYCOM reference spheroid.

* surface_salinity_trend - Surface salinity trend, in psu/day.

* surface_temperature_trend - Surface temperature trend, in degrees
  C/day.

Please see the HYCOM documentation for more information about these
variables.

For each variable that you select, you must also specify a field of
the points to receive the interpolated value."""),
    arcGISDisplayName=_(u'HYCOM variables to interpolate'))

CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'points', 
HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, u'points')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'valueFields', HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, 
u'valueFields')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'tField', 
HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, u'tField')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'method', 
HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, u'method')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'extendYExtent', HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, 
u'extendYExtent')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'where', 
HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, u'where')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'noDataValue', HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, 
u'noDataValue')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'timeout', 
HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'maxRetryTime', HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, 
u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'cacheDirectory', HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, 
u'cacheDirectory')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'orderByFields', HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, 
u'orderByFields')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'numBlocksToCacheInMemory', 
HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, 
u'numBlocksToCacheInMemory')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'xBlockSize', 
HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, u'xBlockSize')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'yBlockSize', 
HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, u'yBlockSize')
CopyArgumentMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, u'tBlockSize', 
HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, u'tBlockSize')

CopyResultMetadata(HYCOMGOMl0043D.InterpolateAtArcGISPoints, 
u'updatedPoints', HYCOMGLBa008Equatorial3D.InterpolateAtArcGISPoints, 
u'updatedPoints')

###############################################################################
# Metadata: _HYCOMGridGLBa0084D class
###############################################################################

AddClassMetadata(_HYCOMGridGLBa0084D,
    shortDescription=_(u'An OPeNDAPGrid for a 4D variable of a HYCOM GOMl0.04 
OPeNDAP URL.'),
    longDescription=_(
u"""This class is intended for private use within GeoEco and is not
intended for external callers."""))

###############################################################################
# Metadata: HYCOMGLBa008Equatorial4D class
###############################################################################

AddClassMetadata(HYCOMGLBa008Equatorial4D,
    shortDescription=_(u'Represents a 4D variable of the equatorial 
(Mercator) region of HYCOM GLBa0.08 as a Grid Dataset.'),
    longDescription=_HYCOMGLBa008Equatorial_LongDescription % {u'name': 
'class'} + _('\n\n**References**\n\n') + _HYCOMGLBa008Equatorial_References)

# Constructor

AddMethodMetadata(HYCOMGLBa008Equatorial4D.__init__,
    shortDescription=_(u'Constructs a new HYCOMGLBa008Equatorial4D 
instance.'),
    isExposedToPythonCallers=True,
    dependencies=[PythonAggregatedModuleDependency('numpy')])

AddArgumentMetadata(HYCOMGLBa008Equatorial4D.__init__, u'self',
    typeMetadata=ClassInstanceTypeMetadata(cls=HYCOMGLBa008Equatorial4D),
    description=_(u'HYCOMGLBa008Equatorial4D instance.'))

AddArgumentMetadata(HYCOMGLBa008Equatorial4D.__init__, u'variableName',
    typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'salinity', 
u'temperature', u'u', u'v'], makeLowercase=True),
    description=_(
u"""HYCOM 4D variable (dimensions x, y, depth, and time), one of:

* salinity - Sea water salinity, in psu.

* temperature - Sea water potential temperature, in degrees C.

* u - Eastward sea water velocity, in m/s.

* v - Northward sea water velocity, in m/s.

Please see the HYCOM documentation for more information about these
variables."""),
    arcGISDisplayName=_(u'HYCOM variable'))

CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.__init__, u'extendYExtent', 
HYCOMGLBa008Equatorial4D.__init__, u'extendYExtent')

CopyArgumentMetadata(HYCOMGOMl0044D.__init__, u'timeout', 
HYCOMGLBa008Equatorial4D.__init__, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0044D.__init__, u'maxRetryTime', 
HYCOMGLBa008Equatorial4D.__init__, u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0044D.__init__, u'cacheDirectory', 
HYCOMGLBa008Equatorial4D.__init__, u'cacheDirectory')

AddResultMetadata(HYCOMGLBa008Equatorial4D.__init__, u'grid',
    typeMetadata=ClassInstanceTypeMetadata(cls=HYCOMGLBa008Equatorial4D),
    description=_(u'HYCOMGLBa008Equatorial4D instance.'))

# Public method: HYCOMGLBa008Equatorial4D.CreateArcGISRasters

AddMethodMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters,
    shortDescription=_(u'Creates rasters for a 4D variable of the equatorial 
(Mercator) region of the HYCOM GLBa0.08 dataset.'),
    longDescription=_HYCOMGLBa008Equatorial_LongDescription % {u'name': 
'tool'} + _('\n\n**References**\n\n') + _HYCOMGLBa008Equatorial_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Create Rasters for HYCOM GLBa0.08 Equatorial 4D 
Variable'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Global 1/12 Degree Analysis (GLBa0.08)\\Equatorial Region (47 N to 66 S)\\4D 
Variables'),
    dependencies=[ArcGISDependency(9, 1), 
PythonAggregatedModuleDependency('numpy')])

AddArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'cls',
    
typeMetadata=ClassOrClassInstanceTypeMetadata(cls=HYCOMGLBa008Equatorial4D),
    description=_(u'HYCOMGLBa008Equatorial4D class or instance.'))

CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.__init__, u'variableName', 
HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'variableName')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'outputWorkspace', 
HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'outputWorkspace')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'mode', 
HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'mode')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, 
u'rasterNameExpressions', HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'rasterNameExpressions')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'rasterCatalog', 
HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'rasterCatalog')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'rotationOffset', HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'rotationOffset')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'extendYExtent', HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'extendYExtent')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'spatialExtent', HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'spatialExtent')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'linearUnit', 
HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'linearUnit')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'minDepth', 
HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'minDepth')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'maxDepth', 
HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'maxDepth')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'startDate', HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'startDate')
CopyArgumentMetadata(HYCOMGLBa008Equatorial3D.CreateArcGISRasters, 
u'endDate', HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'endDate')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'timeout', 
HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'maxRetryTime', 
HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'cacheDirectory', 
HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'cacheDirectory')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, 
u'calculateStatistics', HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'calculateStatistics')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateArcGISRasters, u'buildPyramids', 
HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'buildPyramids')

CopyResultMetadata(HYCOMGOMl0044D.CreateArcGISRasters, 
u'updatedOutputWorkspace', HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'updatedOutputWorkspace')

# Public method: HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters

AddMethodMetadata(HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters,
    shortDescription=_(u'Creates climatological rasters for a 4D variable of 
the equatorial (Mercator) region of the HYCOM GLBa0.08 dataset'),
    longDescription=_(
u"""This tool produces rasters showing the climatological average
value (or other statistic) of a HYCOM GLBa0.08 4D variable. Given a
desired variable, a statistic, and a climatological bin definition,
this tool downloads daily images for each depth layer of the variable,
classifies them into bins, and produces a single raster for each bin.
Each cell of the raster is produced by calculating the statistic on
the values of that cell extracted from all of the rasters in the
bin.

""") + _HYCOMGLBa008Equatorial_LongDescription % {u'name': 'tool'} + 
_('\n\n**References**\n\n') + _HYCOMGLBa008Equatorial_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Create Climatological Rasters for HYCOM GLBa0.08 
Equatorial 4D Variable'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Global 1/12 Degree Analysis (GLBa0.08)\\Equatorial Region (47 N to 66 S)\\4D 
Variables'),
    dependencies=[ArcGISDependency(9, 1), 
PythonAggregatedModuleDependency('numpy')])

CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'cls', 
HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, u'cls')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'variableName', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'variableName')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, 
u'statistic', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'statistic')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, 
u'binType', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'binType')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, 
u'outputWorkspace', 
HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'outputWorkspace')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, 
u'mode', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, u'mode')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, 
u'rasterNameExpressions', 
HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'rasterNameExpressions')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, 
u'binDuration', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'binDuration')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateClimatologicalArcGISRasters, 
u'startDayOfYear', 
HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, u'startDayOfYear')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'rotationOffset', 
HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, u'rotationOffset')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'extendYExtent', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'extendYExtent')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'spatialExtent', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'spatialExtent')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'linearUnit', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'linearUnit')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'minDepth', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'minDepth')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'maxDepth', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'maxDepth')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'startDate', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'startDate')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'endDate', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'endDate')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'timeout', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'timeout')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'maxRetryTime', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'maxRetryTime')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'cacheDirectory', 
HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, u'cacheDirectory')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'calculateStatistics', 
HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'calculateStatistics')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'buildPyramids', HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'buildPyramids')

CopyResultMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'updatedOutputWorkspace', 
HYCOMGLBa008Equatorial4D.CreateClimatologicalArcGISRasters, 
u'updatedOutputWorkspace')

# Public method: 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses

AddMethodMetadata(HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses,
    shortDescription=_(u'Creates line feature classes representing the 
current vectors for the equatorial (Mercator) region of the HYCOM GLBa0.08 
dataset.'),
    longDescription=_(
u"""The lines output by this tool are similar to those in a "quiver
plot". When displayed on a map, they can help visualize the direction
and speed of ocean currents. In ArcMap, select the "Arrow at End"
symbology. You may also want to reduce the line decoration (the arrow)
to a small size, such as 2.0.

""") + _HYCOMGLBa008Equatorial_LongDescription % {u'name': 'tool'} + 
_('\n\n**References**\n\n') + _HYCOMGLBa008Equatorial_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Create Current Vectors for HYCOM GLBa0.08 
Equatorial Region'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Global 1/12 Degree Analysis (GLBa0.08)\\Equatorial Region (47 N to 66 S)\\4D 
Variables'),
    dependencies=[ArcGISDependency(9, 1), 
PythonAggregatedModuleDependency('numpy')])

CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'cls', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, u'cls')

CopyArgumentMetadata(HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses,
 u'outputWorkspace', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'outputWorkspace')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses,
 u'mode', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, u'mode')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses,
 u'featureClassNameExpressions', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'featureClassNameExpressions')

AddArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses,
 u'scaleFactor',
    typeMetadata=FloatTypeMetadata(mustBeGreaterThan=0.0),
    description=_(
u"""Factor for scaling lines lengths.

The length of each line is calculated by multiplying the magnitude of
the vector by this parameter. Use this parameter to scale the lines
output by this tool to lengths that are visually appealing. If the
lines are too short, they will resemble a grid of dots and you will
not be able to discern the flow of the vector field. If the lines are
too long, they will overlap each other and resemble a plate of
spaghetti.

If the vectors all have about the same magnitude, then a good approach
is to scale the lines so that the longest one is about as long as the
raster cell size. But if there are a few very long vectors, then you
may prefer to scale the lines so that the average-length vector is as
long as the raster cell size.

For HYCOM GLBa0.08 currents, the grid cell size is about 8900 m and
currents are given in m/s. So, if the maximum (or mean) velocity in
your region of interest is about 0.75 m/s:

    scale factor = 8900 / 0.75 = 11866.666666
"""),
    arcGISDisplayName=_(u'Scale factor'),
    arcGISCategory=_(u'Vector options'))

CopyArgumentMetadata(HYCOMGOMl0044D.CreateCurrentVectorsAsArcGISFeatureClasses,
 u'uniformLength', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'uniformLength')

CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'rotationOffset', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'rotationOffset')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'extendYExtent', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'extendYExtent')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'spatialExtent', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'spatialExtent')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'linearUnit', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'linearUnit')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'minDepth', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'minDepth')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'maxDepth', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'maxDepth')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'startDate', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'startDate')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'endDate', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'endDate')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'timeout', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'timeout')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'maxRetryTime', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'maxRetryTime')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'cacheDirectory', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'cacheDirectory')

CopyResultMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'updatedOutputWorkspace', 
HYCOMGLBa008Equatorial4D.CreateCurrentVectorsAsArcGISFeatureClasses, 
u'updatedOutputWorkspace')

# Public method: HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints

AddMethodMetadata(HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints,
    shortDescription=_(u'Interpolates 4D variables of the equatorial 
(Mercator) region of the HYCOM GLBa0.08 dataset at points.'),
    longDescription=_HYCOMGLBa008Equatorial_LongDescription % {u'name': 
'tool'} + _('\n\n**References**\n\n') + _HYCOMGLBa008Equatorial_References,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Interpolate HYCOM GLBa0.08 Equatorial 4D Variables 
at Points'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Global 1/12 Degree Analysis (GLBa0.08)\\Equatorial Region (47 N to 66 S)\\4D 
Variables'),
    dependencies=[ArcGISDependency(9, 1, requiresCOMInstantiation=True), 
PythonAggregatedModuleDependency('numpy')])

CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'cls', 
HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, u'cls')

AddArgumentMetadata(HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, 
u'variableNames',
    
typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(allowedValues=[u'salinity',
 u'temperature', u'u', u'v'], makeLowercase=True), minLength=1),
    description=_(
u"""HYCOM 4D variables to interpolate:

* salinity - Sea water salinity, in psu.

* temperature - Sea water potential temperature, in degrees C.

* u - Eastward sea water velocity, in m/s.

* v - Northward sea water velocity, in m/s.

Please see the HYCOM documentation for more information about these
variables.

For each variable that you select, you must also specify a field of
the points to receive the interpolated value."""),
    arcGISDisplayName=_(u'HYCOM variables to interpolate'))

CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'points', 
HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, u'points')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, 
u'valueFields', HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, 
u'valueFields')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'tField', 
HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, u'tField')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'zField', 
HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, u'zField')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'zValue', 
HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, u'zValue')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'method', 
HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, u'method')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'extendYExtent', HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, 
u'extendYExtent')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'where', 
HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, u'where')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, 
u'noDataValue', HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, 
u'noDataValue')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'timeout', 
HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, u'timeout')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, 
u'maxRetryTime', HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, 
u'maxRetryTime')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, 
u'cacheDirectory', HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, 
u'cacheDirectory')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, 
u'orderByFields', HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, 
u'orderByFields')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, 
u'numBlocksToCacheInMemory', 
HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, 
u'numBlocksToCacheInMemory')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'xBlockSize', 
HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, u'xBlockSize')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'yBlockSize', 
HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, u'yBlockSize')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'zBlockSize', 
HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, u'zBlockSize')
CopyArgumentMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, u'tBlockSize', 
HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, u'tBlockSize')

CopyResultMetadata(HYCOMGOMl0044D.InterpolateAtArcGISPoints, 
u'updatedPoints', HYCOMGLBa008Equatorial4D.InterpolateAtArcGISPoints, 
u'updatedPoints')

# Public method: 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters

AddMethodMetadata(HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters,
    shortDescription=_(u'Creates rasters indicating the positions of fronts 
in the 2D slices of a 4D variable of the equatorial (Mercator) region of the 
HYCOM GLBa0.08 dataset using the Cayula and Cornillon (1992) single image 
edge detection (SIED) algorithm.'),
    longDescription=_CayulaCornillonFrontsOverview + _(
u"""

**The HYCOM GLBa0.08 Dataset**

""") + _HYCOMGLBa008Equatorial_LongDescription % {u'name': 'tool'} + _(
u"""

**The SIED Algorithm**

""") + _SIEDDescription + _(
u"""
**References**

""") + _HYCOMGLBa008Equatorial_References + '\n\n' + _SIEDReferences,
    isExposedToPythonCallers=True,
    isExposedByCOM=True,
    isExposedAsArcGISTool=True,
    arcGISDisplayName=_(u'Find Cayula-Cornillon Fronts in HYCOM GLBa0.08 
Equatorial 4D Variable'),
    arcGISToolCategory=_(u'Data Products\\HYCOM Consortium\\HYCOM + NCODA 
Global 1/12 Degree Analysis (GLBa0.08)\\Equatorial Region (47 N to 66 S)\\4D 
Variables'),
    dependencies=[ArcGISDependency(9, 1), 
PythonAggregatedModuleDependency('numpy')])

CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, u'cls', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, u'cls')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'variableName', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'variableName')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'minPopMeanDifference', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minPopMeanDifference')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'outputWorkspace', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'outputWorkspace')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'mode', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, u'mode')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'rasterNameExpressions', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'rasterNameExpressions')

CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'medianFilterWindowSize', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'medianFilterWindowSize')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'histogramWindowSize', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'histogramWindowSize')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'histogramWindowStride', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'histogramWindowStride')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'minPropNonMaskedCells', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minPropNonMaskedCells')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'minPopProp', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minPopProp')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'minTheta', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minTheta')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'minSinglePopCohesion', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minSinglePopCohesion')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'minGlobalPopCohesion', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minGlobalPopCohesion')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'threads', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'threads')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'fillHoles', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'fillHoles')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'thin', HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'thin')
CopyArgumentMetadata(CayulaCornillonEdgeDetection.DetectEdgesInSingleImage, 
u'minSize', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minSize')

CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'rotationOffset', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'rotationOffset')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'extendYExtent', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'extendYExtent')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'spatialExtent', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'spatialExtent')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'linearUnit', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'linearUnit')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'minDepth', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'minDepth')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'maxDepth', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'maxDepth')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'startDate', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'startDate')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'endDate', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'endDate')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'timeout', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'timeout')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'maxRetryTime', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'maxRetryTime')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'cacheDirectory', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'cacheDirectory')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'calculateStatistics', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'calculateStatistics')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'buildRAT', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'buildRAT')
CopyArgumentMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'buildPyramids', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'buildPyramids')

CopyArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'outputCandidateCounts', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'outputCandidateCounts')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'outputFrontCounts', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'outputFrontCounts')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'outputWindowStatusCodes', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'outputWindowStatusCodes')
CopyArgumentMetadata(HYCOMGOMl0044D.CreateCayulaCornillonFrontsAsArcGISRasters,
 u'outputWindowStatusValues', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'outputWindowStatusValues')

CopyResultMetadata(HYCOMGLBa008Equatorial4D.CreateArcGISRasters, 
u'updatedOutputWorkspace', 
HYCOMGLBa008Equatorial4D.CreateCayulaCornillonFrontsAsArcGISRasters, 
u'updatedOutputWorkspace')

###############################################################################
# Names exported by this module
###############################################################################

__all__ = ['HYCOMGOMl0043D', 'HYCOMGOMl0044D', 'HYCOMGLBa008Equatorial3D', 
'HYCOMGLBa008Equatorial4D']
< date >
< thread >
Archives powered by MHonArc.
Top of Page