Difference between revisions of "Thredds"
From MohidWiki
Line 18: | Line 18: | ||
rc.local> /home/user/Download/apache-tomcat-6.0.18/bin/startup.sh | rc.local> /home/user/Download/apache-tomcat-6.0.18/bin/startup.sh | ||
+ | ====Catalogs architecture==== | ||
+ | We propose the following architecture as a good practice for maintaining catalogs. | ||
==Directory tree structure== | ==Directory tree structure== | ||
===$TOMCAT_HOME/content/thredds=== | ===$TOMCAT_HOME/content/thredds=== | ||
− | *'''catalog.xml''': catalog file containing all the netcdf | + | *'''catalog.xml''': catalog file containing links to all the subcatalogs containing the netcdf data. |
+ | **'''pcomsCatalog.xml''': catalog file pointed by the main catalog. | ||
+ | |||
+ | #catalog.xml | ||
+ | <?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="thisDODS" serviceType="OpenDAP" base="/thredds/dodsC/" /> | ||
+ | <datasetRoot path="test" location="content/testdata/"/> | ||
+ | |||
+ | <dataset name="Test Single Dataset" ID="testDataset" serviceName="thisDODS" | ||
+ | urlPath="test/testData.nc"/> | ||
+ | |||
+ | <datasetScan name="Test all files in a directory" ID="testDatasetScan" | ||
+ | path="testAll" location="content/testdata"> | ||
+ | |||
+ | <metadata inherited="true"> | ||
+ | <serviceName>thisDODS</serviceName> | ||
+ | </metadata> | ||
+ | |||
+ | <filter> | ||
+ | <include wildcard="*.nc"/> | ||
+ | </filter> | ||
+ | |||
+ | </datasetScan> | ||
+ | |||
+ | <catalogRef xlink:title="Test Enhanced Catalog" xlink:href="enhancedCatalog.xml" name=""/> | ||
+ | |||
+ | <catalogRef xlink:title="PCOMS Catalog" xlink:href="/opendap/pcoms/pcomsCatalog.xml" name=""/> | ||
+ | |||
+ | </catalog> | ||
+ | |||
==Building thredds urls== | ==Building thredds urls== |
Revision as of 12:17, 4 February 2009
Thredds (Thematic Realtime Environmental Distributed Data Services) is a tomcat servlet that serves xml catalogs of openDAP datasets.
Contents
[hide]Setup
A working tomcat server is a prerequisite. Simply copy the thredds.war file obtained from the thredds homepage into the tomcat webapps directory.
data.mohid.com
- How do I restart the tomcat and thredds server in data.mohid.com?
> cd /home/guillaume/Software/las7/tomcat/tomcat/bin > ./Tomcat5.sh start
- How do I know if tomcat is running?:
> netstat -tlnap | grep 8080
VmMrtSrv06
- 192.168.20.136 when it is resident on the LAN.
- To configure the tomcat to start during boot:
> sudo vim /etc/rc.d/rc.local rc.local> /home/user/Download/apache-tomcat-6.0.18/bin/startup.sh
Catalogs architecture
We propose the following architecture as a good practice for maintaining catalogs.
Directory tree structure
$TOMCAT_HOME/content/thredds
- catalog.xml: catalog file containing links to all the subcatalogs containing the netcdf data.
- pcomsCatalog.xml: catalog file pointed by the main catalog.
#catalog.xml <?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="thisDODS" serviceType="OpenDAP" base="/thredds/dodsC/" /> <datasetRoot path="test" location="content/testdata/"/> <dataset name="Test Single Dataset" ID="testDataset" serviceName="thisDODS" urlPath="test/testData.nc"/> <datasetScan name="Test all files in a directory" ID="testDatasetScan" path="testAll" location="content/testdata"> <metadata inherited="true"> <serviceName>thisDODS</serviceName> </metadata> <filter> <include wildcard="*.nc"/> </filter> </datasetScan> <catalogRef xlink:title="Test Enhanced Catalog" xlink:href="enhancedCatalog.xml" name=""/> <catalogRef xlink:title="PCOMS Catalog" xlink:href="/opendap/pcoms/pcomsCatalog.xml" name=""/> </catalog>
Building thredds urls
Dataset
- Viewing a ${catalog} file tree named ${catalog}.xml:
http://data.mohid.com:8080/thredds/${catalog}.html
- Viewing a specific ${dataset} thredds metadata:
http://data.mohid.com:8080/thredds/${catalog}.html?dataset=${dataset.id}
- Viewing a specific ${dataset}:
http://data.mohid.com:8080/${dataset.service.base}/${dataset.urlpath}
DatasetScan
- Viewing a particular ${datasetscan} tree from any ${catalog} in the thredds server:
http://data.mohid.com:8080/thredds/catalog/${datasetscan.path}/catalog.html
- Viewing a specific ${datasetscan.filteredfilename} thredds metadata:
http://data.mohid.com:8080/thredds/catalog/${datasetscan.path}/catalog.html?dataset=${datasetscan.id}/${datasetscan.filteredfilename}.nc.html
- Viewing a specific ${datasetscan.filteredfilename} dataset:
http://data.mohid.com:8080/${datasetscan.service.base}/${datasetscan.path}/${datasetscan.filteredfilename}.nc.html
A sample catalog file
[XML]
<?xml version="1.0" encoding="UTF-8"?>
<catalog name="MOHID THREDDS Server Catalog"
xmlns="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0"
xmlns:xlink="http://www.w3.org/1999/xlink">
<service name="MOHID DODS" serviceType="OpenDAP" base="/thredds/dodsC/" />
<datasetRoot path="test" location="content/testdata/"/>
<dataset name="Test Single Dataset" ID="testDataset" serviceName="MOHID DODS"
urlPath="test/testData.nc"/>
<datasetScan name="Test all files in a directory" ID="testDatasetScan"
path="testAll" location="content/testdata">
<metadata inherited="true">
<serviceName>MOHID DODS</serviceName>
</metadata>
<filter>
<include wildcard="*.nc"/>
</filter>
</datasetScan>
<catalogRef xlink:title="Test Enhanced Catalog" xlink:href="enhancedCatalog.xml" name=""/>
</catalog>