Skip to content

Commit

Permalink
Add v89 of standard name table and v12 of area type table.
Browse files Browse the repository at this point in the history
  • Loading branch information
japamment committed Jan 22, 2025
1 parent 96efbfc commit 97430c6
Show file tree
Hide file tree
Showing 26 changed files with 191,220 additions and 1,083 deletions.
3 changes: 3 additions & 0 deletions Data/area-type-table/12/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The XML file in the src directory is used to build the HTML version of the CF Area Type Table in the build directory.

See the makefile for the avilable document build options.
264 changes: 264 additions & 0 deletions Data/area-type-table/12/build/area-type-table.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions Data/area-type-table/12/get-title-version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env python

import sys, re

HELP = """%s - Retrieves title string. \nUsage: %s <file>"""%(sys.argv[0], sys.argv[0])

if len(sys.argv) < 2:
print(HELP)
sys.exit(1)

file = sys.argv[1]

# Read input.
with open(file, 'r', encoding="utf8") as i:
s = i.read()

# Read input.
#i = open(file, 'r')
#s = i.read()
#i.close()

# Fetch title.
p = re.compile('<title>(.*?)</title>', re.DOTALL)
m = re.search(p, s)
title = m.group(1)

# Fetch version.
version = None
try:
p = re.compile('<subtitle>Version (.*?),(.*?)</subtitle>', re.DOTALL)
m = re.search(p, s)
version = m.group(1)
except:
try:
p = re.compile('<version_number>(.*?)</version_number>', re.DOTALL)
m = re.search(p, s)
version = m.group(1)
except:
pass

# Print output.
print('--------------------------------------------')
print(' Title: %s'%title)
if version != None:
print(' Version: %s'%version)
print('--------------------------------------------')


6 changes: 6 additions & 0 deletions Data/area-type-table/12/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
clean:
rm build/area-type-table.html

area-type-table:
xsltproc xsl/html/area-type-table-1.1.xsl src/area-type-table.xml > build/area-type-table.html
./get-title-version.py src/area-type-table.xml
189 changes: 189 additions & 0 deletions Data/area-type-table/12/src/area-type-table.xml

Large diffs are not rendered by default.

129 changes: 129 additions & 0 deletions Data/area-type-table/12/xsl/html/area-type-table-1.1.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:template match="/">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>

<xsl:template match="area_type_table">
<head>
<!-- Put something useful into the Title -->
<title>CF area types</title>

<h1 class="documentFirstHeading">CF Area Type Table</h1>

<!-- This page requires an external javascript which is included by Plone -->
<!-- See: /usr/local/zopeinstance1/Products/CMFPlone/skins/plone_ecmascript/toggleHelp.js -->
<script>

function toggleHelp(standard_name)
{
// check for the existence of the help tr object for this standard_name
var helpDiv = document.getElementById(standard_name + '_help');

if (helpDiv)
{
if (helpDiv.style.display != 'none')
{
helpDiv.style.display = 'none';

curArrow = document.getElementById(standard_name + '_arrow');
curArrow.src = '../build/media/images/arrow_right.gif';
}
else
{
helpDiv.style.display = '';

curArrow = document.getElementById(standard_name + '_arrow');
curArrow.src = '../build/media/images/arrow_down.gif';
}
}
}


function showHelp(standard_name)
{
var helpDiv = document.getElementById(standard_name + '_help');

if (helpDiv)
{
helpDiv.style.display = '';
curArrow = document.getElementById(standard_name + '_arrow');
curArrow.src = '../build/media/images/arrow_down.gif';
}
}

function hideHelp(standard_name)
{
var helpDiv = document.getElementById(standard_name + '_help');

if (helpDiv)
{
helpDiv.style.display = 'none';
curArrow = document.getElementById(standard_name + '_arrow');
curArrow.src = '../build/media/images/arrow_right.gif';
}
}

</script>

</head>
<body>
<b>Version <xsl:value-of select="version_number"/>, <xsl:value-of select="date"/></b>
<br/>
<table id="area_type_table" border="1" width="100%" cellpadding="2" cellspacing="0">
<th width="100%">Area Type</th>
<xsl:apply-templates select="entry"/>
</table>
</body>
</xsl:template>

<xsl:template match="entry">
<tr>
<xsl:attribute name="id"><xsl:value-of select="@id"/>_tr</xsl:attribute>

<td>
<a>
<xsl:attribute name="name">
<xsl:value-of select="@id"/>
</xsl:attribute>
</a>
<img>
<xsl:attribute name="id"><xsl:value-of select="@id"/>_arrow</xsl:attribute>
<xsl:attribute name="src">../build/media/images/arrow_right.gif</xsl:attribute>
</img>
<code class="varname">
<a>
<xsl:attribute name="href">javascript:void(0)</xsl:attribute>
<xsl:attribute name="onclick">toggleHelp('<xsl:value-of select="@id"/>')</xsl:attribute>
<xsl:value-of select="@id"/>
</a>
</code>
<xsl:variable name="area_type_id" select="@id"/>
<xsl:apply-templates select="../alias[entry_id=$area_type_id]"/>

