Index: /trunk/Poubelle/archTOI.old/aa_hadec.c
===================================================================
--- /trunk/Poubelle/archTOI.old/aa_hadec.c	(revision 419)
+++ /trunk/Poubelle/archTOI.old/aa_hadec.c	(revision 419)
@@ -0,0 +1,81 @@
+#include <stdio.h>
+#include <math.h>
+#include "aa_hadec.h"
+#define GOODATAN2
+#define PI M_PI
+
+static void aaha_aux (double lat, double x, double y, double* p, double* q);
+
+
+/* given latitude (n+, radians), lat, altitude (up+, radians), alt, and
+ * azimuth (angle round to the east from north+, radians),
+ * return hour angle (radians), ha, and declination (radians), dec.
+ */
+void aa_hadec (double lat, double alt, double az, double* ha, double* dec)
+{
+	aaha_aux (lat, az, alt, ha, dec);
+}
+
+/* given latitude (n+, radians), lat, hour angle (radians), ha, and declination
+ * (radians), dec,
+ * return altitude (up+, radians), alt, and
+ * azimuth (angle round to the east from north+, radians),
+ */
+void hadec_aa (double lat, double ha, double dec, double* alt, double* az)
+{
+	aaha_aux (lat, ha, dec, az, alt);
+}
+
+/* the actual formula is the same for both transformation directions so
+ * do it here once for each way.
+ * N.B. all arguments are in radians.
+ */
+static void
+aaha_aux (double lat, double x, double y, double* p, double* q)
+{
+	static double lastlat = -1000.;
+	static double sinlastlat, coslastlat;
+	double sy, cy;
+	double sx, cx;
+#ifndef GOODATAN2
+	double sq, cq;
+	double a;
+	double cp;
+#endif
+
+	/* latitude doesn't change much, so try to reuse the sin and cos evals.
+	 */
+	if (lat != lastlat) {
+	    sinlastlat = sin (lat);
+	    coslastlat = cos (lat);
+	    lastlat = lat;
+	}
+
+	sy = sin (y);
+	cy = cos (y);
+	sx = sin (x);
+	cx = cos (x);
+
+/* define GOODATAN2 if atan2 returns full range -PI through +PI.
+ */
+#ifdef GOODATAN2
+	*q = asin ((sy*sinlastlat) + (cy*coslastlat*cx));
+	*p = atan2 (-cy*sx, -cy*cx*sinlastlat + sy*coslastlat);
+#else
+#define	EPS	(1e-20)
+	sq = (sy*sinlastlat) + (cy*coslastlat*cx);
+	*q = asin (sq);
+	cq = cos (*q);
+	a = coslastlat*cq;
+	if (a > -EPS && a < EPS)
+	    a = a < 0 ? -EPS : EPS; /* avoid / 0 */
+	cp = (sy - (sinlastlat*sq))/a;
+	if (cp >= 1.0)	/* the /a can be slightly > 1 */
+	    *p = 0.0;
+	else if (cp <= -1.0)
+	    *p = PI;
+	else
+	    *p = acos ((sy - (sinlastlat*sq))/a);
+	if (sx>0) *p = 2.0*PI - *p;
+#endif
+}
Index: /trunk/Poubelle/archTOI.old/aa_hadec.h
===================================================================
--- /trunk/Poubelle/archTOI.old/aa_hadec.h	(revision 419)
+++ /trunk/Poubelle/archTOI.old/aa_hadec.h	(revision 419)
@@ -0,0 +1,4 @@
+void aa_hadec (double lat, double alt, double az, double* ha, double* dec);
+void hadec_aa (double lat, double ha, double dec, double* alt, double* az);
+
+
Index: /trunk/Poubelle/archTOI.old/archeopsfile.cc
===================================================================
--- /trunk/Poubelle/archTOI.old/archeopsfile.cc	(revision 418)
+++ /trunk/Poubelle/archTOI.old/archeopsfile.cc	(revision 419)
@@ -1079,7 +1079,7 @@
 
 
-double ArcheopsFile::getAzimut(int imesure) {return imesure*360/nEchBlock();}
+double ArcheopsFile::getAzimut(int imesure) {return 0;}
 double ArcheopsFile::getPendDirect(int /*imesure*/) {return 0;}
 double ArcheopsFile::getPendOrth(int /*imesure*/) {return 0;}
-double ArcheopsFile::getAlpha(int /*imesure*/) {return 0;}
-double ArcheopsFile::getDelta(int /*imesure*/) {return 0;}
+double ArcheopsFile::getAlphaAxis(int /*imesure*/) {return 0;}
+double ArcheopsFile::getDeltaAxis(int /*imesure*/) {return 0;}
Index: /trunk/Poubelle/archTOI.old/archeopsfile.h
===================================================================
--- /trunk/Poubelle/archTOI.old/archeopsfile.h	(revision 418)
+++ /trunk/Poubelle/archTOI.old/archeopsfile.h	(revision 419)
@@ -168,6 +168,6 @@
   double getPendOrth(int imesure);
   
-  double getAlpha(int imesure);
-  double getDelta(int imesure);
+  double getAlphaAxis(int imesure);
+  double getDeltaAxis(int imesure);
   
   static double decodeMJD(string const& dateString); // sans tenir compte de TU-TLeg
