Index: /branches/eam_branches/ohana.20190329/src/kapa2/src/SetColormap.c
===================================================================
--- /branches/eam_branches/ohana.20190329/src/kapa2/src/SetColormap.c	(revision 40706)
+++ /branches/eam_branches/ohana.20190329/src/kapa2/src/SetColormap.c	(revision 40707)
@@ -72,5 +72,5 @@
 	  }
       }
-      fprintf (stderr, "ruff Npix: %d vs %d\n", i, graphic[0].Npixels);
+      // fprintf (stderr, "ruff Npix: %d vs %d\n", i, graphic[0].Npixels);
 
       // all other modes are 1D: set the flag:
@@ -217,4 +217,5 @@
       !strncmp (graphic->colormapName, "lgcy:", 5) || 
       !strncmp (graphic->colormapName, "cetf:", 5) || 
+      !strncmp (graphic->colormapName, "cetr:", 5) || 
       !strncmp (graphic->colormapName, "csvf:", 5)) {
 
@@ -233,9 +234,10 @@
     int isCSV = !strncmp (graphic->colormapName, "csvf:", 5);
     int isCET = !strncmp (graphic->colormapName, "cetf:", 5);
+    int isCETRev = !strncmp (graphic->colormapName, "cetr:", 5);
     int isLegacy = !strncmp (graphic->colormapName, "lgcy:", 5);
 
     float fracIndex, fracRed, fracBlue, fracGreen;
 
-    if (isCET) fracIndex = 0.0;
+    if (isCET || isCETRev) fracIndex = 0.0;
 
     while (scan_line_maxlen (f, line, 1024) != EOF) {
@@ -247,5 +249,5 @@
 	if (Nscan != 4) continue;
       }
-      if (isCET) {
+      if (isCET || isCETRev) {
 	Nscan = sscanf (line, "%f,%f,%f", &fracRed, &fracGreen, &fracBlue);
 	fracIndex += 1.0 / 256.0;
@@ -256,5 +258,5 @@
 	if (Nscan != 4) continue;
       }
-      if (!isCSV && !isLegacy && !isCET) {
+      if (!isCSV && !isLegacy && !isCET && !isCETRev) {
 	Nscan = sscanf (line, "%f %f %f %f", &fracIndex, &fracRed, &fracGreen, &fracBlue);
 	if (Nscan != 4) continue;
@@ -299,4 +301,16 @@
       }
     }
+
+    // reverse the color sequence:
+    if (isCETRev) {
+      for (i = 0; i < MaxValue / 2; i++) {  
+	unsigned short tmp;
+	// fprintf (stderr, "swap: %d %d\n", graphic[0].cmap[i].red, graphic[0].cmap[MaxValue - 1 - i].red);
+	tmp = graphic[0].cmap[i].red;   graphic[0].cmap[i].red   = graphic[0].cmap[MaxValue - 1 - i].red;   graphic[0].cmap[MaxValue - 1 - i].red   = tmp;
+	tmp = graphic[0].cmap[i].blue;  graphic[0].cmap[i].blue  = graphic[0].cmap[MaxValue - 1 - i].blue;  graphic[0].cmap[MaxValue - 1 - i].blue  = tmp;
+	tmp = graphic[0].cmap[i].green; graphic[0].cmap[i].green = graphic[0].cmap[MaxValue - 1 - i].green; graphic[0].cmap[MaxValue - 1 - i].green = tmp;
+      }
+    }
+
     goto store_colors;
   }
