Index: /trunk/Ohana/Makefile.in
===================================================================
--- /trunk/Ohana/Makefile.in	(revision 40018)
+++ /trunk/Ohana/Makefile.in	(revision 40019)
@@ -52,5 +52,4 @@
 relastro    \
 shell       \
-skycalc     \
 tools       \
 tcl         \
@@ -62,4 +61,5 @@
 fixcat      \
 gophot      \
+skycalc     \
 getusno     \
 lightcurve  \
Index: /trunk/Ohana/src/libdvo/src/dbStackMath.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dbStackMath.c	(revision 40018)
+++ /trunk/Ohana/src/libdvo/src/dbStackMath.c	(revision 40019)
@@ -75,5 +75,20 @@
   dbStack *OUT;
   
-# define S_FUNC(OP,FTYPE) {						\
+# define S_INT_FUNC(OP) {						\
+    if (!(V1->type & DB_STACK_INT)) {					\
+      /* function takes int type but input value is not int -> cast to opihi_int */ \
+      opihi_int M1 = (V1->type & DB_STACK_FIELD) ? (opihi_int) fields[V1->field].Flt : (opihi_int) V1->FltValue; \
+      OUT[0].type = DB_STACK_VALUE | DB_STACK_TEMP | DB_STACK_INT;      \
+      OUT[0].IntValue = OP;						\
+      return (OUT);							\
+    } else {								\
+      opihi_int M1 = (V1->type & DB_STACK_FIELD) ? fields[V1->field].Int : V1->IntValue; \
+      OUT[0].type = DB_STACK_VALUE | DB_STACK_TEMP | DB_STACK_INT;	\
+      OUT[0].IntValue = OP;						\
+      return (OUT);							\
+    }									\
+  }
+
+# define S_FLT_FUNC(OP) {						\
     if (!(V1->type & DB_STACK_INT)) {					\
       opihi_flt M1 = (V1->type & DB_STACK_FIELD) ? fields[V1->field].Flt : V1->FltValue; \
@@ -81,15 +96,9 @@
       OUT[0].FltValue = OP;						\
       return (OUT);							\
-    }									\
-    if ((FTYPE != DB_STACK_INT) && (V1->type & DB_STACK_INT)) {		\
-      opihi_int M1 = (V1->type & DB_STACK_FIELD) ? fields[V1->field].Int : V1->IntValue; \
+    } else {								\
+      /* function takes non-int type but input value is int -> cast to opihi_flt */ \
+      opihi_flt M1 = (V1->type & DB_STACK_FIELD) ? (opihi_flt) fields[V1->field].Int : (opihi_flt) V1->IntValue; \
       OUT[0].type = DB_STACK_VALUE | DB_STACK_TEMP;			\
       OUT[0].FltValue = OP;						\
-      return (OUT);							\
-    }									\
-    if ((FTYPE == DB_STACK_INT) && (V1->type & DB_STACK_INT)) {		\
-      opihi_int M1 = (V1->type & DB_STACK_FIELD) ? fields[V1->field].Int : V1->IntValue; \
-      OUT[0].type = DB_STACK_VALUE | DB_STACK_TEMP | DB_STACK_INT;	\
-      OUT[0].IntValue = OP;						\
       return (OUT);							\
     }									\
@@ -100,37 +109,35 @@
   OUT->name = NULL;
 
