Fix date stamps on profile figures

etta-drone
Dan Howe 6 years ago
parent 74c9351fe7
commit c5c63bc579

@ -35,7 +35,7 @@ def remove_temp_files(directory):
return None return None
def plot_profiles(profile_name, survey_date, csv_output_dir, graph_loc, ch_limits): def plot_profiles(profile_name, csv_output_dir, graph_loc, ch_limits):
csv_name = profile_name + '.csv' csv_name = profile_name + '.csv'
profiles = pd.read_csv(os.path.join(csv_output_dir, csv_name)) profiles = pd.read_csv(os.path.join(csv_output_dir, csv_name))
@ -48,7 +48,7 @@ def plot_profiles(profile_name, survey_date, csv_output_dir, graph_loc, ch_limit
ax = plt.axes() ax = plt.axes()
for col in profiles.columns: for col in profiles.columns:
profile = profiles.loc[ch_min:, col] profile = profiles.loc[ch_min:, col]
date_str = str(survey_date) date_str = col.split('_')[-1]
date = '{}-{}-{}'.format(date_str[:4], date_str[4:6], date_str[6:]) date = '{}-{}-{}'.format(date_str[:4], date_str[4:6], date_str[6:])
ax.plot(profile.index, profile, label=date) ax.plot(profile.index, profile, label=date)
@ -191,7 +191,7 @@ def main():
print('Updating figures...') print('Updating figures...')
profile_names = df['Profile'].unique() profile_names = df['Profile'].unique()
for profile_name in profile_names: for profile_name in profile_names:
plot_profiles(profile_name, survey_date, csv_output_dir, graph_loc, ch_limits) plot_profiles(profile_name, csv_output_dir, graph_loc, ch_limits)
calculate_volumes(profile_name, survey_date, csv_output_dir, ch_limits, volume_output_dir) calculate_volumes(profile_name, survey_date, csv_output_dir, ch_limits, volume_output_dir)
# Remove temprary files # Remove temprary files

Loading…
Cancel
Save