-
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.
Non-linear bed slopes and collection updates. (#139)
* Passing partial expressions as values in change_attributes dict. This makes is possible to pass partial mathematical expressions when updating attributes through the change_attributes method of GlacierCollection. This is done by passing a string e.g. '* 10' in the value list of a key, This will multiply the current value by a factor of 10. Partial expressions are evaluated in the new utility function expression_parser. Adds test cases for both the expression_parser and the change_attributes method. * Non-linear bed profiles. This give the user more control over the slope of the glacier bed. Either by supplying only a single slope or a sequence of slopes and slope sections (specified by altitude intervals). Behind the scenes it figures out how long (x-distance) each section has to be to fulfill the slope, which is what the total glacier length and the number of gridpoints is then based on. It then interpolates the slope sections along the distance of the glacier. * First rules to _check_collection. With the introduction of non-linear bed slopes, the collection need logic to determine if glaciers can be put in the same collection. In this initial case we check if the bed profiles are the same. This is to keep plot methods working. Maybe this is something will do different in the future. But for now I don't see a nice way to plot glaciers with different slopes on top of each other. * Added checks to make sure provided slopes are reasonable.
- Loading branch information
1 parent
f8c63f1
commit 3058bb7
Showing
6 changed files
with
317 additions
and
49 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
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.