Code Monkey home page Code Monkey logo

Comments (7)

anikfal avatar anikfal commented on June 8, 2024 1

@haileyajohnson
Sure. The link below provides the file mentioned in the code:
https://drive.google.com/file/d/1RjI8Mte5M9joROqVvHqR8yWGh-6fjdOa/view?usp=drive_link

from netcdf-java.

rschmunk avatar rschmunk commented on June 8, 2024 1

@anikfal,

I didn't know the new API has got such a syntax.

There was some refactoring and adding of methods and classes for opening/acquiring datasets a few years ago, maybe when NJ 5.3 was in development. I'm not sure if the NetcdfFiles or NetcdfDatasets classes existed before then. I had to figure out how to use them because I was tired of getting deprecation alerts whenever I compiled my old code for opening datasets.

from netcdf-java.

haileyajohnson avatar haileyajohnson commented on June 8, 2024

Could you provide an example of a file that isn't working as a NetcdfDataset?

from netcdf-java.

haileyajohnson avatar haileyajohnson commented on June 8, 2024

I am unable to reproduce the issue with the file you've provided. Are you using the latest version of netCDF-Java?

Unrelated to your problem, but we recommend using the newer APIs to open netcdf files and datasets, e.g.:
`NetcdfDataset dataset = NetcdfDatasets.openDataset(filepath);

from netcdf-java.

anikfal avatar anikfal commented on June 8, 2024

I came across a confusing situation:

I was not using the latest version (netcdfAll-5.5.3.jar). Instead, I was using the maven-built netcdf-4.3.22.jar.

With the latest version, the aforementioned problem was solved and era5.nc could be successfully read by NetcdfDataset. However, some other files that used to be read by netcdf-4.3.22.jar, could not be read by the latest version! I provide them below (they are standard and widely used environmental/atmospheric data):

  1. VIIRS satellite data
  2. WRF model output

More or less, the same situation happened for ucar.nc2.NetcdfFile.


I have a bunch of NetCDF files which have different metadata, attributes, and coordinate systems. This is probably something that causes such a problem and chaotic situation.

Can a user modify or develop the associated netcdf-java class and make it compatible with their own data and application?

from netcdf-java.

rschmunk avatar rschmunk commented on June 8, 2024

@anikfal, I had no trouble opening any of your three examples. Boiled down, my code does

NetcdfFile njFile = NetcdfFiles.open ( filePathStr );
NetcdfDataset njdEnhanced  = NetcdfDatasets.enhance (njFile, enhSet, null);

where enhSet is my own enhancement set which omits one of the netCDF-Java defaults.

The VIIRS example, I do not see a lot-lat gridding system of any sort. Is it defined outside the dataset?

from netcdf-java.

anikfal avatar anikfal commented on June 8, 2024

NetcdfFile njFile = NetcdfFiles.open ( filePathStr );

I didn't know the new API has got such a syntax. Now I can open them all. Thanks.

The VIIRS example, I do not see a lot-lat gridding system of any sort. Is it defined outside the dataset?

Yes. Coordinates are stored in separate file.

from netcdf-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.