[gdal-dev] Questions on working with HYCOM data in netcdf format

Stephen Woodbridge woodbri at swoodbridge.com
Sun Jun 5 14:10:36 PDT 2016


Hi Even, Kurt,

Thank you for the suggestions.

I'm reading through stuff and searching for solutions. I need access to 
the 2d layer which is only available via the GLBa0.08 dataset and not in 
the GLBu0.08 dataset which is easier to deal with. I'll start with the 
GLBu0.08 dataset for the other data following Kurt suggestions.

This page describes the problem of georeferencing the GLBa0.08 dataset 
but the solution is based on windows python script and using ArcGIS, but 
the idea might be adapted to writing some C/C++ or script to handle 
creating those artifacts. I want to script the download and processing 
of the data into geotiff's running on Linux.

http://code.nicholas.duke.edu/projects/mget/wiki/HYCOM

One problem is that the HYCOM site does not have *.grid.[ab] files that 
I can find. They are supposed to be in the topo directory:

Index of ftp://ftp.hycom.org/datasets/GLBa0.08/expt_91.2/topo/

Name 	Size 	Last Modified
depth_GLBa0.08_09.a   57984 KB	8/24/2013 	12:00:00 AM
depth_GLBa0.08_09.b       1 KB	8/24/2013 	12:00:00 AM
depth_GLBa0.08_09.nc 173950 KB	11/12/2013 	12:00:00 AM

and it is not obvious how to read and incorporate these files as I think 
they only work with the HYCOM related executables.

I did notice the the lat/lon info is already in the .nc for the "u" 
dataset which can be seen with ncdump. In fact it is also there for the 
"a" dataset also, but the values 1-3298 and 1-4500 which is the size of 
the file in pixels, so not helpful.

I've looked on the HYCOM forum but that has not been very helpful yet.

Thanks,
   -Steve


On 6/5/2016 2:04 PM, Kurt Schwehr wrote:
> Stephen,
>
> Take a look at these two discussions for starters on working with
> hycom:
>
> http://gis.stackexchange.com/questions/167155/how-can-i-make-geotiffs-of-individual-depth-layers-in-the-hycom-ocean-circulatio
>
>
> http://gis.stackexchange.com/questions/170882/how-can-a-make-a-netcdf-with-subgroups-smaller
>
>  You should start with the regular grids.  e.g.
>
> ftp://ftp.hycom.org/datasets/GLBu0.08/expt_91.1/data/hindcasts/2015/hycom_glb_911_2015093000_t000_uv3z.nc
>
>  Make an 80 layer geotiff from the u/v and then use mapserver as
> Even suggested.
>
> -kurt
>
>
> On Sat, Jun 4, 2016 at 6:29 AM, Even Rouault
> <even.rouault at spatialys.com <mailto:even.rouault at spatialys.com>>
> wrote:
>
> Hi,
>>
>> I want to convert some HYCOM data into GTiff format and I'm a
>> little lost on how to get started, whether I can do what I need
>> just using a vrt or if I'm going to have to write code to process
>> the data.
>>
>> To start with I have placed gdalinfo on one file here:
>> http://imaptools.com:8080/dl/hycom-gdalinfo.txt
>>
>> The data comes from http://hycom.org/dataserver/glb-analysis and I
>> will need to be using GLBa0.08 dataset.
>>
>> I have two use cases:
>>
>> 1) The simple one is to extract say Band 1 into a georeferenced
>> GTiff and apply color to using color ranges without loosing the
>> NODATA. I think I can do later using .vrt, correct?
>
> gdaldem color-relief can output to a VRT, but given that this netCDF
> file is georeferenced through a geolocation array, you'll likely have
> first to run gdalwarp -geoloc to have something useful at the end.
>
>>
>> I'm not sure how to deal with the georeferencing, because the
>> download site says: "Native hycom .[ab] data converted to NetCDF on
>> native Mercator-curvilinear HYCOM horizontal grid" but that does
>> not seem in sync with the Metadata in the file.
>>
>> 2) The more complicated case is that there are two files: a)
>> eastward_sea_water_velocity (aka: u, u-velocity) b)
>> northward_sea_water_velocity (aka: v, v-velocity) that I would like
>> to use to create a grid of vectors with arrowheads using u and v to
>> define the vector and where the color of the vector is related to
>> the magnitude of its length. Ultimately this data will get rendered
>> via mapserver so I'm wondering if I can do this via a GTiff or if I
>> will have to resort to creating a massive point shapefile with
>> attributes of angle and magnitude and use a symbol. It seems like
>> it would be best if I can keep the data as a GTiff and then sample
>> the points and render the vectors on the fly for when you zoom
>> in/out.
>
> See http://mapserver.org/input/vector/vector_field.html
>
> You don't need to create a vector file.
>
> You'll have to preprocess your file to get the u and v bands in the
> same raster.
>
> Even
>
> -- Spatialys - Geospatial professional services
> http://www.spatialys.com
> _______________________________________________ gdal-dev mailing
> list gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org>
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
>
>
> -- -- http://schwehr.org


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the gdal-dev mailing list