|
|
@ -160,17 +160,17 @@ def calculate_volumes(profile_name, survey_date, csv_output_dir, ch_limits, volu
|
|
|
|
# Create new dataframe if csv does not exist
|
|
|
|
# Create new dataframe if csv does not exist
|
|
|
|
volumes = pd.DataFrame()
|
|
|
|
volumes = pd.DataFrame()
|
|
|
|
|
|
|
|
|
|
|
|
for current_date in profiles.columns:
|
|
|
|
# Get Nielsen erosion volumes for current survey date
|
|
|
|
# Get Nielsen erosion volumes
|
|
|
|
current_survey = 'Elevation_' + survey_date
|
|
|
|
chainage = profiles.loc[:, current_date].dropna().index
|
|
|
|
chainage = profiles.loc[:, current_survey].dropna().index
|
|
|
|
elevation = profiles.loc[:, current_date].dropna().values
|
|
|
|
elevation = profiles.loc[:, current_survey].dropna().values
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
volume = nielsen_volumes.volume_available(chainage, elevation, ch_min)
|
|
|
|
volume = nielsen_volumes.volume_available(chainage, elevation, ch_min)
|
|
|
|
except ValueError:
|
|
|
|
except ValueError:
|
|
|
|
volume = np.nan
|
|
|
|
volume = np.nan
|
|
|
|
|
|
|
|
|
|
|
|
# Update spreadsheet
|
|
|
|
# Update spreadsheet
|
|
|
|
volumes.loc[profile_name, 'Volume_' + survey_date] = volume
|
|
|
|
volumes.loc[profile_name, 'Volume_' + survey_date] = volume
|
|
|
|
|
|
|
|
|
|
|
|
# Save updated volumes spreadsheet
|
|
|
|
# Save updated volumes spreadsheet
|
|
|
|
volumes = volumes[volumes.columns.sort_values()]
|
|
|
|
volumes = volumes[volumes.columns.sort_values()]
|
|
|
|