-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New mass balance customisation interface and other qol updates. (#150)
* Mass Balance evolution: Update mass balance during a run. This changes how, and where, the mass balance is updated when a climate change scenario is present. We now do it within the `get_monhtly_mb` function which is called every year inside `step` of the `FluxBasedModel`. This simplifies the `Glacier.progress_until...` methods a lot. This is accomplished with a new mass balance has attribute: the `temp_bias_series`, a pandas dataframe. By default this stores the temp_bias evolution. It is also possible to assign a future bias evolution to this attribute. The model will then read this evolution at runtime to update the mass balance accordingly. Assigning a future mb evolution can be done through the `add_temperature_bias` method (a linear change) or in the future by create a random df. It will also be possible for the user to create their own df outside of edu and supply it to the mb object. * Random and custom mass balance This adds a convenient method to create a random varying temperature bias series. It is also possible to submit a custom bias series through the setter of temp_bias_series. The setter makes sure that the supplied dataframe conforms to what the mb model expects. * plot_history: Add smoothing window and time slice options. This makes it possible to smooth the bias series to a specified rolling window, and select any time range to plot, for a closer inspection. Adds a proper signature to the method. * Bugfix: Correct index so select the last year of the history. * plot_history: Make it possible to invert the y-axis of the bias. * Glacier and GlacierCollection: summary method and html representation. This adds a new method, `summary`, to Glacier and GlacierCollection. This returns a pandas dataframe with interesting attributes of the objects. These are then accessible just like in a normal dataframe. The html representation of the both now simply returns the _html_repr_ of the summary method. * temp_bias_series setter: Simplify setting custom mass balances. It is much more simple to only pass an array of values to the setter. The user no longer has to generate a correct dataframe with correct years. This is now instead done in the setter. The user only has to generate an array or list of biases. Tests are updated. * add_temperature_bias: Optional noise argument. This makes it possible to add noise to the temperature bias through an optional argument. It will add random noise ranging between the two values to the linear trend. * GlacierBed slope generation: make holes This releases the checks on the slopes, making it possible to assign a slope between -90 and 90 degrees. However, the user have to remember to have a slope_section which has an altitude above the previous one for the slope to ascend. * Add ice velocity to glacier statistics.
- Loading branch information
1 parent
2baadd0
commit c142f16
Showing
6 changed files
with
368 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.