Index: /trunk/Ohana/src/opihi/dvo/gimages.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/gimages.c	(revision 12749)
+++ /trunk/Ohana/src/opihi/dvo/gimages.c	(revision 12750)
@@ -4,9 +4,10 @@
   
   int i, j, N, Nimage, Nfound, *subset, Nsubset, status;
-  double ra, dec, Ra, Dec, X, Y;
+  double ra, dec, Ra, Dec, X, Y, Yo;
   double trange, t;
   int TimeSelect, PixelCoords, TimeFormat, PhotCodeSelect;
   time_t tzero, TimeReference;
   char name[64], *date;
+  int typehash;
 
   PhotCode *code;
@@ -76,4 +77,8 @@
   BuildChipMatch (image, Nimage);
 
+  int DistortImage = wordhash ("-DIS");
+  int TriangleUp   = wordhash ("TRP-");
+  int TriangleDn   = wordhash ("TRM-");
+
   Nfound = 0;
   for (j = 0; j < Nsubset; j++) {
@@ -93,14 +98,38 @@
     if (!finite(Y)) continue;
     if (!status) continue;
-    if (!strcmp(&image[i].coords.ctype[4], "-DIS")) {
-	if (X < -0.5*image[i].NX) continue;
-	if (Y < -0.5*image[i].NY) continue;
-	if (X > +0.5*image[i].NX) continue;
-	if (Y > +0.5*image[i].NY) continue;
-    } else {
-	if (X < 0) continue;
-	if (Y < 0) continue;
-	if (X > image[i].NX) continue;
-	if (Y > image[i].NY) continue;
+
+    typehash = wordhash (&image[i].coords.ctype[4]);
+
+    if (typehash == DistortImage) {
+      if (X < -0.5*image[i].NX) continue;
+      if (Y < -0.5*image[i].NY) continue;
+      if (X > +0.5*image[i].NX) continue;
+      if (Y > +0.5*image[i].NY) continue;
+      goto got_spot;
+    } 
+
+    typehash = wordhash (image[i].coords.ctype);
+    if (typehash == TriangleUp) {
+      if (Y < -0.5*image[i].NY) continue;
+      Yo = +0.5*image[i].NY + 2.0*(image[i].NY/image[i].NX)*X;
+      if (Y > Yo) continue;
+      Yo = +0.5*image[i].NY - 2.0*(image[i].NY/image[i].NX)*X;
+      if (Y > Yo) continue;
+      goto got_spot;
+    }
+    if (typehash == TriangleDn) {
+      if (Y > +0.5*image[i].NY) continue;
+      Yo = -0.5*image[i].NY + 2.0*(image[i].NY/image[i].NX)*X;
+      if (Y < Yo) continue;
+      Yo = -0.5*image[i].NY - 2.0*(image[i].NY/image[i].NX)*X;
+      if (Y < Yo) continue;
+      goto got_spot;
+    }
+
+    {
+      if (X < 0) continue;
+      if (Y < 0) continue;
+      if (X > image[i].NX) continue;
+      if (Y > image[i].NY) continue;
     }
 
@@ -109,4 +138,5 @@
     ***/
 
+  got_spot:
     date = sec_to_date (image[i].tzero);
 
Index: /trunk/Ohana/src/opihi/dvo/images.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/images.c	(revision 12749)
+++ /trunk/Ohana/src/opihi/dvo/images.c	(revision 12750)
@@ -2,8 +2,15 @@
 # define BETA 0.41421
 
+int wordhash (char *word) {
+  int value;
+
+  value = *(int *)word;
+  return value;
+}
+
 int images (int argc, char **argv) {
 
   int i, j, Nimage, status, InPic, leftside, *plist, TimeSelect, ByName;
-  int WITH_MOSAIC, SOLO_MOSAIC;
+  int WITH_MOSAIC, SOLO_MOSAIC, HIDDEN;
   time_t tzero, tend;
   int N, NPTS, n, npts, Npts;
@@ -13,4 +20,5 @@
   Graphdata graphmode;
   char name[256];
+  int typehash;
 
   if (!style_args (&graphmode, &argc, argv, 0)) return FALSE;
@@ -26,4 +34,11 @@
     remove_argument (N, &argc, argv);
     SOLO_MOSAIC = TRUE;
+    WITH_MOSAIC = TRUE;
+  }
+
+  HIDDEN = FALSE;
+  if ((N = get_argument (argc, argv, "-hidden"))) {
+    remove_argument (N, &argc, argv);
+    HIDDEN = TRUE;
   }
 
@@ -96,4 +111,8 @@
   Rmid = 0.5*(Rmin + Rmax);
   
+  int DistortImage = wordhash ("-DIS");
+  int TriangleUp   = wordhash ("TRP-");
+  int TriangleDn   = wordhash ("TRM-");
+
   npts = NPTS = 200;
   ALLOCATE (Xvec.elements, float, NPTS);
@@ -106,15 +125,39 @@
     if (!FindMosaicForImage (image, Nimage, i)) continue;
 
-    if (!strcmp(&image[i].coords.ctype[4], "-DIS") && !WITH_MOSAIC) continue;
-    if ( strcmp(&image[i].coords.ctype[4], "-DIS") &&  SOLO_MOSAIC) continue;
-
-    /* project this image to screen display coords */
+    Npts = 4;
+    status = TRUE;
+    leftside = FALSE;
+
+    typehash = wordhash (&image[i].coords.ctype[4]);
+
     /* DIS images represent a field, not a chip */
-    if (!strcmp(&image[i].coords.ctype[4], "-DIS")) {
+    if ((typehash == DistortImage) && !WITH_MOSAIC) continue;
+    if ((typehash != DistortImage) &&  SOLO_MOSAIC) continue;
+    if (typehash == DistortImage) {
       x[0] = -0.5*image[i].NX; y[0] = -0.5*image[i].NY;
       x[1] = +0.5*image[i].NX; y[1] = -0.5*image[i].NY;
       x[2] = +0.5*image[i].NX; y[2] = +0.5*image[i].NY;
       x[3] = -0.5*image[i].NX; y[3] = +0.5*image[i].NY;
-    } else {
+      goto got_type;
+    }
+
+    typehash = wordhash (image[i].coords.ctype);
+    if (typehash == TriangleUp) {
+      Npts = 3;
+      x[0] =                0; y[0] = +0.5*image[i].NY;
+      x[1] = +0.5*image[i].NX; y[1] = -0.5*image[i].NY;
+      x[2] = -0.5*image[i].NX; y[2] = -0.5*image[i].NY;
+      goto got_type;
+    }
+    if (typehash == TriangleDn) {
+      Npts = 3;
+      x[0] =                0; y[0] = -0.5*image[i].NY;
+      x[1] = +0.5*image[i].NX; y[1] = +0.5*image[i].NY;
+      x[2] = -0.5*image[i].NX; y[2] = +0.5*image[i].NY;
+      goto got_type;
+    }
+
+    // default layout
+    {
       x[0] = 0;           y[0] = 0;
       x[1] = image[i].NX; y[1] = 0;
@@ -123,8 +166,9 @@
     }
 
-    Npts = 4;
-    status = TRUE;
-    leftside = FALSE;
-    for (j = 0; j < 4; j++) {
+  got_type:
+
+    /* project this image to screen display coords */
+    // check for boundary overlap?
+    for (j = 0; j < Npts; j++) {
       status = XY_to_RD (&r[j], &d[j], x[j], y[j], &image[i].coords);
       if (!status) break;
@@ -203,4 +247,5 @@
 	InPic = TRUE;
     }
+    if (!status && HIDDEN) status = TRUE;
     if (InPic && status) {
       plist[n] = i;
