Re: [netcdfgroup] [Non-DoD Source] Re: Renaming FMRC 'run' dimension

  • To: "Harms, Clifford M CIV NAVOCEANO, N642" <clifford.harms@xxxxxxxx>
  • Subject: Re: [netcdfgroup] [Non-DoD Source] Re: Renaming FMRC 'run' dimension
  • From: Sean Arms <sarms@xxxxxxxx>
  • Date: Wed, 27 Dec 2017 09:48:54 -0700
Ah, I see better now. Since the run dimension is being created by the
aggregation, the protoDataset won't have it available to work with. I would
try using the dataset returned by the getDataset2D method along with some
NcML to rename the run dimension by using the mergeNcMLdirect method from
the ucar.nc2.ncml.NcMLReader class:

https://www.unidata.ucar.edu/software/thredds/current/netcdf-java/javadoc/ucar/nc2/ncml/NcMLReader.html#mergeNcMLdirect-ucar.nc2.dataset.NetcdfDataset-org.jdom2.Element-

Cheers,

Sean


On Fri, Dec 22, 2017 at 7:52 AM, Harms, Clifford M CIV NAVOCEANO, N642 <
clifford.harms@xxxxxxxx> wrote:

> I'm attempting to change the dimension created by netcdf-java name from
> 'run' to 'reference_time' in the featureCollection.xml as shown below:
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <featureCollection xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/
> ncml-2.2"
>             xmlns:ns2="http://www.unidata.ucar.edu/namespaces/thredds/
> InvCatalog/v1.0"
>             path="4a76026e-1e2c-302a-bd41-e9c9ea3a47cd_fmrc"
> name="ncom_relo_autec_u_24"
>            featureType="FMRC">
>     <ns2:collection spec="/path/to/ncml/files/
> ncom_relo_autec_[0-9]+[.]ncml"/>
>     <protoDataset>
>         <netcdf>
>             <dimension name="reference_time" orgName="run"/>
>         </netcdf>
>     </protoDataset>
> </featureCollection>
>
> It's worth mentioning that the collection spec references .ncml files that
> contain joinExisting aggregations of .nc files.  None of these files have a
> 'run' dimension, I assume that netcdf-java is creating this from the time
> dimension metadata.
>
> I also am not using the THREDDS server directly, but obtaining a
> NetcdfDataset from the featureCollection.xml as shown here (in java):
>
> Formatter formatter = new Formatter(System.err);
> FeatureCollectionConfigBuilder builder = new FeatureCollectionConfigBuilder
> (formatter);
> FeatureCollectionConfig config  = builder.readConfigFromFile(
> featureCollectionPath.toString());
> Fmrc fmrc = Fmrc.open(config, formatter);
> NetcdfDataset result = new NetcdfDataset();
> fmrc.getDataset2D(result);
>
>
> -----Original Message-----
> From: Sean Arms [mailto:sarms@xxxxxxxx]
> Sent: Thursday, December 21, 2017 6:38 PM
> To: Harms, Clifford M CIV NAVOCEANO, N642
> Cc: netcdfgroup@xxxxxxxxxxxxxxxx
> Subject: [Non-DoD Source] Re: [netcdfgroup] Renaming FMRC 'run' dimension
>
> Greetings!
>
> You should be able to use NcML inside the protoDataset element to rename
> the dimension and/or variable. Could you send an example of the
> featureCollection xml you are using?
>
> Thanks!
>
> Sean
>
> On Thu, Dec 21, 2017 at 4:36 PM Harms, Clifford M CIV NAVOCEANO, N642 <
> clifford.harms@xxxxxxxx> wrote:
>
>
>         Currently, I use FMRC via featureCollection XML files to aggregate
> datasets with different runtimes (these datasets are themselves NCML
> aggregations of .nc files).  When opening such a featureCollection in java,
> I get a dataset that that has dimension variable named 'run'  for the
> different run times, and everything works beautifully.   I need to be able
> to change the name of this 'run' dimension to something else in order to
> retain compatibility with some customers.  Reading FMRC documentation leads
> me to believe that using a dimension element in the prototypeDataset
> element of the collection should rename  the dimension, but it does not.
>
>         What is the correct way to change the name of the model run time
> dimension in a FMRC?
>
>         _______________________________________________
>         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.
>
>
>         netcdfgroup mailing list
>         netcdfgroup@xxxxxxxxxxxxxxxx
>         For list information or to unsubscribe,  visit:
> http://www.unidata.ucar.edu/mailing_lists/
>
>
  • 2017 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: