Hi all!
I was trying to update our ERDDAP to version 2.27 from version 2.21 and came across some issues with accessing our ADCP datasets which are
EDDTableFrom
MultidimNcFiles. I changed our version a few times and found that 2.25 was where the breaking change is occurring for us. I took a look at the commits and noticed that Chris made some significant changes to improve
EDDTableFrom
MultidimNcFiles. It would seem then that perhaps our nc files are not exactly structured according to the CF standards per
this section of the conventions.
I have since gone through with v2.27 and generated a new section for the datasets.xml. I attempted 3 things with the "Dimensions CSV" with varying levels of success:
- None: Generated a section. cdm_data_type="Other" by default. Managed to access the data.
- time,depth,latitude,longitude: Failed to generate a section with the error: java.lang.RuntimeException: ERROR in NDimensionalIndex constructor: shape=[0, 0, 0, 0] has a value less than 1
- time,depth: Generated a section. cdm_data_type="Other" by default. Managed to access the data. Latitude and longitude notably not added as variables.
You can access the dataset in question
on our website. Admittedly, it's currently not exactly correct, since we used TimeSeries. The reason is that we were switching from EDDTableFromCassandra and did it in a bit of a hurry. It really should be TimeSeriesProfile.
If you look at the attached file, current_index.csv, you'll get the metadata for the dataset linked. updated_index.csv works in v2.27 after doing the following:
- Generated the xml with Dimensions CSV as "time,depth"
- Changed the cdm_data_type to TimeSeriesProfile and added the cdm_***_variables
- Added latitude and longitude variables back
At this point, once again I was getting an error to do with the nc files being bad. I had one last idea and changed latitude and longitude to not be sourced from the nc file, as in:
<dataVariable>
<sourceName>=48.33664695</sourceName>
<destinationName>latitude</destinationName>
<dataType>double</dataType>
<addAttributes>
<att name="ioos_category">Location</att>
<att name="standard_name">latitude</att>
<att name="units">degree_north</att>
<att name="actual_range" type="doubleList">48.3366411 48.3366528</att>
<att name="long_name">Latitude</att>
</addAttributes>
</dataVariable>
<dataVariable>
<sourceName>=-123.74975219999999</sourceName>
<destinationName>longitude</destinationName>
<dataType>double</dataType>
<addAttributes>
<att name="ioos_category">Location</att>
<att name="standard_name">longitude</att>
<att name="units">degree_east</att>
<att name="actual_range" type="doubleList">-123.7499388 -123.7495656</att>
<att name="long_name">Longitude</att>
</addAttributes>
</dataVariable>
This did work as expected! However, the fact that getting the value of latitude and longitude from the NetCDF files makes me think that there may be a mistake in the NetCDF files themselves and they may not follow the CF conventions.
I've attached the output of "ncdump -h" from one of the files. Of note are likely:
netcdf RDIADCP300WH15551_20110720T000000Z_20110720T235958Z-binMapNearest_3beamOn.nc {
dimensions:
time = 43200;
depth = 54;
latitude = 1;
longitude = 1;
variables:
double time(time=43200);
:sdn_parameter_name = "time";
:long_name = "time";
:axis = "T";
:calendar = "gregorian";
:units = "days since 1970-01-01 00:00:00";
:_ChunkSizes = 43200U; // uint
double range(depth=54);
:sdn_parameter_name = "range";
:long_name = "range from transducer";
:units = "meters";
:comment = "Range of measurement bins from the transducer, applies to all parameters except: meanBackscatter and u, v, w, velocityError when bin-mapping is on";
:_ChunkSizes = 54U; // uint
double latitude(latitude=1);
:sdn_parameter_name = "latitude";
:long_name = "latitude";
:units = "degree_north";
:axis = "Y";
:_ChunkSizes = 1U; // uint
double longitude(longitude=1);
:sdn_parameter_name = "longitude";
:long_name = "longitude";
:units = "degree_east";
:axis = "X";
:_ChunkSizes = 1U; // uint
I don't know the internal representation as I didn't generate these files myself and I don't know how to get that information from ncdump, but if anyone has suggestions how to do that I can confirm if it's CF compliant or not.
Thanks in advance for the input!