Skip to content

Commit

Permalink
lots of updates
Browse files Browse the repository at this point in the history
  • Loading branch information
treviallen committed Dec 14, 2018
1 parent f994d84 commit 2ce15e9
Show file tree
Hide file tree
Showing 403 changed files with 5,286 additions and 7,623 deletions.
10 changes: 9 additions & 1 deletion catalogue/data/au_station_data.dat
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ HRD 145.65 -17.76 2 1990 01 1993 12
HTT 138.9217 -33.4305 1 1962 02 2031 01
HUM 147.029 -36.111 3 1993 6 2029 12
HUTY 144.13623 -36.89122 2 1991 5 1991 5
INKA 140.7456 -27.741 2 2013 6 2599 12
INV 149.666656 -34.965004 1 1959 1 1972 8
ISQ 139.555 -20.7167 1 1980 01 1987 00
IVN 149.666656 -34.966663 1 1972 09 1982 09
Expand Down Expand Up @@ -295,6 +296,7 @@ KIM 151.7507 -32.9518 3 1989 12 2025 12
KING 150.7420 -33.7630 3 1996 6 2025 12
KITY 151.36715 -32.90852 2 1994 8 1994 8
KLB 117.76 -31.5917 1 1981 9 2025 12
KLBR 117.7546 -31.5915 1 1981 9 2025 12
KLG 121.4583 -30.7833 1 1964 0 1986 5
KLGA 121.4383 -30.7167 1 1986 5 1988 8
KMBL 121.8906 -31.3682 1 2000 11 2037 12
Expand All @@ -309,6 +311,7 @@ KPT 150.4819 -30.8851 2 1997 2 2029 12
KTL 150.40426 -33.8621 2 1993 10 2025 12
LAKY 144.03577 -36.90137 1 1991 5 1991 5
LBX 150.87355 -34.27212 1 1992 6 2029 12
LCRK 138.2162 -30.4472 1 2013 6 2599 12
LEAH 146.45141 -42.303329 3 2003 7 2032 12
LER 149.365005 -34.934998 1 1970 1 1993 1
LGT 147.46358 -36.76326 2 1989 5 2025 12
Expand Down Expand Up @@ -365,6 +368,7 @@ MRWA 115.9960 -29.2180 1 1984 6 1999 10
MSB 146.2923 -37.7421 2 1988 10 1989 6
MTCL 146.183 -41.492 2 2002 9 2003 7
MTHY 124.9164 -16.822 2 1997 8 1997 12
MTKN 115.7737 -31.9333 2 2009 6 2599 12
MTL 146.5642 -38.4015 3 1995 11 1998 12
MTLY 146.55655 -38.39274 3 1990 7 1992 3
MTLZ 146.5705 -38.4131 3 1992 3 1995 11
Expand All @@ -373,6 +377,7 @@ MTN 131.1300 -12.8467 1 1972 6 1995 3
MTRD 145.5436 -41.8464 1 1991 3 2003 7
MTSU 144.3194 -18.14839 1 2002 03 2031 01
MTV 146.565 -38.4017 1 1964 0 1970 0
MULG 134.0585 -30.2818 1 2013 5 2599 12
MUN 116.2083 -31.9783 1 1959 1 2037 12
MYLY 151.34626 -32.95099 3 1994 8 1994 8
MYS 138.2154 -30.4513 3 1994 12 1995 6
Expand Down Expand Up @@ -413,6 +418,7 @@ PNA 138.1647 -32.0057 1 1969 9 2000 2
PND 145.270883 -37.634592 2 1988 8 1995 6
POAT 146.90286 -41.8291 1 2003 7 2032 12
POL 145.80104 -37.62636 3 1990 8 1996 4
PSA00 119.8458 -21.5725 3 2011 1 2599 12
PTA 146.455572 -37.857253 3 1978 2 1996 5
PTJY 125.0539 -15.9601 2 1997 8 1997 12
PYV 143.2842 -38.365 3 1970 1 1972 0
Expand All @@ -426,6 +432,7 @@ RIV 151.1583 -33.83 1 1909 01 2031 01
RK1 150.4938 -23.3886 3 2001 05 2031 01
RK2 150.5248 -23.3825 3 2001 12 2031 01
RKG 117.0104 -34.5698 1 1983 8 2025 12
RKGY 116.9773 -34.6094 1 1999 9 2025 12
RMMY 151.79032 -32.9274 3 1989 12 1990 1
RMQ 148.755 -26.489 1 1984 08 2031 01
RNDA 149.0817 -35.2583 3 1998 7 2029 12
Expand Down Expand Up @@ -597,6 +604,7 @@ WRA 134.3409 -19.9443 1 1968 00 2031 01
WRB 134.3478 -19.9611 1 1968 00 2031 01
WRC 152.6631 -27.1874 1 1984 07 1998 09
WRG 136.7634 -31.1046 1 1981 10 1997 5
WRKA 128.2961 -25.0375 1 2009 4 2599 12
WRNM 150.95159 -34.1414 2 1992 5 2030 12
WRP 152.289 -27.2762 1 1998 09 2031 01
WSA 136.805984 -31.145037 1 1973 4 1981 10
Expand All @@ -614,4 +622,4 @@ WYAL 117.561 -31.236 2 1988 1 1988 3
YER 150.23205 -34.14247 2 1992 6 2025 12
YNG 148.3963 -34.298 1 1999 1 2025 12
YOU 148.381668 -34.278336 1 1971 0 1998 10
YSY 146.3564 -38.3977 3 1985 10 1986 4
YSY 146.3564 -38.3977 3 1985 10 1986 4
Binary file modified info/NSHA18_description_of_files_and_metadata.XLS
Binary file not shown.
126 changes: 54 additions & 72 deletions postprocessing/maps/csv2geoTIFF.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ def gen_color_file(input_file):
maxlon = -180
minlon = 180

