<catalog xmlns="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 xsi:schemaLocation="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0 http://www.unidata.ucar.edu/schemas/thredds/InvCatalog.1.0.6.xsd"
	 xmlns:xlink="http://www.w3.org/1999/xlink"
	 name="{{ name }}">

  <service base="" name="all" serviceType="compound">
    <service base="/thredds/dodsC/" name="odap" serviceType="OpenDAP" />
    <service base="/thredds/dap4/" name="dap4" serviceType="DAP4" />
    <service base="/thredds/fileServer/" name="http" serviceType="HTTPServer" />
    <service base="/thredds/wcs/" name="wcs" serviceType="WCS" />
    <service base="/thredds/wms/" name="wms" serviceType="WMS" />
    <service base="/thredds/ncss/grid/" name="ncssGrid" serviceType="NetcdfSubset" />
    <service base="/thredds/ncss/point/" name="ncssPoint" serviceType="NetcdfSubset" />
    <service base="/thredds/cdmremote/" name="cdmremote" serviceType="CdmRemote" />
    <service base="/thredds/cdmrfeature/grid/" name="cdmrFeature" serviceType="CdmrFeature" />
    <service base="/thredds/iso/" name="iso" serviceType="ISO" />
    <service base="/thredds/ncml/" name="ncml" serviceType="NCML" />
    <service base="/thredds/uddc/" name="uddc" serviceType="UDDC" />
  </service>

  <service base="" name="virtual" serviceType="compound">
    <service base="/thredds/dodsC/" name="odap" serviceType="OpenDAP" />
    <service base="/thredds/dap4/" name="dap4" serviceType="DAP4" />
    <service base="/thredds/ncss/grid/" name="ncssGrid" serviceType="NetcdfSubset" />
    <service base="/thredds/ncss/point/" name="ncssPoint" serviceType="NetcdfSubset" />
    <service base="/thredds/cdmremote/" name="cdmremote" serviceType="CdmRemote" />
    <service base="/thredds/cdmrfeature/grid/" name="cdmrFeature" serviceType="CdmrFeature" />
    <service base="/thredds/iso/" name="iso" serviceType="ISO" />
    <service base="/thredds/ncml/" name="ncml" serviceType="NCML" />
    <service base="/thredds/uddc/" name="uddc" serviceType="UDDC" />
  </service>

  <datasetRoot location="{{ ncml_location }}" path="{{ name }}" />

  <datasetScan name="{{ name|replace('-', '_') }}_Files" path="{{ name }}-files" location="{{ data_location }}" >
    <serviceName>all</serviceName>
  </datasetScan>

  <!-- Virtual datasets -->
  <dataset name="{{ name|replace('-', '_') }}_Virtual_Datasets" ID="{{ name }}">
    {% for ncml in ncmls|sort -%}
    <dataset name="{{ ncml.split('-')[2:]|join('_')|replace('.ncml', '') }}" ID="{{ ncml|replace('.ncml', '') }}" serviceName="virtual" urlPath="{{ name }}/{{ ncml }}" />
    {% endfor %}
  </dataset>
</catalog>
