Greetings Niels,
The class DefaultConvention is netCDF-Java's way of trying to handle
cases
in which a convention is not specified. It tries to be pretty
forgiving in
terms of files where people have tried to be compliant with some
convention, but didn't set a convention attribute, or knew enough about
some conventions in general to sort of get things in the ball park...for
example, setting positive=up on a vertical coordinate, but not
getting the
rest of the stuff correct (not true for your case, but our code tries to
handle the more common case we come across). If a file is actually
following CF, netCDF-Java will use the class CF1Convention. Currently we
handle (or try to) around 30 specific conventions (not sure all are
actually documented conventions), but when all else fails, we go to the
default convention.
NcML aggregations in general can get pretty gnarly, and are very hard to
get correct. Have you looked into using the Forecast Model Run
Collection
(FMRC) featureCollection element to serve these data?
https://www.unidata.ucar.edu/software/thredds/current/tds/tutorial/FmrcFeatureCollectionsTutorial.html
Cheers,
Sean
On Mon, Aug 29, 2016 at 6:11 AM, Niels Charlier <niels@xxxxxxxxx> wrote:
Hello,
I am currently working on the netcdf extensions of geotools/geoserver,
although I should say I am fairly new at netcdf, so I am still
learning. I
am currently trying to get some particular datasets to work with
geoserver,
and I think I might have hit against some limitations, perhaps even
a bug,
in netcdf-java, so I wanted to ask you for advice.
We have a .ncml have that aggregate datasets based on 'runtime'.
This is
an explanation from the client:
*"'runtime' is not a first class coordinate in the data produced by our
production groups, so the initial approach to solve this using unidata
mechanisms is to use NCML to aggregate *
*two datasets with different runtimes together using a 'joinNew'
aggregation, which adds a new coordinate axis 'runtime' to the
dataset *
*(this takes place in several of the .ncml files included in the test
data). The runtime axis would then be exposed as a custom dimension in
geoserver so that it can be used for subsets. This means that a reader
would have to be prepared to handle dimension values that are
possibly two
dimensional(a set of values for each available 'runtime'), which I
don't
think the current reader can handle? "*
My first question is what it would entail for building support for
this in
netcdf-java? In the meantime I have been extensively debugging what
happens
when I try to load the aggregation file, and I can give some detailed
information about what goes wrong in the code. I think I might have
found
something else that is going wrong.
* as part of the aggregation, the runtime dimension is being added to
every other variable of each of the .nc files.
* During *CoordSysBuilder.buildCoordinateSystems* some things happen
as a
consequence of that that is different from when I read the .nc files
individually:
-> In *makeCoordinateSystemsImplicit*, as a consequence of all
variables having an additional dimension, the CRS with lacking runtime
dimension is not considered sufficient and is not being set.
-> However, in *makeCoordinateSystemsMaximal* the CRS's are being
set, except for one variable called "surf_el", because it is being
considered an AXIS (see line 873, call to* !vp.isData()*).
* During index building (*NetCDFImageReader.init -> initIndex ->
getCoordinateSystem*), a runtime exception is thrown because surf_el
doesn't have a CRS.
The thing is, surf_el is not an axis. The reason it is considered an
axis
is because it has a "positive" attribute. This happens in
*DefaultConvention.findCoordinateAxes
-> getAxisType -> getAxisTypeCoards* (see line 297, *positive !=
null*).
To quote my colleague Ben who I asked advice about this:
*"surf_el is a time-varying data variable and not any kind of
coordinate.
Surface elevation looks to me like an output of the HYCOM ocean
model **<https://hycom.org/>
<https://hycom.org/>**. Any logic that says that a variable is a
coordinate if it has attribute "positive"="up" is broken. There is this
statement in the CF conventions: *
*"A vertical coordinate will be identifiable by: *
* units of pressure; or *
* the presence of the positive attribute with a value of up or down
(case insensitive)." *
*http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html
<http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html>*
*There are such things as time-varying multidimensional coordinate
variables (think of the lat and lon grids for a satellite swathe),
but this
is not one of these. *
*I think that, to be a coordinate variable, a variable must be
mentioned
in the "coordinates" attribute of another variable in the same file, or
have a name that matches its dimension (i.e. a basic single-dimensional
coordinate variable). " *
So have I indeed identified a bug here? please advice.
Thank you for your help.
Kind Regards,
Niels
_______________________________________________
NOTE: All exchanges posted to Unidata maintained email lists are
recorded in the Unidata inquiry tracking system and made publicly
available through the web. Users who post to any of the lists we
maintain are reminded to remove any personal information that they
do not want to be made public.
netcdf-java mailing list
netcdf-java@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit:
http://www.unidata.ucar.edu/mailing_lists/
_______________________________________________
NOTE: All exchanges posted to Unidata maintained email lists are
recorded in the Unidata inquiry tracking system and made publicly
available through the web. Users who post to any of the lists we
maintain are reminded to remove any personal information that they
do not want to be made public.
netcdf-java mailing list
netcdf-java@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit:
http://www.unidata.ucar.edu/mailing_lists/