Index: /trunk/Ohana/src/addstar/src/find_matches.c
===================================================================
--- /trunk/Ohana/src/addstar/src/find_matches.c	(revision 5286)
+++ /trunk/Ohana/src/addstar/src/find_matches.c	(revision 5287)
@@ -132,5 +132,5 @@
 
       /* calculate accurate per-star airmass */
-      secz = airmass (image[0].secz_PS, stars[N].R, stars[N].D, SiderealTime, Latitude);
+      secz = airmass (image[0].secz_PS, stars[N].R, stars[N].D, image[0].sidtime, image[0].latitude);
       
       /** add measurements for this star **/
@@ -241,5 +241,5 @@
     if (!IN_CATALOG (stars[N].R, stars[N].D)) continue;
 
-    secz = airmass (image[0].secz_PS, stars[N].R, stars[N].D, SiderealTime, Latitude);
+    secz = airmass (image[0].secz_PS, stars[N].R, stars[N].D, image[0].sidtime, image[0].latitude);
 
     catalog[0].average[Nave].R_PS      = stars[N].R;
Index: /trunk/Ohana/src/addstar/src/find_matches_closest.c
===================================================================
--- /trunk/Ohana/src/addstar/src/find_matches_closest.c	(revision 5286)
+++ /trunk/Ohana/src/addstar/src/find_matches_closest.c	(revision 5287)
@@ -148,5 +148,5 @@
 	
     /* calculate accurate per-star airmass, if required */
-    secz = airmass (image[0].secz_PS, stars[N].R, stars[N].D, SiderealTime, Latitude);
+    secz = airmass (image[0].secz_PS, stars[N].R, stars[N].D, image[0].sidtime, image[0].latitude);
       
     /** add measurements for this star **/
@@ -239,5 +239,5 @@
     if (!IN_CATALOG (stars[N].R, stars[N].D)) continue;
 
-    secz = airmass (image[0].secz_PS, stars[N].R, stars[N].D, SiderealTime, Latitude);
+    secz = airmass (image[0].secz_PS, stars[N].R, stars[N].D, image[0].sidtime, image[0].latitude);
 
     catalog[0].average[Nave].R_PS      = stars[N].R;
Index: /trunk/Ohana/src/addstar/src/gstars.c
===================================================================
--- /trunk/Ohana/src/addstar/src/gstars.c	(revision 5286)
+++ /trunk/Ohana/src/addstar/src/gstars.c	(revision 5287)
@@ -6,5 +6,5 @@
   int j, N, Nbytes, extend;
   int itmp, hour, min;
-  char *c, photcode[64], line[80];
+  char *name, *c, photcode[64], line[80];
   double tmp, sec, dMs;
   Stars *stars, *rdstars;
@@ -17,10 +17,7 @@
 
   /* find image rootname */
-  c = strrchr (file, 0x2f);
-  if (c == (char *) NULL) {
-    strcpy (image[0].name, file);
-  } else { 
-    strcpy (image[0].name, (c+1));
-  }
+  name = filebasename (file);
+  strcpy (image[0].name, name);
+  free (name);
 
   /* get astrometry information */
@@ -52,5 +49,6 @@
   for (c = strchr (line, ':'); c != (char *) NULL; c = strchr (line, ':')) { *c = ' '; }
   sscanf (line, "%d %d %lf", &hour, &min, &sec);
-  SiderealTime = hour + min/60.0 + sec/3600.0;
+  image[0].sidtime = hour + min/60.0 + sec/3600.0;
+  image[0].latitude = Latitude;
 
   /* CERROR in data file is in arcsec */
