2005-05-17 00:11:41 +01:00
|
|
|
#!/usr/bin/python
|
|
|
|
import sys,csv,os,cStringIO
|
|
|
|
|
2010-08-03 13:04:08 +01:00
|
|
|
CS_BINARY = "cavestats"
|
2007-02-21 15:31:51 +00:00
|
|
|
N = 30 # Number to include in "N longest" and "N deepest" lists
|
2005-05-17 00:11:41 +01:00
|
|
|
|
|
|
|
# Utility functions
|
|
|
|
|
|
|
|
def chomp(s):
|
|
|
|
if(s[-1]=="\n"): return s[:-1]
|
|
|
|
else: return s
|
|
|
|
|
|
|
|
# Important functions
|
|
|
|
|
|
|
|
def find_effective_number(c):
|
|
|
|
"""Determine an appropriate number to use."""
|
|
|
|
if c["Kataster Number"]:
|
|
|
|
return c["Kataster Number"]
|
|
|
|
else:
|
|
|
|
return c["Unofficial number"]
|
|
|
|
def find_name(c):
|
|
|
|
if c["Name"]: return c["Name"]
|
|
|
|
elif c["Unofficial Name"]: return c["Unofficial Name"]
|
|
|
|
else: return "?"
|
|
|
|
|
|
|
|
def dataset_prefix(c):
|
2005-05-17 13:46:04 +01:00
|
|
|
translations = {"2002-xx" : "quarriesd", "la11" : "lunge", "la12" : "sternloch", "la34" : "raetsel", "2001-ms-01" : "bogen" }
|
2005-05-17 00:11:41 +01:00
|
|
|
if translations.has_key(c):
|
|
|
|
return translations[c]
|
|
|
|
else:
|
|
|
|
return c
|
|
|
|
|
|
|
|
def print_caveline(number, l, d, w, cave):
|
|
|
|
dplong.write("<tr><td>%s</td>" % number)
|
|
|
|
if cave["Autogen file"]: # single caves
|
|
|
|
dplong.write("""<td class="name"><a href="%s">%s</a></td>""" % (cave["Autogen file"], find_name(cave)))
|
|
|
|
dplong.write("""<td>%.1f</td><td>%.1f</td><td>%.1f</td></tr>\n""" % (l,d,w))
|
2007-02-21 15:31:51 +00:00
|
|
|
dump.write("%s\t%d\t%d\t%d\n" % (number, l, d, w))
|
2005-05-17 00:11:41 +01:00
|
|
|
else: # virtual entries for cave systems
|
|
|
|
dplong.write("""<td class="name">%s</td>""" % find_name(cave))
|
|
|
|
dplong.write("""<td><i>%.1f</i></td><td><i>%.1f</td><td><i>%.1f</i></td></tr>\n""" % (l,d,w))
|
|
|
|
|
2005-06-24 23:17:41 +01:00
|
|
|
|
2005-05-17 00:11:41 +01:00
|
|
|
def parse_csvfile():
|
|
|
|
caveslist = []
|
|
|
|
print "Calculating SMK-system extent... ",
|
2009-07-16 13:22:41 +01:00
|
|
|
os.popen("cavern ../loser/smk-system -o noinfo/smk-system.3d")
|
2005-08-12 21:29:26 +01:00
|
|
|
l,d,w = map(float, chomp(os.popen(CS_BINARY + " noinfo/smk-system -c ").read()).split("\t"))
|
2005-05-17 00:11:41 +01:00
|
|
|
caveslist.append(["", l,d,w, {"Name" : "<i>Schwarzmooskogelhöhlensystem</i>", "Autogen file" : ""}])
|
|
|
|
print "done\nParsing CSV file"
|
|
|
|
cavetabfile = file("noinfo/CAVETAB2.CSV")
|
|
|
|
fieldnames=chomp(cavetabfile.next()).replace('"','').split(",")
|
|
|
|
cavetab = csv.DictReader(cavetabfile, fieldnames)
|
|
|
|
|
|
|
|
# Gratuitiously complicated progress bar widget.
|
|
|
|
k = 0
|
|
|
|
m = 1
|
2007-02-21 15:31:51 +00:00
|
|
|
L = 498 #L = len(cavetabfile.readlines()) doesn't work
|
2005-05-17 00:11:41 +01:00
|
|
|
print "0"+50*"-"+"100%\n|",
|
|
|
|
for cave in cavetab:
|
|
|
|
if((50*m)/L > k):
|
|
|
|
sys.stdout.write("=")
|
|
|
|
sys.stdout.flush()
|
|
|
|
k = k + 1
|
|
|
|
m = m + 1
|
|
|
|
if(cave["Multiple entrances"] not in ["", "yes"]): continue
|
|
|
|
|
|
|
|
number = find_effective_number(cave)
|
|
|
|
if((cave["Area"]=="1626") and (number not in ['LA11', 'LA12'])): continue
|
|
|
|
|
|
|
|
prefix = dataset_prefix(number.lower())
|
2005-08-12 21:29:26 +01:00
|
|
|
stats = os.popen(CS_BINARY + " noinfo/all -cs " + prefix).read()
|
2005-05-17 00:11:41 +01:00
|
|
|
if(stats.find("No") != -1):
|
|
|
|
continue # don't trust the rather erratic data in the table
|
|
|
|
#if(cave["Length"]): print number, "length:", cave["Length"]
|
|
|
|
#if(cave["Depth"]): print number, "depth:", cave["Depth"]
|
|
|
|
#if(cave["Extent"]): print number, "extent:", cave["Extent"]
|
|
|
|
else:
|
2005-05-28 09:47:25 +01:00
|
|
|
try:
|
|
|
|
l,d,w = map(float, chomp(stats).split("\t"))
|
|
|
|
caveslist.append([number,l,d,w,cave])
|
|
|
|
except:
|
|
|
|
print "Error on", number
|
|
|
|
raise
|
2007-02-21 15:31:51 +00:00
|
|
|
print "|%d\nWriting output file" % m
|
2005-05-17 00:11:41 +01:00
|
|
|
return caveslist
|
|
|
|
|
|
|
|
# Main routine:
|
|
|
|
|
2011-07-14 03:13:06 +01:00
|
|
|
#if (not os.access('CS_BINARY', os.X_OK)):
|
|
|
|
# print "CS_BINARY not executable - skipping %s" % __file__
|
|
|
|
# exit(1)
|
2011-02-03 01:29:30 +00:00
|
|
|
|
2005-05-17 00:11:41 +01:00
|
|
|
caveslist = parse_csvfile()
|
|
|
|
|
|
|
|
dplong = file("dplong.htm", "w")
|
2007-02-21 15:31:51 +00:00
|
|
|
dump = file("noinfo/lengths.dat", "w")
|
2005-05-17 00:11:41 +01:00
|
|
|
|
|
|
|
dplong.write("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
|
<html>
|
|
|
|
<!-- Do not edit this file - it is auto-generated. Edit create_dplong_table.py instead. -->
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
|
|
<title>CUCC's deepest and longest caves</title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="css/main2.css" />
|
|
|
|
<style type="text/css">
|
|
|
|
#funnytable { margin: 0 auto; border-collapse: collapse; border: 2px solid black }
|
|
|
|
#funnytable td,
|
|
|
|
#funnytable th { border: 1px solid black}
|
|
|
|
#funnytable th { border-bottom: 2px solid black }
|
|
|
|
#funnytable td { text-align: right; }
|
|
|
|
#funnytable td.name { text-align: left }
|
|
|
|
h3 {text-align: center}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>Lengths and depths of caves in the 1623 area</h1>
|
|
|
|
|
|
|
|
<p>This page lists the lengths, depths and horizontal extents of those caves on
|
|
|
|
the plateau for which we have survey centerline data. At present, that's only
|
|
|
|
%d out of 250 or so, but the missing ones are mostly very small and obscure;
|
|
|
|
the notable exceptions are some caves explored by other groups (35, LA25,
|
|
|
|
BS17), and CUCC caves 71, 76, 92, 96 and 97. Of the latter 76 (by far the most
|
|
|
|
significant of these) is in the process of being re-explored, and the figures
|
|
|
|
in the table are for the portions revisited so far.</p>
|
|
|
|
|
|
|
|
<p>The eight main constitutent parts of the Schwarzmooskogel master system (40,
|
|
|
|
41, 78, 88, 115, 116, 136, 144 and 161) are listed separately in the table,
|
|
|
|
although in some cases there is some ambiguity as to where to draw the lines;
|
|
|
|
but for comparison I have also included the measurements of the whole system.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>In these tables "length" means the total length of survey legs, not just the
|
|
|
|
horizontal components, but "extent" is the maximum horizontal distance between
|
|
|
|
any two survey stations. (If anyone knows a good algorithm for finding the
|
|
|
|
maximum 3D spatial diameter of a set of points, and is willing to implement it,
|
|
|
|
please do so!)</p>
|
|
|
|
|
|
|
|
<p><a href="#deepest">Deepest caves</a> — <a href="#longest">Longest
|
|
|
|
caves</a></p>
|
|
|
|
|
|
|
|
<table id="funnytable">
|
|
|
|
<tr>
|
|
|
|
<th>Kat. Nr.</th><th>Name</th><th>Length (m)</th><th>Depth (m)</th><th>Extent
|
|
|
|
(m)</th></tr>""" % len(caveslist))
|
|
|
|
|
|
|
|
for cave in caveslist:
|
|
|
|
print_caveline(*cave)
|
|
|
|
|
|
|
|
dplong.write("""</table>
|
|
|
|
<h3 id="deepest">The plateau's %d deepest caves</h3>
|
|
|
|
<table id="funnytable">
|
|
|
|
<tr>
|
|
|
|
<th>Kat. Nr.</th><th>Name</th><th>Length (m)</th><th>Depth (m)</th><th>Extent (m)</th></tr>""" % N)
|
|
|
|
|
2007-02-21 15:31:51 +00:00
|
|
|
dump.close()
|
|
|
|
dump = cStringIO.StringIO() # just throw it away!
|
|
|
|
|
2005-05-17 00:11:41 +01:00
|
|
|
caveslist.sort(lambda u, v: cmp(v[2],u[2]))
|
|
|
|
for cave in caveslist[:N]:
|
|
|
|
print_caveline(*cave)
|
|
|
|
|
|
|
|
dplong.write("""</table>
|
|
|
|
<h3 id="longest">The plateau's %d longest caves</h3>
|
|
|
|
<table id="funnytable">
|
|
|
|
<tr>
|
|
|
|
<th>Kat. Nr.</th><th>Name</th><th>Length (m)</th><th>Depth (m)</th><th>Extent (m)</th></tr>""" % N)
|
|
|
|
|
|
|
|
caveslist.sort(lambda u, v: cmp(v[1],u[1]))
|
|
|
|
for cave in caveslist[:N]:
|
|
|
|
print_caveline(*cave)
|
|
|
|
|
|
|
|
|
|
|
|
dplong.write("""</table>
|
|
|
|
|
|
|
|
|
|
|
|
<p>This page used to house a list of the deepest and longest caves in Austria,
|
|
|
|
with ours highlighted. Rather than maintaining our own independent database, it
|
|
|
|
seems much more sensible to link to the much more frequently updated list <a
|
|
|
|
href="http://www.nhm-wien.ac.at/NHM/Hoehle/lth.htm">here</a> maintained by Theo
|
|
|
|
Pfarr. For comparison, Bob Gulden of the American NSS maintains a list <a
|
|
|
|
href="http://www.pipeline.com/~caverbob/">here</a> of the world's longest
|
|
|
|
caves.</p>
|
|
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
<ul id="links">
|
|
|
|
<li>Back to <a href="infodx.htm">Expedition Index</a> page</li>
|
|
|
|
<li><b>Cave description indices:</b>
|
|
|
|
<ul>
|
|
|
|
<li>Caves in CUCC's area <a href="indxal.htm">1623</a></li>
|
2005-06-12 12:31:07 +01:00
|
|
|
<li>Adjacent area <a href="1626/index.html">1626</a></li>
|
2005-05-17 00:11:41 +01:00
|
|
|
</ul></li>
|
|
|
|
<li>Back to <a href="../index.htm">CUCC home page</a></li>
|
|
|
|
</ul>
|
|
|
|
</body>
|
|
|
|
</html>""")
|
|
|
|
|
2007-02-21 15:31:51 +00:00
|
|
|
dump.close()
|