NOAA-GFDL / CEFI-regional-MOM6

A repository containing essential tools, XML files, and source codes for collaborators of the Climate, Ecosystems, and Fisheries Initiative (CEFI) to conduct simulations.
Other
19 stars 16 forks source link

Split Gulf Steam plot from ssh_eval and rewrite ssh_eval to use config file #101

Closed uwagura closed 4 weeks ago

uwagura commented 1 month ago

This PR separates the gulf stream position and index plot form the mean ssh plot, and generalizes the ssh plot to use the config.yaml file. Plots included below; the arctic and MHI plots were made using only about 2 weeks worth of data, so as always don't read into the metrics or plots too deeply, and please forgive the sloppy formatting!

It looks like the cartopy.axes.set_xticks function that add_ticks calls does not yet support non-rectangular projections, so as a work around for the arctic I included an if statement before this function is called that checks if the grid is in the NorthPolarStereo projection before calling add_ticks. This workaround feels a bit clumsy, but should be good for the projections we expect right now. Would appreciate people's thoughts on whether or not there is a better way to do this check.

mean_ssh_eval_nwa gulfstream_eval mean_ssh_eval_arctic mean_ssh_eval_MHI mean_ssh_eval_nep

uwagura commented 4 weeks ago

@yichengt900 Thanks for the commit. Regarding the changes:

1.) I purposefully edited the gulf stream plot to output figures into the NWA12 directory, because I thought it would be more intuitive for users to find them there than the figures directory in the parent folder. If you think the figures folder is still a better location, we can remove the output_dir argument from the save_figure plot as well.

2.) I had left a comment in ssh_eval about the longitude coordinates in the config file not matching the longitude coordinates range in model_grid.geolon, and reminding users to make sure these values align in their own model grid / config files. I decided to leave the responsibility of making sure these values use the same range to the user so that they could make sure all their files were consistent across all scripts. Will all grid files will use the [-180,180] range for longitude? if so, we can leave your edit and erase my comment.

yichengt900 commented 4 weeks ago

@yichengt900 Thanks for the commit. Regarding the changes:

1.) I purposefully edited the gulf stream plot to output figures into the NWA12 directory, because I thought it would be more intuitive for users to find them there than the figures directory in the parent folder. If you think the figures folder is still a better location, we can remove the output_dir argument from the save_figure plot as well.

2.) I had left a comment in ssh_eval about the longitude coordinates in the config file not matching the longitude coordinates range in model_grid.geolon, and reminding users to make sure these values align in their own model grid / config files. I decided to leave the responsibility of making sure these values use the same range to the user so that they could make sure all their files were consistent across all scripts. Will all grid files will use the [-180,180] range for longitude? if so, we can leave your edit and erase my comment.

@uwagura : 1.) For now, let’s keep all plot outputs in the figures folder. When we have specific plots for each domain, we can revisit and decide on the best organization.

2.) I saw your comment in the code. The issue is that if someone runs the script and config.yaml as-is, they’ll end up with NaN values in the metrics, which isn’t ideal. I’m not fully satisfied with my workaround either, and I don’t have a better solution at the moment—perhaps adding a mask section in the YAML could help. For now, let’s keep your comment, add a TODO note about the current trick we used to revisit later, and address it in a future update.