[gdal-dev] NetCDF and EASE-2

Marsh, Chris chris.marsh at usask.ca
Mon Feb 3 09:36:46 PST 2020


Yup, forgot to enable netcdf. Sorry about that.

Otherwise your directions worked perfectly, thank you very much!

In terms of understanding, exactly, these steps for the next time:

0) How would I have known the data were transposed lon, lat?
0b) How would I have known the spacing of the lat variable was not constant? I imagine "because I looked at it?" :) Knowing this, I've gone back and I see it now when I do a quick analysis with xarray. What was the method you diagnosed this with?
1) What is the motivation to tiling the output?
2) Knowing about the mirror command is cool
3) I don't understand this step.  Why is this referencing back  the nc file?

Cheers
Chris


Chris Marsh, PhD
University of Saskatchewan
chrismarsh.ca<http://chrismarsh.ca/>



On Sun, Feb 2, 2020 at 6:15 AM Even Rouault <even.rouault at spatialys.com<mailto:even.rouault at spatialys.com>> wrote:
CAUTION: This email originated from outside of the University of Saskatchewan. Do not click links or open attachments unless you recognize the sender and know the content is safe. If in doubt, please forward suspicious emails to phishing at usask.ca<mailto:phishing at usask.ca>


On dimanche 2 février 2020 00:34:46 CET Marsh, Chris wrote:
> HI Even,
>
> Thanks for the detailed response. I have compiled master 3.1dev however
> strangest thing when I try to run it

> $ export PATH=`pwd`/gdal-install/bin:$PATH
> $ which gdal_translate
> /Users/chris/Documents/science/analysis/gdal-install/bin/gdal_translate
>  $ gdal_translate NETCDF:"`pwd`/SD_20160901.nc":snd_upd out.tif -co
> TILED=YES
 ERROR 4:
> NETCDF:/Users/chris/Documents/science/analysis/SD_20160901.nc:snd_upd: No
> such file or directory

Do you have the netCDF driver included ? Check with
"gdalinfo --format netCDF". This file is also a netCDF 4 file, so you need to
make sure you netCDF lib is built against HDF5.
You may use the "osgeo/gdal" Docker image.
See https://github.com/OSGeo/gdal/blob/master/gdal/docker/README.md

> $ ls
> /Users/chris/Documents/science/analysis/SD_20160901.nc
> /Users/chris/Documents/science/analysis/SD_20160901.nc
>
> If I try to use my homebrew installed gdal_translate it works.
>
> I've also tried without the `pwd` but that doesn't work either. This seems
> like a stupid PEBKAC but I'm out of ideas.

> Trying the 2nd command resulted in
>
> $ /gdal-install/bin/gdalmdimtranslate out.tif out2.tif -co TILED=YES -array
> band=1,transpose=[1,0],view=[::-1,::-1]
 zsh: no matches found:

Ah, just trying with zsh, this is just a quoting issue. You need to surround
the value of the array option with double quotes

... -array "band=1,transpose=[1,0],view=[::-1,::-1]"

--
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200203/f8d4218e/attachment-0001.html>


More information about the gdal-dev mailing list