Unidata / IDV

The Integrated Data Viewer (IDV) from Unidata is a framework for analyzing and displaying geoscience data.
http://www.unidata.ucar.edu/software/idv/
Other
80 stars 37 forks source link

NullPointerExceptoin occurs for a track file. #154

Closed hyoklee closed 1 year ago

hyoklee commented 1 year ago

IDV detects the file as a valid Track type. However, it fails to open it due to the following error:

java.lang.NullPointerException
    at ucar.unidata.data.sounding.CdmTrackAdapter.<init>(CdmTrackAdapter.java:91)
    at ucar.unidata.data.sounding.TrackDataSource.doMakeAdapter(TrackDataSource.java:546)
    at ucar.unidata.data.sounding.TrackDataSource.initTrack(TrackDataSource.java:502)
    at ucar.unidata.data.sounding.TrackDataSource.getAdapters(TrackDataSource.java:560)
    at ucar.unidata.data.sounding.TrackDataSource.initAfter(TrackDataSource.java:281)
    at ucar.unidata.data.DataSourceImpl.initAfterCreation(DataSourceImpl.java:791)
    at ucar.unidata.data.FilesDataSource.initAfterCreation(FilesDataSource.java:284)
    at ucar.unidata.data.sounding.TrackDataSource.initAfterCreation(TrackDataSource.java:296)
    at ucar.unidata.data.DataManager.createDataSource(DataManager.java:1612)
    at ucar.unidata.idv.IntegratedDataViewer.createDataSource(IntegratedDataViewer.java:1978)
    at ucar.unidata.idv.IntegratedDataViewer.makeDataSource(IntegratedDataViewer.java:1895)
    at ucar.unidata.idv.IntegratedDataViewer.makeDataSource(IntegratedDataViewer.java:1829)
    at ucar.unidata.idv.IntegratedDataViewer.makeDataSource(IntegratedDataViewer.java:1802)
    at ucar.unidata.idv.chooser.IdvChooser.makeDataSource(IdvChooser.java:943)
    at ucar.unidata.idv.chooser.FileChooser.selectFilesInner(FileChooser.java:659)
    at ucar.unidata.idv.chooser.FileChooser.selectFiles(FileChooser.java:528)
    at ucar.unidata.idv.chooser.FileChooser.doLoadInThread(FileChooser.java:550)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at ucar.unidata.util.Misc$2.run(Misc.java:1215)
    at ucar.unidata.util.Misc$3.run(Misc.java:1243)
yuanho commented 1 year ago

Hi Joe,

I checked your attached file, the data is not very well formatted. The IDV can display it as point data type, but not enough information (attributes) to create a track display.

Yuan

hyoklee commented 1 year ago

Hi, Yuan!

Here's a better formatted data. I hope you can make it work with IDV as Track Files datatype.

RAT_demo_with_attrs.zip

yuanho commented 1 year ago

This is your data structure:

netcdf /Users/yuanho/Downloads/RAT_demo2.h5 { dimensions: Time = 880; variables: long LQI(Time=880);

double Altitude(Time=880);
  :units = "m";
  :_CoordinateAxisType = "Height";

double Latitude(Time=880);
  :units = "degrees_north";
  :_CoordinateAxisType = "Lat";

double Longitude(Time=880);
  :units = "degrees_east";
  :_CoordinateAxisType = "Lon";

double Time(Time=880);
  :units = "seconds since 1970-01-01 00:00:00";
  :_CoordinateAxisType = "Time";

// global attributes: :_CoordSysBuilder = "ucar.nc2.internal.dataset.conv.DefaultConventions"; }

Here is CF document:

https://cfconventions.org/cf-conventions/cf-conventions.html#trajectory-data

hyoklee commented 1 year ago

Hi, Yuan!

I'm not testing Trajectory. This kind of file worked in 2017:

https://github.com/Unidata/IDV/blob/bdbfe7f786474ebfbf95a2933f8c6f95075f5d3e/src/ucar/unidata/data/sounding/CdmTrackInfo.java

However, it doesn't work in 2023.

yuanho commented 1 year ago

We are doing better now enforcing CF Conventions.😀

hyoklee commented 1 year ago

I see. I'll try to match the conventoins. 😅

Thanks for checking!