Skip to Content.

mget-help - RE: [mget-help] MGET-0.8a60 fails to convert NASA OBPG NetCDF4-CF SMI

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


RE: [mget-help] MGET-0.8a60 fails to convert NASA OBPG NetCDF4-CF SMI


Chronological Thread 
From: "White, George" <>
To: Jason Roberts <>
Cc: "" <>
Subject: RE: [mget-help] MGET-0.8a60 fails to convert NASA OBPG NetCDF4-CF SMI
Date: Fri, 7 Aug 2015 16:14:12 +0000
Accept-language: en-CA, en-US

Thanks for the prompt reply.  It is sadly true that current economic and 
political realities have slowed work progress for many ocean ecology groups, 
but that is certainly nothing to cause embarrassment.   

We do create our own products with SeaDAS, and have users who need ArcGIS 
rasters.   In addition to unique products, we also provide higher spatial 
resolution for regions much smaller than NASA's global  SMI's.  We have been 
producing geotiffs, but those don't preserve the metadata (band names, units, 
etc.) so users have to provide metadata manually in ArcGIS or via python 
scripts.  Users should be quite happy with Python scripts that can read 
NetCDF4-CF files.  Any hints in that direction you can provide would be 
welcome.

-----Original Message-----
From: Jason Roberts 
[mailto:]
 
Sent: August-07-15 12:01 PM
To: White, George
Cc: 

Subject: RE: [mget-help] MGET-0.8a60 fails to convert NASA OBPG NetCDF4-CF SMI

George,

Thanks for your interest in MGET. Sadly--it is embarrassing to say--I have 
not had time to update that tool to work with netCDF4. It is failing because 
it only works with netCDF3.

Much of the underlying work has been completed, to the point that it is 
possible to write relatively simple Python scripts that can do the 
conversion. But I haven't done the work of updating the code that exposes it 
as an ArcGIS tool.

