Coastal-Imaging-Research-Network / cBathy-Toolbox

Routines needed to run cBathy + demos
https://github.com/Coastal-Imaging-Research-Network/cBathy-toolbox/wiki/cBathy-User-Manual
GNU General Public License v3.0
25 stars 23 forks source link

changes to 2.0 for CIRN week 2023 #70

Closed eswanson-usgs closed 1 year ago

eswanson-usgs commented 1 year ago

Updates to cBathy version 2.0 to make fixes for CIRN week 2023. Rob's changed are outlined below (copied and pasted): The update routines below include some that are just code improvements and some that are just additions needed for the CIRN workshop. Both are quickly described below. An asterisk indicates that the change is simply for the workshop, although these can be used later by anyone trying to learn cBathy.

The changes to KalmanFilterBathy, prepBathyInput, plotStacksAndPhaseMaps and showcBathyTimeSeriesMovie are all cBathy functions rather than simply demos. So I want to make sure they are checked. My matlab coding is getting a bit more accident prone these days.

I now longer use cBathyDemoWithPlots, or democBathyVersion2p0. They could be obsoleted from my point of view.

There are a few files like epoch2Matlab (maybe parseFilename) that may get used and are not in the cBathy stand-alone library because they aren’t cBathy specific. How are we handling these? Can we check for other missing dependencies?

    • cBathyDemo2023.m – This is the m-file that everyone will run (in a line by line cut and paste mode) during the cBathy session.
  1. cBathyUserManualVersion2p0.docx. This should be placed in the manual folder (why is there no manual already here??). That folder currently has only a few jpegs in it. I have a vague memory that this was needed to create the current online version of the manual, but that may no longer be relevant. Ideally those jpgs should be removed and the user manual and perhaps journal papers should be put here.

    • DemoData. I have added a) a snapshot for the Nov 16, 2015 example, and b) a snapshot and mBW cBathy data file for a second example data run of Nov 18, 2015. Both are used in cBathyDemo2023.
    • DemoKalmanFiltering.m - A simple demo of Kalman filtering from the past. This demo uses previously processed files in folder 102210cBathys and writes output into a file it will create called 102210cBathysSmoothed (assuming you have write permission).
    • findTideForCIRNDemo2023.m - this is a fake routine that returns tides for only the two epoch times in cBathyDemo2023. It is part of the demo showing the impact of having the right tide. It has no other value.
  2. HolmanBergsma2021Version2p0Paper.pdf. 2021 paper should likely go in the manual folder?

  3. HolmanEtAlcBathyVersion1p0Paper.pdf. 2013 paper should also go in manual folder?

  4. KalmanFilterBathy.m – lines (now) 26 previously used parseFilename to find stationStr. Now simply extracts station string from the params file which was already passed in newBathy. This avoids an unnecessary CIL call. Lines 13-18 – This is new and allows for the first step in a Kalman chain, where would be combining two cBathys, neither of which has any runningAverage information. It simply uses the fCombined result as seed values for Kalman filtering.

  5. plotStacksAndPhaseMaps.m – lines 26 to 34. For some reason datetick was introducing oddness. Decided instead to plot time simply as tm-tm(1) and thereby avoid the need for datetick. This was done for subplots 223 and 224.

  6. prepBathyInput.m – tidies up bathy structure, putting timex, bright and dark at the end of the bathy structure. Added K and prior to init fields at end of runningAverage region.

  7. showcBathyTimeSeriesMovie.m – In the past we had this version that loads the needed data from a CIL stack file and a NotCIL version that does not. I simplified this by simply including xyx, t, data as input arguments so there is no need for interpreting stack structures. NOTE – this is a change of input arguments which may fail if you use the old argument list. The NotCIL version should be made obsolete.

  8. Contents.m – updated to a more useful current version. There is much still to be done here. For example, things like analyzeSingleBathyRun has various versions with varying assumptions about the form of input stacks. We should simplify.

    • 102210cBathys – Somehow the github version already has Kalman results filled in, presumably by someone who ran the code and saved locally. I emptied the runningAverage fields so the demo will work reasonably.
eswanson-usgs commented 1 year ago

Additionally, I have some small changes and have some small comments about running the demo:

RobHolman commented 1 year ago

Thanks for running this. Glad it mostly works.

Additionally, I have some small changes and have some small comments about running the demo:

• In the debug section of cBathyDemo2023.m I changed, "argus02a" to "argus02b" because "argus02a.m" parameters file did not exist. Was I correct in changing "a" to "b"?

Good catch.

• In cBathyDemo2023.m changed pb = load([cBathyToolboxPath.path,'.\102210cBathysSmoothed\1287759600.Fri.Oct.22_15_00_00.GMT.2010.argus02a.cx.cBathy.mat']) to pb = load('.\102210cBathysSmoothed\1287759600.Fri.Oct.22_15_00_00.GMT.2010.argus02a.cx.cBathy.mat') because it was throwing errors. After adding my local cBathy directory to my Matlab path the revised function call worked

OK. I’m lost. I don’t have this line in my code. Where are you?

• At a couple points I had to comment out the rest of the demo script in order run specific sections such as the debug section or the Kalman filter section

Yes, I want to run this in a cut and paste mode.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

eswanson-usgs commented 1 year ago

• In cBathyDemo2023.m changed pb = load([cBathyToolboxPath.path,'.\102210cBathysSmoothed\1287759600.Fri.Oct.22_15_00_00.GMT.2010.argus02a.cx.cBathy.mat']) to pb = load('.\102210cBathysSmoothed\1287759600.Fri.Oct.22_15_00_00.GMT.2010.argus02a.cx.cBathy.mat') because it was throwing errors. After adding my local cBathy directory to my Matlab path the revised function call worked OK. I’m lost. I don’t have this line in my code. Where are you?

This is at line 141 in cBathyDemo2023.m

mpalmsten commented 1 year ago

I was able to successfully run this the version of cBathy in this branch. No suggested changes before merging.