Open dbuscombe-usgs opened 5 months ago
Hi @dbuscombe-usgs Sorry for the late response this got lost in my notifications. I've implemented most of the changes in https://github.com/Doodleverse/CoastSeg/issues/224 which means coastseg generates 5 files now:
transect_time_series.csv
transect_time_series_merged.csv
transect_time_series_tidally_corrected.csv
transect_time_series_tidally_corrected_matrix.csv
predicted_tides.csv
Currently the transect_time_series_tidally_corrected_matrix.csv
drops any dates where none of the shoreline points on that date intersected any of the transects, is that okay or should they be rows with only NaNs like in transect_time_series.csv
?
Do you want CoastSeg to generate 2 extra files being the ones below? I'm not sure if these are necessary since it seems like they can easily be generated by script in SDS_tools, but if you think that end users will find them helpful, then I'm happy to add them.
df_x_by_time_and_transect = cs.pivot(index='dates',columns='transect_id', values='x')
df_y_by_time_and_transect = cs.pivot(index='dates',columns='transect_id', values='y')
I tagged you in a question on https://github.com/Doodleverse/CoastSeg/issues/224 I'm sure it got lost in your notifications too.
@2320sharon this is a description of the workflow I have developed and intend to build here in SDStools, fyi
Currently the Coastseg workflow results in a merged tidally corrected shoreline timeseries file, which I believe most end-users will view as 'the result', transect_time_series_tidally_corrected.csv. Then, as discussed here, we want the option of reordering the data so it is time (rows) x transect (cols), with missing values as NaN. I believe Coastseg should do that, but I also think we should do it for all numeric variables, i.e., tide, x, and y. So, if
cs
is your dataframeSimple! this is what those matrices look like for my Elwha site
(I'm not sure why my transect numbers are non-ordinal w.r.t x and y...)
Ok, and I propose Coastseg stop there, and this toolbox (SDStools) takes over the reins for basic analyses and plotting, etc.
The first thing I propose here is a new way to interpolate and filter the data
Parameters to test when calibrating the denoising algorithm
parameter_ranges = {'sigma': np.arange(0.02, 0.2, 0.02), 'wavelet': ['db1', 'db2'], 'convert2ycbcr': [False, False]}
Denoised image using default parameters of
denoise_wavelet
default_output = denoise_wavelet(cs_matrix_inpaint, rescale_sigma=True)
Calibrate denoiser
calibrated_denoiser = calibrate_denoiser(cs_matrix_inpaint, _denoise_wavelet, denoise_parameters=parameter_ranges)
Denoised image using calibrated denoiser
cs_inpaint_denoised = calibrated_denoiser(cs_matrix_inpaint)
N = 10 shore_change = (cs_inpaint_denoised - cs_inpaint_denoised[:N,:].mean(axis=0)).T
plt.plot(df_distances_by_time_and_transect.index, shore_change.mean(axis=0), 'k') plt.ylabel('Mean shoreline displacement (m)') plt.show()
plt.plot(np.arange(30,100), shore_change.mean(axis=1), 'k') plt.ylabel('Mean shoreline displacement (m)') plt.show()