-  if (!strcmp (op, "="))      S_FUNC(M1,0);
-  if (!strcmp (op, "abs"))    S_FUNC(fabs(M1),0);
-  if (!strcmp (op, "int"))    S_FUNC((int)(M1),DB_STACK_INT);
-  if (!strcmp (op, "exp"))    S_FUNC(exp (M1),0);
-  if (!strcmp (op, "ten"))    S_FUNC(pow (10.0,M1),0);
-  if (!strcmp (op, "log"))    S_FUNC(log10 (M1),0);
-  if (!strcmp (op, "ln"))     S_FUNC(log (M1),0);
-  if (!strcmp (op, "sqrt"))   S_FUNC(sqrt (M1),0);
-  if (!strcmp (op, "erf"))    S_FUNC(erf (M1),0);
-
-  if (!strcmp (op, "sinh"))   S_FUNC(sinh (M1),0);
-  if (!strcmp (op, "cosh"))   S_FUNC(cosh (M1),0);
-  if (!strcmp (op, "asinh"))  S_FUNC(asinh (M1),0);
-  if (!strcmp (op, "acosh"))  S_FUNC(acosh (M1),0);
-  if (!strcmp (op, "lgamma")) S_FUNC(lgamma (M1),0);
-
-  if (!strcmp (op, "sin"))    S_FUNC(sin (M1),0);
-  if (!strcmp (op, "cos"))    S_FUNC(cos (M1),0);
-  if (!strcmp (op, "tan"))    S_FUNC(tan (M1),0);
-  if (!strcmp (op, "dsin"))   S_FUNC(sin (M1*RAD_DEG),0);
-  if (!strcmp (op, "dcos"))   S_FUNC(cos (M1*RAD_DEG),0);
-  if (!strcmp (op, "dtan"))   S_FUNC(tan (M1*RAD_DEG),0);
-  if (!strcmp (op, "asin"))   S_FUNC(asin (M1),0);
-  if (!strcmp (op, "acos"))   S_FUNC(acos (M1),0);
-  if (!strcmp (op, "atan"))   S_FUNC(atan (M1),0);
-  if (!strcmp (op, "dasin"))  S_FUNC(asin (M1)*DEG_RAD,0);
-  if (!strcmp (op, "dacos"))  S_FUNC(acos (M1)*DEG_RAD,0);
-  if (!strcmp (op, "datan"))  S_FUNC(atan (M1)*DEG_RAD,0);
-  if (!strcmp (op, "rnd"))    S_FUNC(M1*0.0 + drand48(),0);
-  if (!strcmp (op, "not"))    S_FUNC(!(M1),DB_STACK_INT);
-  if (!strcmp (op, "--"))     S_FUNC(- (M1),DB_STACK_INT);
-  if (!strcmp (op, "isinf"))  S_FUNC(!finite(M1),DB_STACK_INT);
-  if (!strcmp (op, "isnan"))  S_FUNC(isnan(M1),DB_STACK_INT);
+  if (!strcmp (op, "="))      S_FLT_FUNC(M1);
+  if (!strcmp (op, "abs"))    S_FLT_FUNC(fabs(M1));
+  if (!strcmp (op, "int"))    S_INT_FUNC((int)(M1));
+  if (!strcmp (op, "exp"))    S_FLT_FUNC(exp (M1));
+  if (!strcmp (op, "ten"))    S_FLT_FUNC(pow (10.0,M1));
+  if (!strcmp (op, "log"))    S_FLT_FUNC(log10 (M1));
+  if (!strcmp (op, "ln"))     S_FLT_FUNC(log (M1));
+  if (!strcmp (op, "sqrt"))   S_FLT_FUNC(sqrt (M1));
+  if (!strcmp (op, "erf"))    S_FLT_FUNC(erf (M1));
+  if (!strcmp (op, "sinh"))   S_FLT_FUNC(sinh (M1));
+  if (!strcmp (op, "cosh"))   S_FLT_FUNC(cosh (M1));
+  if (!strcmp (op, "asinh"))  S_FLT_FUNC(asinh (M1));
+  if (!strcmp (op, "acosh"))  S_FLT_FUNC(acosh (M1));
+  if (!strcmp (op, "lgamma")) S_FLT_FUNC(lgamma (M1));
+  if (!strcmp (op, "sin"))    S_FLT_FUNC(sin (M1));
+  if (!strcmp (op, "cos"))    S_FLT_FUNC(cos (M1));
+  if (!strcmp (op, "tan"))    S_FLT_FUNC(tan (M1));
+  if (!strcmp (op, "dsin"))   S_FLT_FUNC(sin (M1*RAD_DEG));
+  if (!strcmp (op, "dcos"))   S_FLT_FUNC(cos (M1*RAD_DEG));
+  if (!strcmp (op, "dtan"))   S_FLT_FUNC(tan (M1*RAD_DEG));
+  if (!strcmp (op, "asin"))   S_FLT_FUNC(asin (M1));
+  if (!strcmp (op, "acos"))   S_FLT_FUNC(acos (M1));
+  if (!strcmp (op, "atan"))   S_FLT_FUNC(atan (M1));
+  if (!strcmp (op, "dasin"))  S_FLT_FUNC(asin (M1)*DEG_RAD);
+  if (!strcmp (op, "dacos"))  S_FLT_FUNC(acos (M1)*DEG_RAD);
+  if (!strcmp (op, "datan"))  S_FLT_FUNC(atan (M1)*DEG_RAD);
+  if (!strcmp (op, "rnd"))    S_FLT_FUNC(M1*0.0 + drand48());
+  if (!strcmp (op, "not"))    S_INT_FUNC(!(M1));
+  if (!strcmp (op, "--"))     S_INT_FUNC(- (M1));
+  if (!strcmp (op, "isinf"))  S_FLT_FUNC(!finite(M1));
+  if (!strcmp (op, "isnan"))  S_FLT_FUNC(isnan(M1));
 
   return (OUT);
