xmlnetcdfncmlthredds

Is there a hardwired limit to the NcML/THREDDS values element?


Is there a limit to the size or number of entries that can be placed within the values NcML element? I'm attempting to get a set of NetCDF files without lon/lat variables - but with x/y variables - to be read as a featureCollection by adding NcML entries of the form:

<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
<variable name="lat_rho" shape="eta_rho xi_rho" type="float">
<attribute name="units" type="String" value="degrees_north" />
<values>[671x191 blankspace-separated latitudes here]</values>
</variable>

The lat and lon variables exist in a separate file and I've extracted them into single strings using ncks which I've stuck between appropriate locations.

The error messages in featureCollectionScan.log are:

[2013-02-07T15:15:37.386-0600] ERROR ucar.nc2.ft.fmrc.Fmrc: makeFmrcInv
java.lang.NullPointerException

....

[2013-02-07T15:15:37.388-0600] ERROR ucar.nc2.ft.fmrc.Fmrc:
/raid/data/txla_nesting6/.*\.nc$: makeFmrcInv failed
java.lang.RuntimeException: java.lang.NullPointerException

....

[2013-02-07T15:15:37.694-0600] WARN  ucar.nc2.ft.fmrc.GridDatasetInv: GridDatasetInv
using gds.getStartDate() for run date =%s
[2013-02-07T15:15:37.694-0600] ERROR ucar.nc2.ft.fmrc.Fmrc: makeFmrcInv
java.lang.NullPointerException

.... [2013-02-07T15:15:37.695-0600] ERROR ucar.nc2.ft.fmrc.Fmrc: /raid/data/txla_nesting6/.*.nc$: makeFmrcInv failed java.lang.RuntimeException: java.lang.NullPointerException


Solution

  • I don't know the answer to your question about the size limit for the <values> tag, but there is another way to solve your problem..

    You can write your lon,lat values to a netcdf file, and then use a union aggregation to create a dataset that virtually joins that netcdf file to another netcdf file (or aggregation of netcdf files)

    For example, if you have a bunch of files like:

    mod_his_0001.nc
    mod_his_0002.nc
    ...
    

    that you want to aggregate along the time dimension and you create a netcdf file that contains the lon,lat variables:

    lonlat.nc
    

    you can aggregate them together like so:

    <netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
     <!-- union the (1) time aggregation with the (2) grid file -->
     <aggregation type="union">
      <!-- (1) time aggregate files like "mod_his_0001.nc" -->
      <netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
       <aggregation dimName="time" type="joinExisting">
        <scan
         location="/home/baum/models/run01/"
         regExp=".*mod_his_[0-9]{4}\.nc$"/>
       </aggregation>
      </netcdf>
      <!-- (2) grid file -->
      <netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2"
       location="/home/baum/models/lonlat.nc"/>
     </aggregation>
    </netcdf>