'''
# THIS IS HOW TO RUN ME IN IPYTHON
run csv2geoTIFF.py ../../source_models/complete_model/final/results_maps_SA10/hazard_curve-mean-SA(1.0)_1.csv
'''
##############################################################################
# parse hazard grid
##############################################################################
Expand Down Expand Up @@ -116,6 +121,7 @@ def gen_color_file(input_file):
if tmpdict['lat'] < minlat:
minlat = tmpdict['lat']

print 'BBOX', '/'.join((str(minlon), str(maxlon), str(minlat), str(maxlat)))
##############################################################################
# make mesh
##############################################################################
Expand Down Expand Up @@ -194,80 +200,56 @@ def gen_color_file(input_file):
dst_ds.GetRasterBand(1).WriteArray(grid_z.T)
dst_ds = None # to close file

# testing
#src_ds = gdal.Open(path.join('geotiff', '_'.join(('nsha18',period, p50+'.tiff'))))

##############################################################################
# make gdal cpt file and recolour
##############################################################################

# set bounds for colours
if p50 == '0.1' or p50 == '0.0952':
if period == 'PGA' or period == 'SA005' or period == 'SA01' or period == 'SA02' \
or period == 'SA03' or period == 'SA05':
bounds = array([0, 0.005, 0.01, 0.015, 0.02, 0.03, 0.04, 0.05, 0.06, 0.08, 0.12, 0.16, 0.24])
elif period == 'SA07' or period == 'SA10':
bounds = array([0, 0.002, 0.004, 0.007, 0.01, 0.015, 0.02, 0.025, 0.03, 0.04, 0.05, 0.06, 0.08])
# testing
#src_ds = gdal.Open(path.join('geotiff', '_'.join(('nsha18',period, p50+'.tiff'))))

##############################################################################
# make gdal cpt file and recolour
##############################################################################