Index: /trunk/Poubelle/archTOI.old/templocator.cc
===================================================================
--- /trunk/Poubelle/archTOI.old/templocator.cc	(revision 419)
+++ /trunk/Poubelle/archTOI.old/templocator.cc	(revision 419)
@@ -0,0 +1,42 @@
+#include "templocator.h"
+#include <math.h>
+extern "C" {
+#include "aa_hadec.h"
+}
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+TempLocator tempLocator;
+
+TempLocator::TempLocator()
+{
+  lon = lat = ts = 0;
+}
+
+void TempLocator::setEarthPos(double lon, double lat) {
+  this->lon = lon;
+  this->lat = lat;
+}
+void TempLocator::setTSid(double ts) {
+  this->ts  = ts;
+}
+  
+double TempLocator::getAlphaZenith() {
+  double ha, dec;
+  aa_hadec (lat * M_PI/180, .5 * M_PI, 0, &ha, &dec);
+  double ra = - (ha * 180. / M_PI / 15) + (ts/3600.);
+  //dec = dec * 180. / M_PI;
+  return ra;
+}
+
+double TempLocator::getDeltaZenith() {
+  double ha, dec;
+  aa_hadec (lat * M_PI/180, .5 * M_PI, 0, &ha, &dec);
+  //double ra = - (ha * 180. / M_PI / 15) + (ts/3600.);
+  dec = dec * 180. / M_PI;
+  return dec;
+}
+
+
Index: /trunk/Poubelle/archTOI.old/templocator.h
===================================================================
--- /trunk/Poubelle/archTOI.old/templocator.h	(revision 419)
+++ /trunk/Poubelle/archTOI.old/templocator.h	(revision 419)
@@ -0,0 +1,26 @@
+// temporaire, positionnement en utilisant la galaxie...
+
+#ifndef TEMPLOCATOR_H
+#define TEMPLOCATOR_H
+
+class TempLocator {
+public:
+  TempLocator();
+
+  void setEarthPos(double lon, double lat);
+  void setTSid(double ts);
+  
+  double getAlphaZenith();
+  double getDeltaZenith();
+  
+
+
+protected:
+  double lon; // degrees  +=EST
+  double lat; // degrees  +=NORD
+  double ts;  // secondes 
+};
+
+extern TempLocator tempLocator;
+
+#endif
Index: /trunk/Poubelle/archTOI.old/toiiter.cc
===================================================================
--- /trunk/Poubelle/archTOI.old/toiiter.cc	(revision 418)
+++ /trunk/Poubelle/archTOI.old/toiiter.cc	(revision 419)
@@ -16,4 +16,5 @@
 #include <dirent.h>
 #include <iostream.h>
+#include "templocator.h"
 
 // Format bloc GPS
@@ -238,6 +239,7 @@
         break;
       case azimut:
-        file->needSSTProcessMask(SSTHandler::findPeriod);
-        trigMask |= block_sst_mask;
+        trigMask |= block_bolo_mask;
+        //file->needSSTProcessMask(SSTHandler::findPeriod);
+        //trigMask |= block_sst_mask;
         break;
       case sstStarCnt:
@@ -270,6 +272,7 @@
       case alphaBolo:
       case deltaBolo:
-        file->needSSTProcessMask(SSTHandler::findAxis);
-        trigMask |= block_sst_mask;
+        trigMask |= block_bolo_mask;
+        //file->needSSTProcessMask(SSTHandler::findAxis);
+        //trigMask |= block_sst_mask;
         break;
       }
@@ -484,5 +487,5 @@
    case alphaAxis:
    case deltaAxis:
-     return false;
+     return true;
      //return (file->lastGPS() != NULL && file->lastSST() != NULL);
    case alphaSst:
@@ -587,9 +590,22 @@
      return tSid.getLST(getMJD());
    case azimut:
-     return file->getAzimut(imes);
    case alphaAxis:
-     return file->getAlpha(imes);
-   case deltaAxis:
-     return file->getDelta(imes);
+   case deltaAxis: {
+        double lat, lon;
+        if (auxGPS) {
+          double alti;
+          auxGPS->getLocation(getMJD(), lat, lon, alti);
+        } else {
+          lon = file->getGPSLong();
+          lat = file->getGPSLat();
+        }
+        tSid.setLongitude(lon);
+        double ts = tSid.getLST(getMJD());
+        tempLocator.setEarthPos(lon, lat);
+        tempLocator.setTSid(ts);
+        if ((kind) == alphaAxis) return tempLocator.getAlphaZenith();
+        if ((kind) == deltaAxis) return tempLocator.getDeltaZenith();
+        return 0;
+     }
    }
    return -1;
Index: /trunk/Poubelle/archTOI.old/toiiter.h
===================================================================
--- /trunk/Poubelle/archTOI.old/toiiter.h	(revision 418)
+++ /trunk/Poubelle/archTOI.old/toiiter.h	(revision 419)
@@ -43,6 +43,6 @@
   gyroSpeed,     // vitesse gyro, deg/s, index = 0,1,2, calibree...
   gpsTime,       // temps fourni par GPS
-  longitude,     // position ballon, degrees
-  latitude,      // position ballon, degrees
+  longitude,     // position ballon, degrees  +=EST
+  latitude,      // position ballon, degrees  +=NORD
   altitude,      // position ballon, m
   tsid,          // temps sideral en secondes