If you are interested in the L3 images available from NASA already--e.g. that 
you can access from the OceanColor L3 browser 
(http://oceancolor.gsfc.nasa.gov/cgi/l3)--then you can use the tools under 
MGET --> Data Products --> NASA GFSC OceanColor Group --> L3 Products.

But it sounds like you are creating your own data with SeaDAS. If that is the 
case, then unfortunately there is no ArcGIS-exposed tool in MGET yet that can 
help. If you are interested, I may be able to update the tool you are using 
sometime near the end of this month. Or if you are comfortable programming in 
Python, I could send some example code sooner that would illustrate how to do 
the conversion. Finally, if you prefer a command-line solution, you might be 
able to use GDAL to do it (the gdal_translate tool).

All the best,

Jason 

-----Original Message-----
From: 

 
[mailto:]
 
Sent: Friday, August 07, 2015 10:35 AM
To: 

Subject: [mget-help] MGET-0.8a60 fails to convert NASA OBPG NetCDF4-CF SMI

The test NetCDF4-CF file was created with SeaDAS 7.2 OCSSW Processing System 
from the SeaDAS benchmark files:

PS C:\Users\WhiteG\Documents\ArcGIS> C:\Python27\ArcGIS10.2\Scripts\ncinfo.exe
.\A2006167181000.smi_chlor_a_mn.nc
<type 'netCDF4._netCDF4.Dataset'>
root group (NETCDF4 data model, file format HDF5):
    product_name: A2006167181000.smi_chlor_a_mn.nc
    instrument: MODIS
    title: HMODISA Level-3 Standard Mapped Image
    project: Ocean Biology Processing Group (NASA/GSFC/OBPG)
    platform: Aqua
    temporal_range: 1-hour
    processing_version: Unspecified
    date_created: 2015-06-05T15:07:58.000Z
    history: l3mapgen ifile=A2006167181000.L3b_time.nc 
ofile=A2006167181000.smi_chlor_a_mn.nc ofile2=A2006167181000.smi_ 
chlor_a_mn.tif oformat2=tiff product=chlor_a resolution=2km east=-62 west=-78
south=30 north=46
    l2_flag_names:
ATMFAIL,LAND,HILT,HISATZEN,STRAYLIGHT,CLDICE,COCCOLITH,LOWLW,CHLWARN,CHLFAIL,NAVWARN,MAXAERITER,ATMWA
RN,HISOLZEN,NAVFAIL,FILTER,HIGLINT
    time_coverage_start: 2006-06-16T16:10:07.000Z
    time_coverage_end: 2006-06-16T16:15:04.000Z
    start_orbit_number: 21910
    end_orbit_number: 21910
    map_projection: Equidistant Cylindrical
    latitude_units: degrees_north
    longitude_units: degrees_east
    northernmost_latitude: 46.0
    southernmost_latitude: 30.0
    westernmost_longitude: -78.0
    easternmost_longitude: -62.0
    geospatial_lat_max: 46.0
    geospatial_lat_min: 30.0
    geospatial_lon_max: -62.0
    geospatial_lon_min: -78.0
    grid_mapping_name: latitude_longitude
    latitude_step: 0.0208333
    longitude_step: 0.0208333
    sw_point_latitude: 30.0104
    sw_point_longitude: -77.9896
    geospatial_lon_resolution: 2.31916
    geospatial_lat_resolution: 2.31916
    geospatial_lat_units: km
    geospatial_lon_units: km
    spatialResolution: 2.32 km
    number_of_lines: 768
    number_of_columns: 768
    measure: Mean
    suggested_image_scaling_minimum: 0.01
    suggested_image_scaling_maximum: 20.0
    suggested_image_scaling_type: LOG
    suggested_image_scaling_applied: No
    _lastModified: 2015-06-05T15:07:58.000Z
    Conventions: CF-1.6
    institution: NASA Goddard Space Flight Center, Ocean Ecology Laboratory, 
Ocean Biology Processing Group
    standard_name_vocabulary: NetCDF Climate and Forecast (CF) Metadata 
Convention
    Metadata_Conventions: Unidata Dataset Discovery v1.0
    naming_authority: gov.nasa.gsfc.sci.oceandata
    id: L3/A2006167181000.L3b_time.nc
    license:
http://science.nasa.gov/earth-science/earth-science-data/data-information-policy/
    creator_name: NASA/GSFC/OBPG
    publisher_name: NASA/GSFC/OBPG
    creator_email: 

    publisher_email: 

    creator_url: http://oceandata.sci.gsfc.nasa.gov
    publisher_url: http://oceandata.sci.gsfc.nasa.gov
    processing_level: L3 Mapped
    cdm_data_type: grid
    identifier_product_doi_authority: http://dx.doi.org
    identifier_product_doi: 10.5067/AQUA/MODIS_OC.2014.0
    keywords: Oceans > Ocean Chemistry > Chlorophyll; Oceans > Ocean Optics > 
Ocean Color
    keywords_vocabulary: NASA Global Change Master Directory (GCMD) Science 
Keywords
    data_bins: 153375
    data_minimum: 0.0563091
    data_maximum: 98.3519
    dimensions(sizes): lat(768), lon(768), rgb(3), eightbitcolor(256)
    variables(dimensions): float32 ←[4mchlor_a←[0m(lat,lon), float32 
←[4mlat←[0m(lat), float32 ←[4mlon←[0m(lon), uint8 ←
[4mpalette←[0m(rgb,eightbitcolor)
    groups: processing_control

Using ArcGIS 10.2.2, MGET-0.8a60.win32-py2.7, with netCDF4-1.1.9, 
numpy-1.9.2, conversion of the SMI to raster fails:

Executing: NetCDFConvert2DVariableToArcGISRaster
C:\Users\WhiteG\Documents\ArcGIS\A2006167181000.smi_chlor_a_mn.nc
C:\Users\WhiteG\Documents\ArcGIS\Default.gdb\A2006167181000_smi_chlor_a 
chlor_a
-70 30 0.0208333 # false false false false # # # # # # # # false Start Time: 
Fri Aug 07 10:54:23 2015 Running script 
NetCDFConvert2DVariableToArcGISRaster...
Converting variable chlor_a in netCDF file 
C:\Users\WhiteG\Documents\ArcGIS\A2006167181000.smi_chlor_a_mn.nc to ArcGIS 
raster 
C:\Users\WhiteG\Documents\ArcGIS\Default.gdb\A2006167181000_smi_chlor_a...
RuntimeError: Not a netCDF file
Failed script NetCDFConvert2DVariableToArcGISRaster...

Traceback (most recent call last):
  File "C:\Program
Files\GeoEco\ArcGISToolbox\Scripts\NetCDFConvert2DVariableToArcGISRaster.py",
line 5, in <module>
    ExecuteMethodFromCommandLineAsArcGISTool('GeoEco.DataManagement.NetCDFs',
'NetCDF', 'Convert2DVariableToArcGISRaster')
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\ArcGISScripts.py", 
line 210, in ExecuteMethodFromCommandLineAsArcGISTool
    exec sourceCode in globals(), locals()
  File "<string>", line 1, in <module>
  File
"C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\DataManagement\NetCDFs.py",
line 191, in Convert2DVariableToArcGISRaster
    data = cls.GetNumpyArrayFor2DVariableInNetCDFFile(inputFile, variableName)
  File
"C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\DataManagement\NetCDFs.py",
line 245, in GetNumpyArrayFor2DVariableInNetCDFFile
    dataset = netCDF3.Dataset(netCDFFileTemp, 'r')
  File "netCDF3.pyx", line 691, in netCDF3.Dataset.__init__
(build/src/GeoEco/AssimilatedModules\netCDF3_1_9_2..c:4086)
RuntimeError: Not a netCDF file

Failed to execute (NetCDFConvert2DVariableToArcGISRaster).
Failed at Fri Aug 07 10:54:24 2015 (Elapsed Time: 0.70 seconds)

Note: The test file may have invalid latitudes due to bug in l3mapgen, but I 
would expect to get further along before hitting that problem (and it may be 
useful to see what error the invlaid lats trigger).



Archive powered by MHonArc 2.6.19.

Top of Page