# set bounds for colours
if p50 == '0.1' or p50 == '0.0952':
if period == 'PGA' or period == 'SA005' or period == 'SA01' or period == 'SA02' \
or period == 'SA03' or period == 'SA05':
bounds = array([0, 0.005, 0.01, 0.015, 0.02, 0.03, 0.04, 0.05, 0.06, 0.08, 0.12, 0.16, 0.24])
elif period == 'SA07' or period == 'SA10':
bounds = array([0, 0.002, 0.004, 0.007, 0.01, 0.015, 0.02, 0.025, 0.03, 0.04, 0.05, 0.06, 0.08])
else:
bounds = array([0, 0.001, 0.002, 0.004, 0.007, 0.01, 0.015, 0.02, 0.025, 0.03, 0.035, 0.045, 0.06])
else:
bounds = array([0, 0.001, 0.002, 0.004, 0.007, 0.01, 0.015, 0.02, 0.025, 0.03, 0.035, 0.045, 0.06])
else:
if period == 'PGA' or period == 'SA005' or period == 'SA01' or period == 'SA02' \
or period == 'SA03' or period == 'SA05':
bounds = array([0, 0.02, 0.04, 0.06, 0.08, 0.10, 0.12, 0.16, 0.20, 0.3, 0.5, 0.7, 1.0])
elif period == 'SA07':
bounds = array([0, 0.01, 0.015, 0.02, 0.03, 0.04, 0.05, 0.06, 0.08, 0.12, 0.16, 0.24, 0.36])
elif period == 'SA15' or period == 'SA10':
bounds = array([0, 0.01, 0.015, 0.02, 0.025, 0.03, 0.04, 0.05, 0.06, 0.08, 0.12, 0.16, 0.2, 0.3])
if period == 'PGA' or period == 'SA005' or period == 'SA01' or period == 'SA02' \
or period == 'SA03' or period == 'SA05':
bounds = array([0, 0.02, 0.04, 0.06, 0.08, 0.10, 0.12, 0.16, 0.20, 0.3, 0.5, 0.7, 1.0])
elif period == 'SA07':
bounds = array([0, 0.01, 0.015, 0.02, 0.03, 0.04, 0.05, 0.06, 0.08, 0.12, 0.16, 0.24, 0.36])
elif period == 'SA15' or period == 'SA10':
bounds = array([0, 0.01, 0.015, 0.02, 0.025, 0.03, 0.04, 0.05, 0.06, 0.08, 0.12, 0.16, 0.2, 0.3])
else:
bounds = array([0, 0.001, 0.002, 0.003, 0.004, 0.005, 0.007, 0.015, 0.03, 0.04, 0.05, 0.06, 0.1, 0.16])
ncolours = 13

if getcwd().startswith('/nas'):
cptfile = '/nas/active/ops/community_safety/ehp/georisk_earthquake/modelling/sandpits/tallen/NSHA2018/postprocessing/maps/cw1-013_mod.cpt'
else:
bounds = array([0, 0.001, 0.002, 0.003, 0.004, 0.005, 0.007, 0.015, 0.03, 0.04, 0.05, 0.06, 0.1, 0.16])
ncolours = 13

if getcwd().startswith('/nas'):
cptfile = '/nas/active/ops/community_safety/ehp/georisk_earthquake/modelling/sandpits/tallen/NSHA2018/postprocessing/maps/cw1-013_mod.cpt'
else:
cptfile = '/Users/tallen/Documents/Geoscience_Australia/NSHA2018/postprocessing/maps/cw1-013_mod.cpt'
cmap, zvals = cpt2colormap(cptfile, ncolours, rev=True)
rgbTable = cmap2rgb(cmap, ncolours)[0] * 255

# make gdal cpt file
cpttxt = ''
for bound, rgb in zip(bounds, rgbTable):
cpttxt += '\t'.join((str(bound), str(rgb[0]), str(rgb[1]), str(rgb[2]))) + '\n'
cptfile = '/Users/tallen/Documents/Geoscience_Australia/NSHA2018/postprocessing/maps/cw1-013_mod.cpt'
cmap, zvals = cpt2colormap(cptfile, ncolours, rev=True)
rgbTable = cmap2rgb(cmap, ncolours)[0] * 255

