[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[THREDDS #QWG-847709]: Possible to add attributes via NcML to non-cached THREDDS datasets?



Hi Rich,

I did the following, and verified that the added attribute shows up in the 
OpenDap form.  Note that virtual datasets (the NcML makes this a virtual 
dataset) can't be served up via HTTP or FTP.

<?xml version="1.0" encoding="UTF-8"?>
<catalog name="THREDDS Server Default Catalog : You must change this to fit 
your server!"
        xmlns="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0";
        xmlns:xlink="http://www.w3.org/1999/xlink";>

  <service name="all" base="" serviceType="compound">
    <service name="odap" serviceType="OpenDAP" base="/thredds/dodsC/" />
    <service name="ncdods" serviceType="OpenDAP" base="/thredds/dodsC/" />
    <service name="http" serviceType="HTTPServer" base="/thredds/fileServer/" />
    <!--service name="wcs" serviceType="WCS" base="/thredds/wcs/" /-->
    <!--service name="wms" serviceType="WMS" base="/thredds/wms/" /-->
    <!--service name="ncss" serviceType="NetcdfSubset" 
base="/thredds/ncss/grid/" /-->
  </service>

  <datasetRoot path="rsignell/noncacheddata" 
location="C:/Users/madry/work/RichSignell/" cache="false" />

  <dataset name="Rich Signell Noncached Data" ID="noncached Data" 
urlPath="rsignell/virtualdata/ncml" dataType="Grid">

    <serviceName>all</serviceName>
    <netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";
            location="C:/Users/madry/work/RichSignell/5941mc-a.nc">
      <attribute name="cdm_data_type" value="any"/>
    </netcdf>

  </dataset>

</catalog>

I'll see about answering on SO, too.

-Lansing

> For several years on our THREDDS Data Server (TDS) we've been happily
> using the cache="false" functionality on datasetRoot to tell the TDS
> not to cache several netcdf files.
> 
> <service name="allServices" serviceType="Compound" base="">
> <service name="ncdods" serviceType="OpenDAP" base="/thredds/dodsC/"/>
> <service name="HTTPServer" serviceType="HTTPServer"
> base="/thredds/fileServer/"/>
> <service name="iso" serviceType="ISO" base="/thredds/iso/"/>
> <service name="uddc" serviceType="UDDC" base="/thredds/uddc/"/>
> </service>
> 
> <datasetRoot path="FVCOM" location="/http/www/CODFISH/Data/FVCOM/"
> cache="false"/>
> 
> <dataset name="NECOFS GOM2 Forecast" ID="gom2_nocache"
> serviceName="allServices"
> urlPath="FVCOM/NECOFS/Forecasts/NECOFS_GOM2_FORECAST.nc" dataType="Grid"/>
> 
> The reason we don't want to ever cache these files is that every day
> these daily forecast files get overwritten with files that have the
> same name, but different data.
> 
> But now we have a need to add and modify the attributes of these
> datasets. In particular, we would like to add the global attribute
> 
> <attribute name="cdm_data_type" value="any"/>
> 
> Can we modify attributes via NcML when the dataset to be modified is
> contained in this kind of datasetRoot construct?
> 
> It would be great if the question could be answered here:
> <http://stackoverflow.com/questions/19008223/possible-to-add-attributes-via-ncml-to-non-cached-thredds-datasets>
> where the formatting is nice, and more folks can benefit/participate.
> 
> Thanks,
> Rich
> 
> 
> --
> Dr. Richard P. Signell   (508) 457-2229
> USGS, 384 Woods Hole Rd.
> Woods Hole, MA 02543-1598
> 
> 


Ticket Details
===================
Ticket ID: QWG-847709
Department: Support THREDDS
Priority: Urgent
Status: Open


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.