<div>
<xsl:attribute name="id"><xsl:value-of select="@id"/>_help</xsl:attribute>
<xsl:attribute name="style">display: none; padding-left: 16px; margin-top: 4px; border-top: 1px dashed #cccccc;</xsl:attribute>

<xsl:choose>
<xsl:when test="description=''">
No help available.
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="description"/>
</xsl:otherwise>
</xsl:choose>
</div>

</td>
</tr>
</xsl:template>

<xsl:template match="alias">
<div style="padding-left: 16px;"><i>alias:</i>&#160;<xsl:value-of select="@id"/></div>
</xsl:template>

</xsl:stylesheet>
14 changes: 13 additions & 1 deletion Data/area-type-table/current/build/area-type-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h1 class="documentFirstHeading">CF Area Type Table</h1>
</script>
</head>
<body>
<b>Version 11, 06 July 2023</b><br><table id="area_type_table" border="1" width="100%" cellpadding="2" cellspacing="0">
<b>Version 12, 21 January 2025</b><br><table id="area_type_table" border="1" width="100%" cellpadding="2" cellspacing="0">
<th width="100%">Area Type</th>
<tr id="air_tr"><td>
<a name="air"></a><img id="air_arrow" src="../build/media/images/arrow_right.gif"><code class="varname"><a href="javascript:void(0)" onclick="toggleHelp('air')">air</a></code><div id="air_help" style="display: none; padding-left: 16px; margin-top: 4px; border-top: 1px dashed #cccccc;">The area type of "air" distinguishes the atmospheric portion of a domain from the land portion (or any other non-air portion). It is needed when a variable such as wind speed is reported, for example, on a surface at mean sea level pressure. At most locations over land, this surface would be underground and would need to be excluded from consideration, which could be indicated by specifying a cell_ methods "where air".</div>
Expand All @@ -72,6 +72,12 @@ <h1 class="documentFirstHeading">CF Area Type Table</h1>
No help available.
</div>
</td></tr>
<tr id="broadleaf_deciduous_trees_tr"><td>
<a name="broadleaf_deciduous_trees"></a><img id="broadleaf_deciduous_trees_arrow" src="../build/media/images/arrow_right.gif"><code class="varname"><a href="javascript:void(0)" onclick="toggleHelp('broadleaf_deciduous_trees')">broadleaf_deciduous_trees</a></code><div id="broadleaf_deciduous_trees_help" style="display: none; padding-left: 16px; margin-top: 4px; border-top: 1px dashed #cccccc;">Broadleaf trees are characterized by leaves that are broad, flat and thin with networked veins (reference: https://treeterms.co.uk/broadleaf/). Deciduous trees lose their leaves seasonally, for example, during winter in high latitudes or following seasonal variations in rainfall.</div>
</td></tr>
<tr id="broadleaf_evergreen_trees_tr"><td>
<a name="broadleaf_evergreen_trees"></a><img id="broadleaf_evergreen_trees_arrow" src="../build/media/images/arrow_right.gif"><code class="varname"><a href="javascript:void(0)" onclick="toggleHelp('broadleaf_evergreen_trees')">broadleaf_evergreen_trees</a></code><div id="broadleaf_evergreen_trees_help" style="display: none; padding-left: 16px; margin-top: 4px; border-top: 1px dashed #cccccc;">Broadleaf trees are characterized by leaves that are broad, flat and thin with networked veins (reference: https://treeterms.co.uk/broadleaf/). Evergreen plants retain their leaves through the year and into the following growing season (reference: https://www.britannica.com/plant/evergreen-plant).</div>
</td></tr>
<tr id="burnt_vegetation_tr"><td>
<a name="burnt_vegetation"></a><img id="burnt_vegetation_arrow" src="../build/media/images/arrow_right.gif"><code class="varname"><a href="javascript:void(0)" onclick="toggleHelp('burnt_vegetation')">burnt_vegetation</a></code><div id="burnt_vegetation_help" style="display: none; padding-left: 16px; margin-top: 4px; border-top: 1px dashed #cccccc;">
No help available.
Expand Down Expand Up @@ -166,6 +172,12 @@ <h1 class="documentFirstHeading">CF Area Type Table</h1>
<tr id="natural_grasses_of_c4_plant_functional_types_tr"><td>
<a name="natural_grasses_of_c4_plant_functional_types"></a><img id="natural_grasses_of_c4_plant_functional_types_arrow" src="../build/media/images/arrow_right.gif"><code class="varname"><a href="javascript:void(0)" onclick="toggleHelp('natural_grasses_of_c4_plant_functional_types')">natural_grasses_of_c4_plant_functional_types</a></code><div id="natural_grasses_of_c4_plant_functional_types_help" style="display: none; padding-left: 16px; margin-top: 4px; border-top: 1px dashed #cccccc;">"Natural grasses" means grasses growing in areas of low productivity, often situated on rough or uneven ground. This can include rocky areas, briars and heathland. A "c4 plant" is one that utilizes the C4 carbon fixation pathway in which the CO2 is first bound to a compound containing four carbon atoms before photosynthesis reactions take place. All trees are C3 type. Grasses and crops can be C3 or C4.</div>
</td></tr>
<tr id="needleleaf_deciduous_trees_tr"><td>
<a name="needleleaf_deciduous_trees"></a><img id="needleleaf_deciduous_trees_arrow" src="../build/media/images/arrow_right.gif"><code class="varname"><a href="javascript:void(0)" onclick="toggleHelp('needleleaf_deciduous_trees')">needleleaf_deciduous_trees</a></code><div id="needleleaf_deciduous_trees_help" style="display: none; padding-left: 16px; margin-top: 4px; border-top: 1px dashed #cccccc;">Needleleaf trees, often referred to as conifers, have long, thin needle-shaped leaves that are well adapted to retaining water. Deciduous trees lose their leaves seasonally, for example, during winter in high latitudes or following seasonal variations in rainfall.</div>
</td></tr>
<tr id="needleleaf_evergreen_trees_tr"><td>
<a name="needleleaf_evergreen_trees"></a><img id="needleleaf_evergreen_trees_arrow" src="../build/media/images/arrow_right.gif"><code class="varname"><a href="javascript:void(0)" onclick="toggleHelp('needleleaf_evergreen_trees')">needleleaf_evergreen_trees</a></code><div id="needleleaf_evergreen_trees_help" style="display: none; padding-left: 16px; margin-top: 4px; border-top: 1px dashed #cccccc;">Needleleaf trees, often referred to as conifers, have long, thin needle-shaped leaves that are well adapted to retaining water. Evergreen plants retain their leaves through the year and into the following growing season (reference: https://www.britannica.com/plant/evergreen-plant).</div>
</td></tr>
<tr id="pastures_tr"><td>
<a name="pastures"></a><img id="pastures_arrow" src="../build/media/images/arrow_right.gif"><code class="varname"><a href="javascript:void(0)" onclick="toggleHelp('pastures')">pastures</a></code><div id="pastures_help" style="display: none; padding-left: 16px; margin-top: 4px; border-top: 1px dashed #cccccc;">Pastures are assumed to be anthropogenic in origin. They include anthropogenically managed pastureland and rangeland.</div>
</td></tr>
Expand Down
16 changes: 14 additions & 2 deletions Data/area-type-table/current/src/area-type-table.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<area_type_table xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="area-type-table-1.1.xsd">
<title>Area Type Table</title>
<version_number>11</version_number>
<date>06 July 2023</date>
<version_number>12</version_number>
<date>21 January 2025</date>
<institution>Centre for Environmental Data Analysis</institution>
<contact>[email protected]</contact>

Expand All @@ -15,6 +15,12 @@
<entry id="bare_ground">
<description></description>
</entry>
<entry id="broadleaf_deciduous_trees">
<description>Broadleaf trees are characterized by leaves that are broad, flat and thin with networked veins (reference: https://treeterms.co.uk/broadleaf/). Deciduous trees lose their leaves seasonally, for example, during winter in high latitudes or following seasonal variations in rainfall.</description>
</entry>
<entry id="broadleaf_evergreen_trees">
<description>Broadleaf trees are characterized by leaves that are broad, flat and thin with networked veins (reference: https://treeterms.co.uk/broadleaf/). Evergreen plants retain their leaves through the year and into the following growing season (reference: https://www.britannica.com/plant/evergreen-plant).</description>
</entry>
<entry id="burnt_vegetation">
<description></description>
</entry>
Expand Down Expand Up @@ -99,6 +105,12 @@
<entry id="natural_grasses_of_c4_plant_functional_types">
<description>"Natural grasses" means grasses growing in areas of low productivity, often situated on rough or uneven ground. This can include rocky areas, briars and heathland. A "c4 plant" is one that utilizes the C4 carbon fixation pathway in which the CO2 is first bound to a compound containing four carbon atoms before photosynthesis reactions take place. All trees are C3 type. Grasses and crops can be C3 or C4.</description>
</entry>
<entry id="needleleaf_deciduous_trees">
<description>Needleleaf trees, often referred to as conifers, have long, thin needle-shaped leaves that are well adapted to retaining water. Deciduous trees lose their leaves seasonally, for example, during winter in high latitudes or following seasonal variations in rainfall.</description>
</entry>
<entry id="needleleaf_evergreen_trees">
<description>Needleleaf trees, often referred to as conifers, have long, thin needle-shaped leaves that are well adapted to retaining water. Evergreen plants retain their leaves through the year and into the following growing season (reference: https://www.britannica.com/plant/evergreen-plant).</description>
</entry>
<entry id="pastures">
<description>Pastures are assumed to be anthropogenic in origin. They include anthropogenically managed pastureland and rangeland.</description>
</entry>
Expand Down
3 changes: 3 additions & 0 deletions Data/cf-standard-names/89/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The XML file in the src directory is used to build the HTML version of the CF Standard Name Table in the build directory.

See the makefile for the available document build options.
Loading

0 comments on commit 97430c6

Please sign in to comment.