# make gdal cpt file
cpttxt = ''
for bound, rgb in zip(bounds, rgbTable):
cpttxt += '\t'.join((str(bound), str(rgb[0]), str(rgb[1]), str(rgb[2]))) + '\n'

f = open('gdal_cpt.dat', 'wb')
f.write(cpttxt)
f.close()

f = open('gdal_cpt.dat', 'wb')
f.write(cpttxt)
f.close()

# recolour geoTiff
intiff = path.join('geotiff', '_'.join(('nsha18',period, p50+'.tiff')))
outtiff = intiff[0:-4]+'_colour.tiff'

gdaldem_cmd = ' '.join(('gdaldem color-relief', intiff, 'gdal_cpt.dat', outtiff))
#gdaldem color-relief jotunheimen.tif color_relief.txt jotunheimen_colour_relief.tif
system(gdaldem_cmd)


'''
format of relief file from: http://blog.mastermaps.com/2012/06/creating-color-relief-and-slope-shading.html
0 110 220 110
900 240 250 160
1300 230 220 170
1900 220 220 220
2500 250 250 250
# recolour geoTiff
intiff = path.join('geotiff', '_'.join(('nsha18',period, p50+'.tiff')))
outtiff = intiff[0:-4]+'_colour.tiff'

gdaldem_cmd = ' '.join(('gdaldem color-relief', intiff, 'gdal_cpt.dat', outtiff))
#gdaldem color-relief jotunheimen.tif color_relief.txt jotunheimen_colour_relief.tif
system(gdaldem_cmd)

gdaldem color-relief jotunheimen.tif color_relief.txt jotunheimen_colour_relief.tif
'''
'''
band = src_ds.GetRasterBand(1)
ct = band.GetRasterColorTable()
f = open("rgb_color.txt", 'w+')
for i in range(ct.GetCount()):
sEntry = ct.GetColorEntry(i)
f.write( " %3d: %d,%d,%d\n" % ( \
i, \
sEntry[0],\
sEntry[1],\
sEntry[2]))
'''

Binary file modified source_models/zones/2018_mw/DIMAUS/DIMAUS_NSHA18_MFD.MERGE.pdf
Binary file not shown.
10 changes: 0 additions & 10 deletions source_models/zones/2018_mw/DIMAUS/mfd/ADB/ADB_failed.dat

This file was deleted.

13 changes: 0 additions & 13 deletions source_models/zones/2018_mw/DIMAUS/mfd/ADB/ADB_passed.dat

This file was deleted.

22 changes: 0 additions & 22 deletions source_models/zones/2018_mw/DIMAUS/mfd/ADB/ADB_rates.csv

This file was deleted.

