Subject: Marine Geospatial Ecology Tools (MGET) help
Text archives
From: | "Jason Roberts" <> |
---|---|
To: | "'Khalil I.'" <> |
Cc: | <> |
Subject: | [mget-help] RE: Land mask to -9999 in MGET0.8a48 (Sea Surface Temperature from pathfinder5.2) |
Date: | Mon, 15 Apr 2013 15:05:01 -0400 |
Hi Khalil, Nice to hear from you again. Unfortunately there is no way to tell the tool to use a value other than NoData for land. My usual recommendation in this situation is to download a single SST image with all masking turned off except land. That image will have NoData for land and data for everywhere else (including clouds). This worked with Pathfinder 5.1. But unfortunately with Pathfinder 5.2 NOAA started masking both land and ocean with quality 0 in every image. There is no way to download an image without land and quality 0 already masked, at least when I wrote the tool. Attached is a quick script to download the 5.2 land mask directly. Run it like this: C:\Users\Jason>\temp\DownloadPathfinderMask.py C:\Temp\PathfinderLandMask.img 2013-04-15 14:50:51,351 INFO Importing 1 datasets into ArcGIS Folder C:\Temp with mode "replace". 2013-04-15 14:50:58,691 INFO Import complete: 0:00:07 elapsed, 1 datasets imported, 0:00:07.340000 per dataset. C:\Users\Jason> In this image, 0 is land, 1 is ocean, 2 is lakes, and 3 is rivers. You can then use this to build your own mask and apply it to your images with ArcGIS raster calculator (or use MGET’s batch map algebra tool). This is kind of cumbersome but the quickest I can think of on short notice. I took the liberty of CCing the mget-help list, in case anyone else needs a Pathfinder 5.2 land mask. Hope that helps, Jason From: Khalil I. [mailto:] Dear Jason, It has been a while since my last email. I was focusing on the other part of my research before coming back to MGET this couple of days. The new tools (for downloading Pathfinder5.2 is awesome!). Thank you very much. I just wondering something. Is it possible to assign the land mask to another value(e.g -999) rather than NoData? At the moment, MGET assigned NoData value for both, land area and cloud. This would be difficult if I want to interpolate the NoData area due to clouds only. I attached a snapshot of my data to give a clear picture. p/s: I know I can try using masking option in Data Management Tools of ArcMap but just wondering MGET could be improve. J Cheers Kind regards, Idham Khalil Room 1079 Graduate Research Hub Geography and Environment University of Southampton |
outputRaster = sys.argv[1]
from GeoEco.Logging import Logger
Logger.Initialize()
from GeoEco.ArcGIS import GeoprocessorManager
GeoprocessorManager.InitializeGeoprocessor()
from GeoEco.Datasets import Dataset
from GeoEco.Datasets.OPeNDAP import OPeNDAPURL, OPeNDAPGrid
lazyPropertyValues = {'VariableTypes': ['Grid'],
'VariableNames': ['mask'],
'SpatialReference':
Dataset.ConvertSpatialReference('proj4', '+proj=latlong +ellps=WGS84
+datum=WGS84 +no_defs', 'obj'),
'Dimensions': 'yx',
'Shape': (4320, 8640),
'CoordDependencies': (None, None),
'CoordIncrements': (180./4320,360./8640),
'CornerCoords': (-90 + 180./4320/2, -180 + 360./8640/2),
'PhysicalDimensions': 'yx',
'PhysicalDimensionsFlipped': (True, False),
'UnscaledDataType': u'uint8',
'UnscaledNoDataValue': 255,
'ScaledDataType': None}
mask =
OPeNDAPGrid(OPeNDAPURL('http://data.nodc.noaa.gov/thredds/dodsC/pathfinder/Version5.2/land_ocean_lake_river_mask_pfv52.nc',
lazyPropertyValues=lazyPropertyValues), 'mask', 'Grid')
from GeoEco.Datasets.ArcGIS import ArcGISWorkspace, ArcGISRaster
outputWorkspace = ArcGISWorkspace(os.path.dirname(outputRaster),
ArcGISRaster,
pathCreationExpressions=[os.path.basename(outputRaster)],
queryableAttributes=tuple(mask.GetAllQueryableAttributes()))
outputWorkspace.ImportDatasets([mask], mode='Replace', buildPyramids=True,
buildRAT=True)