diff --git a/outputs_2017088_Survey2.py b/outputs_2017088_Survey2.py index 8131f84..a389466 100644 --- a/outputs_2017088_Survey2.py +++ b/outputs_2017088_Survey2.py @@ -26,94 +26,6 @@ from cycler import cycler from survey_tools import call_lastools, extract_pts, update_survey_output -def plot_profiles(profile_info, profile, output_loc, LL_limit): - #plot the profile. expects output from CC_split_profile - - YminorLocator=MultipleLocator(0.5) - XminorLocator=MultipleLocator(5) - - - fig,ax=plt.subplots(figsize=(8, 3)) - - num_plots=len(profile_info.keys())-1 - colormap = plt.cm.jet - ax.set_prop_cycle(cycler('color', [colormap(i) for i in np.linspace(0, 0.9, num_plots)])) - - max_y=0 - for date in profile_info.keys(): - if date!='info': - - plt.plot(profile_info[date]['Chainage'], profile_info[date]['Elevation'], label=date) - try: - if max([i for i in profile_info[date]['Elevation'] if pd.isnull(i)==False])>max_y: - max_y=max([i for i in profile_info[date]['Elevation'] if pd.isnull(i)==False]) - except: - print("empty elevation section for %s" % date) - - - plt.plot([LL_limit,LL_limit], [-1,max_y], 'r--', alpha=0.5, label="Landward Limit") - - - plt.xlabel('Chainage (m)',weight='bold') - plt.ylabel('Elevation (m AHD)',weight='bold') - plt.legend(loc='upper right', bbox_to_anchor=(1.3,1)) - plt.title(profile) - plt.rcParams['font.size']=8 - - ax.set_ylim([-1,math.ceil(max_y)]) - - ax.xaxis.set_minor_locator(XminorLocator) - ax.yaxis.set_minor_locator(YminorLocator) - ax.xaxis.grid(True, which='minor', color='k', linestyle='-', alpha=0.3) - ax.yaxis.grid(True,which='minor',color='k', linestyle='-', alpha=0.3) - - plt.grid(which='major', color='k', linestyle='-') - today=datetime.datetime.now().date().strftime('%Y%m%d') - plt.savefig(os.path.join(output_loc, '%s_%s.png' % (today, profile)),bbox_inches='tight',dpi=900) - plt.clf() - - return None - - -def CC_split_profile(file2read): - # this reads the profile files and splits it into dates - - file_master=pd.read_csv(file2read) - - beach_original=file_master['Beach'].tolist() - profile_original=file_master['Profile'].tolist() - date_original=file_master['Date'].tolist() - chainage_original=file_master['Chainage'].tolist() - elevation_original=file_master['Elevation'].tolist() - easting_original=file_master['Easting'].tolist() - northing_original=file_master['Northing'].tolist() - - data={} - i=0 - - #add info on the beach and profile number - data['info']={'Profile':profile_original[0], 'Beach':beach_original[0]} - date_now=date_original[0] - - while i