Empty file modified source_models/zones/2018_mw/DIMAUS/mfd/ADEF/ADEF_failed.dat
100755 → 100644
Empty file.
Empty file modified source_models/zones/2018_mw/DIMAUS/mfd/ADEF/ADEF_passed.dat
100755 → 100644
Empty file.
94 changes: 47 additions & 47 deletions source_models/zones/2018_mw/DIMAUS/mfd/ADEF/ADEF_rates.csv
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
MAG,N_OBS,N_CUM,BIN_RTE,CUM_RTE,MFD_FIT
2.95,4,26,7.7614e-02,5.0161e-01,5.0161e-01
3.05,12,22,2.3284e-01,4.2399e-01,3.7681e-01
3.15,0,10,0.0000e+00,1.9115e-01,2.8306e-01
3.25,2,10,3.8807e-02,1.9115e-01,2.1264e-01
3.35,1,8,1.9404e-02,1.5234e-01,1.5974e-01
3.45,0,7,0.0000e+00,1.3294e-01,1.1999e-01
3.55,1,7,1.9404e-02,1.3294e-01,9.0140e-02
3.65,3,6,5.8211e-02,1.1354e-01,6.7714e-02
3.75,1,3,1.9404e-02,5.5326e-02,5.0867e-02
3.85,0,2,0.0000e+00,3.5922e-02,3.8211e-02
3.95,1,2,1.9404e-02,3.5922e-02,2.8704e-02
4.05,1,1,1.6519e-02,1.6519e-02,2.1563e-02
4.15,0,0,0.0000e+00,0.0000e+00,1.6198e-02
4.25,0,0,0.0000e+00,0.0000e+00,1.2167e-02
4.35,0,0,0.0000e+00,0.0000e+00,9.1400e-03
4.45,0,0,0.0000e+00,0.0000e+00,6.8657e-03
4.55,0,0,0.0000e+00,0.0000e+00,5.1572e-03
4.65,0,0,0.0000e+00,0.0000e+00,3.8738e-03
4.75,0,0,0.0000e+00,0.0000e+00,2.9097e-03
4.85,0,0,0.0000e+00,0.0000e+00,2.1855e-03
4.95,0,0,0.0000e+00,0.0000e+00,1.6414e-03
5.05,0,0,0.0000e+00,0.0000e+00,1.2327e-03
5.15,0,0,0.0000e+00,0.0000e+00,9.2573e-04
5.25,0,0,0.0000e+00,0.0000e+00,6.9509e-04
5.35,0,0,0.0000e+00,0.0000e+00,5.2184e-04
5.45,0,0,0.0000e+00,0.0000e+00,3.9169e-04
5.55,0,0,0.0000e+00,0.0000e+00,2.9392e-04
5.65,0,0,0.0000e+00,0.0000e+00,2.2047e-04
5.75,0,0,0.0000e+00,0.0000e+00,1.6530e-04
5.85,0,0,0.0000e+00,0.0000e+00,1.2386e-04
5.95,0,0,0.0000e+00,0.0000e+00,9.2721e-05
6.05,0,0,0.0000e+00,0.0000e+00,6.9333e-05
6.15,0,0,0.0000e+00,0.0000e+00,5.1763e-05
6.25,0,0,0.0000e+00,0.0000e+00,3.8565e-05
6.35,0,0,0.0000e+00,0.0000e+00,2.8650e-05
6.45,0,0,0.0000e+00,0.0000e+00,2.1202e-05
6.55,0,0,0.0000e+00,0.0000e+00,1.5607e-05
6.65,0,0,0.0000e+00,0.0000e+00,1.1404e-05
6.75,0,0,0.0000e+00,0.0000e+00,8.2464e-06
6.85,0,0,0.0000e+00,0.0000e+00,5.8746e-06
6.95,0,0,0.0000e+00,0.0000e+00,4.0928e-06
7.05,0,0,0.0000e+00,0.0000e+00,2.7544e-06
7.15,0,0,0.0000e+00,0.0000e+00,1.7489e-06
7.25,0,0,0.0000e+00,0.0000e+00,9.9362e-07
7.35,0,0,0.0000e+00,0.0000e+00,4.2623e-07
7.45,0,0,0.0000e+00,0.0000e+00,-3.1434e-21
MAG,N_OBS,N_CUM,BIN_RTE,CUM_RTE,MFD_FIT,MFD_FIT_AREA_NORM
2.95,4,26,7.7614e-02,5.0161e-01,5.0161e-01,6.9749e-02
3.05,12,22,2.3284e-01,4.2399e-01,3.7681e-01,5.2396e-02
3.15,0,10,0.0000e+00,1.9115e-01,2.8306e-01,3.9360e-02
3.25,2,10,3.8807e-02,1.9115e-01,2.1264e-01,2.9568e-02
3.35,1,8,1.9404e-02,1.5234e-01,1.5974e-01,2.2211e-02
3.45,0,7,0.0000e+00,1.3294e-01,1.1999e-01,1.6685e-02
3.55,1,7,1.9404e-02,1.3294e-01,9.0140e-02,1.2534e-02
3.65,3,6,5.8211e-02,1.1354e-01,6.7714e-02,9.4157e-03
3.75,1,3,1.9404e-02,5.5326e-02,5.0867e-02,7.0731e-03
3.85,0,2,0.0000e+00,3.5922e-02,3.8211e-02,5.3133e-03
3.95,1,2,1.9404e-02,3.5922e-02,2.8704e-02,3.9914e-03
4.05,1,1,1.6519e-02,1.6519e-02,2.1563e-02,2.9983e-03
4.15,0,0,0.0000e+00,0.0000e+00,1.6198e-02,2.2523e-03
4.25,0,0,0.0000e+00,0.0000e+00,1.2167e-02,1.6919e-03
4.35,0,0,0.0000e+00,0.0000e+00,9.1400e-03,1.2709e-03
4.45,0,0,0.0000e+00,0.0000e+00,6.8657e-03,9.5468e-04
4.55,0,0,0.0000e+00,0.0000e+00,5.1572e-03,7.1712e-04
4.65,0,0,0.0000e+00,0.0000e+00,3.8738e-03,5.3866e-04
4.75,0,0,0.0000e+00,0.0000e+00,2.9097e-03,4.0460e-04
4.85,0,0,0.0000e+00,0.0000e+00,2.1855e-03,3.0390e-04
4.95,0,0,0.0000e+00,0.0000e+00,1.6414e-03,2.2824e-04
5.05,0,0,0.0000e+00,0.0000e+00,1.2327e-03,1.7141e-04
5.15,0,0,0.0000e+00,0.0000e+00,9.2573e-04,1.2872e-04
5.25,0,0,0.0000e+00,0.0000e+00,6.9509e-04,9.6653e-05
5.35,0,0,0.0000e+00,0.0000e+00,5.2184e-04,7.2562e-05
5.45,0,0,0.0000e+00,0.0000e+00,3.9169e-04,5.4465e-05
5.55,0,0,0.0000e+00,0.0000e+00,2.9392e-04,4.0870e-05
5.65,0,0,0.0000e+00,0.0000e+00,2.2047e-04,3.0657e-05
5.75,0,0,0.0000e+00,0.0000e+00,1.6530e-04,2.2985e-05
5.85,0,0,0.0000e+00,0.0000e+00,1.2386e-04,1.7222e-05
5.95,0,0,0.0000e+00,0.0000e+00,9.2721e-05,1.2893e-05
6.05,0,0,0.0000e+00,0.0000e+00,6.9333e-05,9.6408e-06
6.15,0,0,0.0000e+00,0.0000e+00,5.1763e-05,7.1977e-06
6.25,0,0,0.0000e+00,0.0000e+00,3.8565e-05,5.3625e-06
6.35,0,0,0.0000e+00,0.0000e+00,2.8650e-05,3.9838e-06
6.45,0,0,0.0000e+00,0.0000e+00,2.1202e-05,2.9481e-06
6.55,0,0,0.0000e+00,0.0000e+00,1.5607e-05,2.1701e-06
6.65,0,0,0.0000e+00,0.0000e+00,1.1404e-05,1.5857e-06
6.75,0,0,0.0000e+00,0.0000e+00,8.2464e-06,1.1467e-06
6.85,0,0,0.0000e+00,0.0000e+00,5.8746e-06,8.1687e-07
6.95,0,0,0.0000e+00,0.0000e+00,4.0928e-06,5.6911e-07
7.05,0,0,0.0000e+00,0.0000e+00,2.7544e-06,3.8300e-07
7.15,0,0,0.0000e+00,0.0000e+00,1.7489e-06,2.4319e-07
7.25,0,0,0.0000e+00,0.0000e+00,9.9362e-07,1.3816e-07
7.35,0,0,0.0000e+00,0.0000e+00,4.2623e-07,5.9268e-08
7.45,0,0,0.0000e+00,0.0000e+00,-3.1434e-21,-4.3709e-22
Empty file modified source_models/zones/2018_mw/DIMAUS/mfd/ALBF/ALBF_failed.dat
100755 → 100644
Empty file.
Empty file modified source_models/zones/2018_mw/DIMAUS/mfd/ALBF/ALBF_passed.dat
100755 → 100644
Empty file.
Loading

0 comments on commit 2ce15e9

Please sign in to comment.