-
Notifications
You must be signed in to change notification settings - Fork 33
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
Curtain plot (model) with Observations overlaid as scatter & Updated Violin Plot with bigger label fonts and ticks consistent with other plots #254
Conversation
quaz115
commented
Mar 26, 2024
… other plots in aircraftplots
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.
Can you fix the plot title to be based on text_kwargs too. To make it look nice I also had the tickparams a bit smaller than the title and x/y labels at 0.8*. You can look at make_boxplot subroutine in surfplots.py for how to do this.
|
… each model-obs pair like scatter plots
…ring words such as, Parameters & Returns
Curtain plot added: The interpolate_and_clean_model_data function is responsible for preparing the model data for visualization, which involves creating a meshgrid from the time and altitude data, interpolating over any gaps, and cleaning the dataset by replacing any non-numerical values with appropriate limits. The make_curtain_plot function takes this prepared data and produces the actual visualization, plotting the model data as a contour plot (a curtain plot) and overlaying observational data as a scatter plot on top of this. The function uses the matplotlib library for plotting, allowing for a custom (color_map_custom as True) or predefined colormap (color_map_custom as False), and ensures the plot is correctly normalized using the minimum and maximum data values. The appearance of the plot(s) (e.g., labels, titles) are customized using the parameters specified in the YAML configuration. Currently, it prints for each model-obs pair as done for scatter plots earlier. For example:
|
Also @rschwant the test data used here is for FIREX 2019-09-05, I think model results might be a bit old for this: /wrk/qrasool/firex_mech_qzhu/run_CONUS_fv19_BEIS_1.0xISO_RACM_v4.2.2_racm_berk_vcp_noI_phot_soa/0905/* (on Meiyu) |
@colin-harkins @rschwant For the latest commits to fix curtain plot, i am able to generate model curtain plot (pressure as y-axis and time as x-axis) with model scatter as overlay aligned with obs scatter (in the second subplot). Curtain and scatter profiles all share common colorbar (vmin and vmax can be user-defined or dynamically set based on the data min max) for each variable set: An example here: a) using default Spectral_r cmap:
|
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.
Great job, pulling in a very complicated plot! I had a couple questions still. I'll be in the office tomorrow if you want to talk about my comments. If you can just address these this week that works well we can work on the spatial plot another time.
examples/yaml/control_wrfchem_aircraft_Latestfor_develop_aircraft_testmultiplemodelgroups.yaml
Outdated
Show resolved
Hide resolved
examples/yaml/control_wrfchem_aircraft_Latestfor_develop_aircraft_testmultiplemodelgroups.yaml
Outdated
Show resolved
Hide resolved
examples/yaml/control_wrfchem_aircraft_Latestfor_develop_aircraft_testmultiplemodelgroups.yaml
Outdated
Show resolved
Hide resolved
examples/yaml/control_wrfchem_aircraft_Latestfor_develop_aircraft_testmultiplemodelgroups.yaml
Outdated
Show resolved
Hide resolved
examples/yaml/control_wrfchem_aircraft_Latestfor_develop_aircraft_testmultiplemodelgroups.yaml
Outdated
Show resolved
Hide resolved
Also I just noticed can you make sure the vmin and vmax for the pressure on the y-axis for both plots are the same so it is easier to compare them? |
…aircraftplots
…ir separately as png now
Lines 373-375 in aircraftplots.py now addresses this issue: # Set the same y-tick labels for both subplots and exclude the minimum value |
examples/yaml/control_wrfchem_aircraft_Latestfor_develop_aircraft_testmultiplemodelgroups.yaml
Outdated
Show resolved
Hide resolved
…stom is used.
…color_map True statement in aircratplots more explicit, colobar minima not forced to be zero now
…y list in YAML for different variables plotted
…ot types, Also in aircraftplots make_curtain_plot() now fontsize, fontweight and labelsize all linked via YAML
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.
Just had a couple small comments to fix for the vmin, vmax, cmin, and cmax variables and everything else looks great! Thanks for updating everything. Once these things are fixed, I can fully approve and we can merge this in.
"#343434", "#606060", "#8c8c8c", "#b8b8b8", "#e4e4e4"] #, | ||
#"#ffffff"] #['blue','royalblue', 'cyan', 'yellow', 'orange', 'red'] ##['#440154', '#3b528b', '#21908d', '#5dc963', '#fde725'] #['purple', 'blue', 'green', 'yellow'] # Example gradient | ||
color_levels: 30 #31 #15 #10 # Define the number of distinct colors in the color bar | ||
#color_map: 'Spectral_r' #'jet' # This can be set instead of color_map_custom, color_levels and color_levels to set a colormap defined in matplotlob. |
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.
Should one of the color_levels here be colors instead in the comment?
melodies_monet/driver.py
Outdated
from .util.tools import resample_stratify | ||
from .util.tools import vert_interp | ||
import matplotlib.dates as mdates | ||
import numpy as np |
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.
Do you use all of these? I looks like numpy is already pulled in at the top. mdates is not used and vert_interp is not used.
#color_map: 'Spectral_r' #'jet' # This can be set instead of color_map_custom, color_levels and color_levels to set a colormap defined in matplotlob. | ||
vmin: 120000 #Pressure in Pa #0 #Optional (y-axis limits) | ||
vmax: 5000 # Optional #need to be edited as per min and max altitude (i.e., vmin and vmax) | ||
interval : 500 #Pressure in Pa; target pressure interpolation steps for model curtain 2d plot |
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.
It does not look like these vmin and vmax values are used in the code right now. Do you want to correct this or just take this option out?
|
||
if vmin is not None and vmax is not None: | ||
plot_dict['ylim'] = [vmin, vmax] | ||
|
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.
The vmin and vmax values from your yaml file are not linked to the vmin and vmax values used here and this code is not used later on either. So likely should delete this line. And fix this connection like specified above.
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 think once you make the changes Becky requested this looks good. I'll approve on my end.
I thought this would take two approvals to be able to merge so hold off on merging until you address Becky's comments but I'll leave as is with the approval on my end. |
… limits, Tested with unit change Pa to hPa, cleaned up codes and yaml
@rschwant @colin-harkins Tested with fixes for previous comments on y-axes and colorbar labels. Tested with changing units of pressure (pressure_units via yaml, distinguished between 'intervals' as y-axis tick intervals and 'num_levels' as interpolation levels for target pressures as well). Updated single model yaml as well with curtain plot config options. An example result with customized y-axis limits working well: However getting this CI/Check docs build error, which I don't think is related to my changes. |
It looks like there are broken links in the supported datasets page and the developers guide page on the readthedocs.
I think potentially this is related to some restructuring of the project board link? The project board that exists now seems to be: https://github.com/orgs/NOAA-CSL/projects/6 I'm not sure if this is related to something we changed or github changed about the project board. @rschwant do you know? Regardless, hopefully it shouldn't be too hard to find new links for these items in the project board. |
Yes, I asked Quazi to update these links. Github got rid of their classic project boards, but luckily we had already migrated to one project board, so we just need to update the ReadTheDocs for this. |
@colin-harkins i did try to resolve conflicts but not sure why they are still visible on the PR? |
…ject board link with text edit works
…NET project board link with text edit works
…ODIES-MONET project board link with text edit works" This reverts commit 79ca49e.
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.
Looks great!