Index: /trunk/Ohana/src/opihi/lib.shell/stack_math.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/stack_math.c	(revision 40018)
+++ /trunk/Ohana/src/opihi/lib.shell/stack_math.c	(revision 40019)
@@ -1226,5 +1226,5 @@
   if (!strcmp (op, "--"))     S_FUNC(-1*M1, ST_SCALAR_INT); // NOTE: opihi_int is signed, 
   if (!strcmp (op, "isinf"))  S_FUNC(!finite(M1), ST_SCALAR_FLT); // XXX modify in future 
-  if (!strcmp (op, "isnan"))  S_FUNC(isnan(M1), ST_SCALAR_FLT); // XXX modify in future   
+  if (!strcmp (op, "isnan"))  S_FUNC(isnan((opihi_flt)(M1)), ST_SCALAR_FLT); // XXX modify in future   
 
 # undef S_FUNC
@@ -1313,5 +1313,5 @@
   if (!strcmp (op, "--"))     V_FUNC(-1*(*M1), ST_SCALAR_INT); // NOTE: opihi_int is signed
   if (!strcmp (op, "isinf"))  V_FUNC(!finite(*M1), ST_SCALAR_FLT);
-  if (!strcmp (op, "isnan"))  V_FUNC(isnan(*M1), ST_SCALAR_FLT);
+  if (!strcmp (op, "isnan"))  V_FUNC(isnan((opihi_flt)(*M1)), ST_SCALAR_FLT);
   if (!strcmp (op, "xramp"))  V_FUNC(i, ST_SCALAR_INT);
   if (!strcmp (op, "yramp"))  V_FUNC(0, ST_SCALAR_INT);
Index: /trunk/Ohana/src/relphot/src/StarOps.c
===================================================================
--- /trunk/Ohana/src/relphot/src/StarOps.c	(revision 40018)
+++ /trunk/Ohana/src/relphot/src/StarOps.c	(revision 40019)
@@ -948,5 +948,5 @@
 	xlist[N] = catalog[i].secfilt[Nsecfilt*j+Nsec].M;
 	value    = catalog[i].secfilt[Nsecfilt*j+Nsec].Mchisq;
-	if (isnan(value)) continue;
+	if (isnan((double)(value))) continue;
 	ylist[N] = value;
 	N++;
Index: /trunk/Ohana/src/uniphot/src/update_catalog_setposangle.c
===================================================================
--- /trunk/Ohana/src/uniphot/src/update_catalog_setposangle.c	(revision 40018)
+++ /trunk/Ohana/src/uniphot/src/update_catalog_setposangle.c	(revision 40019)
@@ -35,5 +35,5 @@
       catalog[0].measure[m].posangle = ToShortDegrees(posAngle);
       catalog[0].measure[m].pltscale = pltScale;
-      myAssert(isfinite(catalog[0].measure[m].posangle), "oops: setposangle made a nan");
+      // myAssert(isfinite(catalog[0].measure[m].posangle), "oops: setposangle made a nan");
       myAssert(isfinite(catalog[0].measure[m].pltscale), "oops: setposangle made a nan");
       found ++;
