From 9f62b05201ed5076dee5aec1fd9e7ec3f356021c Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Mon, 27 Nov 2023 16:10:20 -0600
Subject: [PATCH] snapshot...

---
 modules/util/plot.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/modules/util/plot.py b/modules/util/plot.py
index 831094dc..c518ed8c 100644
--- a/modules/util/plot.py
+++ b/modules/util/plot.py
@@ -12,6 +12,8 @@ import xarray as xr
 import os
 import h5py
 from util.util import get_grid_values_all, get_cartopy_crs, homedir
+import csv
+from matplotlib.colors import LinearSegmentedColormap
 
 from util.setup import home_dir
 import mpl_scatter_density
@@ -49,6 +51,19 @@ for i in range(2):
 cld_mask_cmap = ListedColormap(cld_mask_list, 'CldMask')
 
 
+# Read colors from CSV file
+colors_file = homedir + 'ICE.ct'
+colors = []
+with open(colors_file, 'r') as csvfile:
+    csv_reader = csv.DictReader(csvfile)
+    for row in csv_reader:
+        colors.append((float(row['R']) / 255, float(row['G']) / 255, float(row['B']) / 255))
+
+# Define a custom colormap
+cmap_name = 'icing_colormap'
+icing_cmap = LinearSegmentedColormap.from_list(cmap_name, colors, N=256)
+
+
 def plot_train_curve(rundir=None, title=None):
     last_epoch = 0
     num_train_steps = 0
-- 
GitLab