NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

[netcdf-java] zarr

The netcdf-java documentation says that it now supports reading data from
zarr "files".
https://docs.unidata.ucar.edu/netcdf-java/5.5/userguide/reading_zarr.html
I'm trying to experiment with that (in netcdf-java 5.5.3) and not having
any luck.

One option listed there is
  NetcdfFile objectStoreZarr = NetcdfFiles.open(pathToObjectStore);
I found a sample zarr file on the web at
https://hrrrzarr.s3.amazonaws.com/index.html#sfc/20160823/
If I try
  NetcdfFile objectStoreZarr = NetcdfFiles.open("
https://hrrrzarr.s3.amazonaws.com/sfc/20160823/20160823_14z_anl.zarr";);
or other variants, it fails with
Exception in thread "main" java.io.FileNotFoundException:
https://hrrrzarr.s3.amazonaws.com/sfc/20160823/20160823_14z_anl.zarr
HTTP/1.1 404 Not Found
        at
ucar.unidata.io.http.HTTPRandomAccessFile.doConnect(HTTPRandomAccessFile.java:137)
        at
ucar.unidata.io.http.HTTPRandomAccessFile.<init>(HTTPRandomAccessFile.java:69)
        at
ucar.unidata.io.http.HTTPRandomAccessFile$Provider.open(HTTPRandomAccessFile.java:256)
        at ucar.nc2.NetcdfFiles.getRaf(NetcdfFiles.java:411)
        at ucar.nc2.NetcdfFiles.open(NetcdfFiles.java:274)
        at ucar.nc2.NetcdfFiles.open(NetcdfFiles.java:243)
        at ucar.nc2.NetcdfFiles.open(NetcdfFiles.java:216)
I tried other variants (with/without the trailing '/', the parent
directory, etc), but all without success.

I also copied all of the 20160803 directory to my local computer with AWS
CLI, then tried to open the local zarr file with
NetcdfFile directoryStoreZarr = NetcdfFiles.open(pathToDirectoryStore);
i.e.,
NetcdfFiles.open("c:/erddapTest/zarr/20160803/20160803_14z_anl.zarr/");
That fails with
Exception in thread "main" java.io.FileNotFoundException:
c:\erddapTest\zarr\20160803\20160803_14z_anl.zarr (The system cannot find
the path specified)
        at java.base/java.io.RandomAccessFile.open0(Native Method)
        at
java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:344)
        at
java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:259)
        at
java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:213)
        at
java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:127)
        at
ucar.unidata.io.RandomAccessFile.<init>(RandomAccessFile.java:322)
        at
ucar.unidata.io.RandomAccessFile.acquire(RandomAccessFile.java:192)
        at ucar.nc2.NetcdfFiles.getRaf(NetcdfFiles.java:465)
        at ucar.nc2.NetcdfFiles.open(NetcdfFiles.java:274)
        at ucar.nc2.NetcdfFiles.open(NetcdfFiles.java:243)
        at ucar.nc2.NetcdfFiles.open(NetcdfFiles.java:216)
I tried a lot of variants of the "file" name, and just got the same error.

Can you please tell me what I'm doing wrong?
Or, can you send me a simple example that works?

If you also have a simple example with a .zip file that I can download,
that would be great.

Thank you.
  • 2022 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: