-
Notifications
You must be signed in to change notification settings - Fork 24
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
Key metrics #118
Key metrics #118
Conversation
This is the first notebook that runs under the key_metric example
Removed the CESM3 vs CESM2 comparison section, refactored code to avoid duplication. Still to do: create utils.py so additional notebooks can share these refactored functions. Probably some other code clean-up as well...
@mnlevy1981 would it be helpful for me to review and then bring in the land-ice notebook as is, or should we wait until additional notebooks are ready to bring in? |
I have a few more changes to make for this one (pulling several functions out into a One other thing to note: this notebook currently reads output from coupler history files, but I think Gunter said that work is in progress to get those fields into the CISM history files -- depending on the timeline for that, we should either pull in the notebook after it's cleaned up or wait until we can update the location of the history files to read. |
Created a single utils module for now
1. Reorganized cells and added markdown headers (parameter configuration, set up grid, make datasets, generate plots). 2. Fixed issue with plotting base maps (tested by comparing first 40 years of run to last 40 years of run) 3. Added years included in climatology to the title of plots
Commented out the atmosphere, ocean, land, and sea ice section definitions and added a section for land ice.
This is ready for review, though I think and the time series looks like Note that I added the years included in the climotology to the map title and the legend; to test the "compare against a base case" (which is turned off by default), I compared years 62-101 to years 43-82 of the same run and realized it was useful to have different labels for those different plots. |
(sorry for the assigning / unassigning, I thought I was requesting reviews) |
Thanks for all your work on this @mnlevy1981 ! I'm aiming to look at it tomorrow! |
A few comments:
|
I think we should keep them in
I'll work on this, and will probably end up with some of the functions we talked about (like a
Thanks! Verifying you can run the notebook on my branch would be great, but given the changes coming to address your first two points I don't think you need to dive too deep at this point |
Started replacing netcdf4 calls with xarray equivalents. I think the observational dataset read is still entirely netcdf4-based, so that needs to be updated. Also, I want to try calling xr.open_mfdataset() once per case and then passing datasets rather than doing the read twice (once for temporal mean, once for spatial mean).
Read in 40 years of SMB data with read_cesm_smb(), and then use xarray functions (basically taking means or sums over different dimensions) to compute the different climatologies. This greatly reduces the number of functions needed in utils - it's just read_cesm_smb() and some plotting routines.
As of 5b6e3d5 I think this is really ready for review. I've gotten rid of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to run this successfully and replicate the plots that you showed.
One other somewhat odd feature is that the output is located in "CUPiD/examples/key_metrics/computed_notebooks/key_metrics"-- is there a reason for this second 'key_metrics' directory?
I thought we had an issue ticket about this, but I can't find it. I'd really like to clean up the names of the directories |
Also renamed data -> da in plot_line() to be consistent with plot_contour()
Every panel was overwriting the location of the colorbar, so only the bias contour levels were shown. Now the first two plots (with same vmin and vmax) have a colorbar between them while bias plot colorbar is off to the right
Put together a "key metrics" example that can be run quickly for a single CESM case to look at a small number of important diagnostics. The first pass at this adds a land-ice notebook, but more notebooks are coming.
All Submissions:
pre-commit
check)?New Feature Submissions:
Changes to Core Features: