Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebook or sequential examples #168

Open
krober10nd opened this issue Jan 9, 2025 · 5 comments
Open

Notebook or sequential examples #168

krober10nd opened this issue Jan 9, 2025 · 5 comments
Assignees

Comments

@krober10nd
Copy link

Hi guys, thanks for the great work. I've been studying the paper recently. It would be very helpful to either have a working notebook with a case study or some more sequential examples where the workflow and utilities of the library are explicit. It seems that you're able to provide uncertainty for several hurricane scale and intensity parameters in addition to track position uncertainty?

@SorooshMani-NOAA
Copy link
Collaborator

SorooshMani-NOAA commented Jan 10, 2025

@krober10nd thank you! Let me see if I can address your concern:

The package supports perturbing the track information to account for historical uncertainty in location, intensity, and size of the storm. It uses Gaussian as the distribution for all the variables in the latest iteration (it used to be Uniform for RMW in previous versions). This is also accompanied by the latest RMW forecast scheme from NHC (implemented in stormevents package following Penny etal 2023), although still it's possible to assume RMW to be constant for times where there's no forecast. Apart from that the package differentiates between deck "a" (forecast track) and "b" (best track) to generate uncertainty distribution.

While each piece of the package can be used on its own so that we can put together a notebook, the main way we use it is through ondemand-storm-workflow. Which is another layer of wrapper to make it just work with a config file (for schism assuming you have compiled it already).

Since I'm not sure when we'll be able to start putting together a good generic use-case example, I'd suggest that you take a look at the on demand repo scripts. In specific:

Note that the workflow there is to just create the environment, compile SCHISM, set the config file, and finally just call run_ensemble /path/to/input.yaml. What happens then is that the run_ensemble calls into the main which runs a bash script that runs each of the files listed above through slurm scripts!! Yeah, I know ... things evolved over time, so we kind of took the path of least resistance!!

In any case looking at the Python files listed above should give you a head start on how to use ensembleperturbation. I hope that helps! Please feel free to follow up with more questions on this issue!

PS. The workflow could be simpler than what is explained above, but for specific usecase of perturbing storm at given leadtimes, meshing, etc. this is what we came up with. If you could just use the files above and come up with a nice simplified notebook (even better if it's for ADCIRC) then we could add it to examples which haven't been updated recently. Actually this package was originally used with ADCIRC, but then in the second iteration we mainly used it for SCHISM, although it should still work for ADCIRC!

@SorooshMani-NOAA SorooshMani-NOAA self-assigned this Jan 10, 2025
@krober10nd
Copy link
Author

krober10nd commented Jan 10, 2025

Thank you very much, Soroosh. Essentially I just want to create an ensemble of hurricane simulations and currently am not too interested in the surrogate model. I assume the creation of those ensembles is done in setup_ensemble.py and hurricane_data.py? Thanks

@SorooshMani-NOAA
Copy link
Collaborator

Yes, these two files should do all you want.

Note that a lot of hacky stuff is going on in these two files though. EnsemblePerturbation takes the whole track and perturbs it, but what we wanted to do in our workflow was to have a shared section of the track up until say 48hr lead time and then perturb, that's the reason you see this unperturbed variable, etc in setup_ensemble.py. So in the most basic case you mainly need these lines:
https://github.com/oceanmodeling/ondemand-storm-workflow/blob/2c3b0ffd28c9014c3516150e93e9c818b99f059a/stormworkflow/prep/setup_ensemble.py#L259-L288

One more important thing going on here is that we wanted to make sure we perturb a single advisory, 'a' deck contains all advisories, so we have to filter based on the forecast cycle, then also as I said we also want to perturb only a portion of the track. Moreover at least in the case of PySCHISM, it only accepts BEST track, so we fake it; we perturb the OFCL track and then rename OFCL to BEST. Note that if we first rename then perturb it's going to be different due to how best track errors are different than forecast ones.

The hurricane_data.py script is mainly related to figuring out the perturbation time, etc. as well as getting the track. EnsemblePerturbation can directly get the track too, but in our workflow we wanted more control!

There are also a bunch of calls to "fix" some issues related to dependency packages [e.g. PySCHISM had an issue but it was much easier to take care of it after setup instead of fixing PySCHISM].

Sorry if I'm jumping here and there ... please let me know if you have further questions about the two scripts.

@SorooshMani-NOAA
Copy link
Collaborator

@krober10nd do you think the information provided in this ticket so far resolves the example question? I can keep this ticket open until an actual example is provided, but I just want to know if I could move this to a future "Todo" list rather than an "In Progress" one! Thanks for your feedback!

@krober10nd
Copy link
Author

I think the answer you provided was sufficient. It will be some time before I revisit with an example so feel free to close it and add it to a todo list etc. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants