Fix to work with survey 3

etta-drone
Dan Howe 5 years ago
parent 3c179852d7
commit aafdcab589

@ -53,7 +53,9 @@ def parse_yaml(yaml_name):
def process(yaml_name):
params = parse_yaml(yaml_name)
beach = params['BEACH']
base_name = os.path.splitext(os.path.basename(params['INPUT LAS']))[0]
#base_name = os.path.splitext(os.path.basename(params['INPUT LAS']))[0]
base_name='%s_%s' % (beach.lower().replace(" ","_"), params['SURVEY DATE'])
# Make all input and output paths absolute
mxd_name = os.path.abspath(params['MAP DOCUMENT'])

@ -351,8 +351,9 @@ def polygon_wave_runup(xyz_1m, direction, shp_name, set_check_value, distance_ch
#print('making the crop polygon')
# Simplify polygon to remove invalid geometry
geom = Polygon(for_shape).simplify(10)
#geom = Polygon(for_shape).simplify(10)
geom = Polygon(for_shape)
# Export polygon as shapefile
df = gpd.GeoDataFrame(geometry=[geom])
df.crs = {'init': 'epsg:283{}'.format(zone), 'no_defs': True}
@ -383,9 +384,12 @@ def process(yaml_file):
las_dir = params['LAS CLASSIFIED FOLDER']
shp_dir = params['SHP SWASH FOLDER']
tmp_dir = params['TMP FOLDER']
survey_date=params['SURVEY DATE']
beach=params['BEACH']
# Get base name of input las
las_basename = os.path.splitext(os.path.basename(input_las))[0]
#las_basename = os.path.splitext(os.path.basename(input_las))[0]
las_basename='%s_%s' % (beach.lower().replace(" ","_"), survey_date)
# # Crop to beach boundary
print('Clipping...')

@ -81,7 +81,7 @@ def plot_profiles(profile_name, csv_output_dir, graph_loc, ch_limits, delta_vol,
ch_min = ch_limits.loc[profile_name, 'Landward Limit']
# Set figure dimensions based on beach size
vertical_exag = 8
vertical_exag = 5
m_per_inch = 8
try:
fig_h = profiles.dropna().values.max() / m_per_inch * vertical_exag
@ -96,6 +96,7 @@ def plot_profiles(profile_name, csv_output_dir, graph_loc, ch_limits, delta_vol,
else:
fig, ax = plt.subplots(figsize=(10, 5))
for col in profiles.columns:
profile = profiles.loc[:, col]
date_str = col.split('_')[-1]
@ -110,6 +111,11 @@ def plot_profiles(profile_name, csv_output_dir, graph_loc, ch_limits, delta_vol,
ax.set_xlabel('Chainage (m)', labelpad=10)
ax.set_ylabel('Elevation (m AHD)', labelpad=10)
Ylim=ax.get_ylim()[1]
if Ylim<10:
ax.set_ylim([ax.get_ylim()[0], 10])
# Show most recent volume change
if delta_vol is not None:
ax.annotate('Most recent\nvolume change:\n{:+0.1f} m$^3$/m'.format(delta_vol),
@ -215,7 +221,9 @@ def process(yaml_file):
tmp_dir = params['TMP FOLDER']
# Get base name of input las
las_basename = os.path.splitext(os.path.basename(original_las))[0]
#las_basename = os.path.splitext(os.path.basename(original_las))[0]
las_basename='%s_%s' % (beach.lower().replace(" ","_"), survey_date)
# Get name of input point cloud
input_las = os.path.join(classified_las_dir, las_basename + '.las')
@ -249,6 +257,11 @@ def process(yaml_file):
tif_name = os.path.join(output_tif_dir, las_basename + '.tif')
call_lastools('las2dem', input=las_data, output=tif_name,
args=['-step', 1, '-keep_class', 2], verbose=False)
# IF THIS STEP ISN'T WORKING:
# might mean there are no data lines
# trying running with args=['-step', 1, '-keep_class', 2, '-rescale', 0.001,0.001,0.001]
#call_lastools('las2dem', input=las_data, output=tif_name,
# args=['-step', 1, '-keep_class', 2, '-rescale', 0.001,0.001,0.001], verbose=False)
# Extract elevations along profiles from triangulated surface
print('Extracting profile elevations...')

Binary file not shown.

@ -53,7 +53,8 @@ def parse_yaml(yaml_name):
def process(yaml_name):
params = parse_yaml(yaml_name)
beach = params['BEACH']
base_name = os.path.splitext(os.path.basename(params['INPUT LAS']))[0]
#base_name = os.path.splitext(os.path.basename(params['INPUT LAS']))[0]
base_name='%s_%s' % (beach.lower().replace(" ","_"), params['SURVEY DATE'])
# Make all input and output paths absolute
mxd_name = os.path.abspath(params['MAP DOCUMENT'])

Loading…
Cancel
Save