Cloud regime analysis #417
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is supposed to replace #251.
It is a substantial refactoring of Isaac's original script, but accomplishes the same thing: plots of the cloud regimes and maps of frequency of occurrence of cloud regimes. This works with ISCCP, MODIS, and MISR cloud regimes. There are a number of options available, and they should be set using the argument dictionary approach in the configuration YAML file.
I've done testing for ISCCP histograms, but haven't repeated for MODIS and MISR so far.
There are quite a few helper functions included. I have tried to organize them into the categories:
_validate_user_inputs_get_ref_cluster_labels_preprocess_datacompute_cluster_labelsprecomputed_clusters_compute_distances_pot_compute_distances_wasserstein_calculate_rfoload_reference_dataload_cluster_centers_plot_map_configure_map_axes_add_colorbar_add_colorbar2plot_rfo_mapsplot_hists_baselineplot_hists_obs_prepare_plot_data_plot_cloud_regimes_plot_observation_column_plot_baseline_column_plot_test_case_column_create_colormap_configure_axes_configure_modis_axes_configure_misr_axes_configure_isccp_axes_add_figure_labels_save_figurespatial_subsettemporal_subsetselect_valid_tau_height_calculate_weighted_mean_xrapply_land_ocean_mask_make_mask_broadcastablecreate_land_mask_find_land_pointsmake_se_regridderregrid_se_data_bilinearThis can probably be simplified more, but I thought it was worth getting it into ADF now, and modifying it incrementally as possible. In particular, the land/ocean masking and the regridding should probably be removed for more generalized versions of those functions that can be used across ADF scripts.