Skip to content

Conversation

@brianpm
Copy link
Collaborator

@brianpm brianpm commented Sep 15, 2025

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:

  • local functions
    • _validate_user_inputs
    • _get_ref_cluster_labels
    • _preprocess_data
    • compute_cluster_labels
    • precomputed_clusters
    • _compute_distances_pot
    • _compute_distances_wasserstein
    • _calculate_rfo
    • load_reference_data
    • load_cluster_centers
  • plotting functions
    • _plot_map
    • _configure_map_axes
    • _add_colorbar
    • _add_colorbar2
    • plot_rfo_maps
    • plot_hists_baseline
    • plot_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_figure
  • Data handling
    • spatial_subset
    • temporal_subset
    • select_valid_tau_height
    • _calculate_weighted_mean_xr
  • Land/Ocean masking
    • apply_land_ocean_mask
    • _make_mask_broadcastable
    • create_land_mask
    • _find_land_points
  • Regridding
    • make_se_regridder
    • regrid_se_data_bilinear

This 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants