cal-adapt / climakitae

A Python toolkit for retrieving, visualizing, and performing scientific analyses with data from the Cal-Adapt Analytics Engine.
https://climakitae.readthedocs.io
BSD 3-Clause "New" or "Revised" License
19 stars 2 forks source link

Improve visualizations in the first panel of wl.visualize #407

Closed nicolejkeeney closed 3 weeks ago

nicolejkeeney commented 1 month ago

Improve visualizations in the first panel ("maps of individual simulations") in wl.visualize()

I improved the visualizations for the first panel in wl.visualize(). I improved the colormap, addressing this old issue Naomi raised. I also added a colorbar and reasonable plot titles. For data with more than 4 simulations, a single plot is shown with a dropdown widget for toggling between simulations. For data with 4 or fewer simulations, postage stamp maps are created.

I also added the ability for a scatter plot to be generated for data that is only a single grid cell. It's not that informative, but at least it shows you something, and doesn't throw an error :)

To test: Run the warming_levels.ipynb notebook up until wl.visualize() (section 1c in the notebook). Try a few different data options.

NOTE: I wasn't able to get to the second tab-- the one with the stats-- before I headed out of town. I'll fix that one up when I return :D

Type of change

Subtle visualization improvements None of the below applicable

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. n/a

Checklist:

vicford commented 1 month ago

@nicolejkeeney Testing your latest commit fixes - now noticing that when its <4 subplots the colorbar label + unit does show up now, but not for the dropdown menu version. Only other outstanding thing is that the colormap is still acting up for truly diverging data

claalmve commented 1 month ago

I love these changes to the warming level plots! This is a much more intuitive interpretation of the postage plots with the same scale on the colorbar.

For some reason, I'm getting this error when running warming_levels on a smaller lat/lon subset:

image

Lat/lon params changed:

wl.wl_params.latitude=(34.0,34.03)
wl.wl_params.longitude=(-117.5,-117.45)
nicolejkeeney commented 3 weeks ago

I love these changes to the warming level plots! This is a much more intuitive interpretation of the postage plots with the same scale on the colorbar.

For some reason, I'm getting this error when running warming_levels on a smaller lat/lon subset: image

Lat/lon params changed:

wl.wl_params.latitude=(34.0,34.03)
wl.wl_params.longitude=(-117.5,-117.45)

I think this isn't related to the panel at all, the workflow raises an error in the steps above the panel when trying to load the data because there is no data in that subset.

We should probably have wl.calculate() throw an informative error if this is the case. It prints the text below, then raises a Value Error.

Screenshot 2024-08-22 at 9 02 24 AM