Index: /trunk/MagicSoft/Cosy/Changelog
===================================================================
--- /trunk/MagicSoft/Cosy/Changelog	(revision 4356)
+++ /trunk/MagicSoft/Cosy/Changelog	(revision 4357)
@@ -1,3 +1,18 @@
                                                                   -*-*- END -*-*-
+
+ 2004/06/28 - Thomas Bretz
+
+   * caos/Ring.[h,cc]:
+     - added magnitude fMag
+     - added interpolation of magnitude
+
+   * main/MStarguider.cc:
+     - added output of magnitudes
+
+   * tpoint/gui.C:
+     - implemented comment lines
+     - changed layout of output
+
+
 
  2004/06/01 - Thomas Bretz
@@ -39,5 +54,5 @@
 
    * bending_magic.txt:
-     - last calculated pointing model (stil has the hysteresis 
+     - last calculated pointing model (still has the hysteresis 
        problem)
 
Index: /trunk/MagicSoft/Cosy/caos/Ring.cc
===================================================================
--- /trunk/MagicSoft/Cosy/caos/Ring.cc	(revision 4356)
+++ /trunk/MagicSoft/Cosy/caos/Ring.cc	(revision 4357)
@@ -62,4 +62,6 @@
     fR = hypot(fX-leds(i).GetX(), fY-leds(i).GetY());
 
+    fMag = (leds(i).GetMag() + leds(j).GetMag() + leds(k).GetMag())/3;
+
     return kTRUE;
 }
@@ -77,4 +79,6 @@
     fDr=0;
 
+    fMag=0;
+
     if (n<1)
         return;
@@ -84,12 +88,14 @@
         const Ring &ring = rings(i);
 
-        fX += ring.GetX();
-        fY += ring.GetY();
-        fR += ring.GetR();
+        fX +  = ring.GetX();
+        fY   += ring.GetY();
+        fR   += ring.GetR();
+        fMag += ring.GetMag();
     }
 
-    fX /= n;
-    fY /= n;
-    fR /= n;
+    fX   /= n;
+    fY   /= n;
+    fR   /= n;
+    fMag /= n;
 
     if (n<2)
Index: /trunk/MagicSoft/Cosy/caos/Ring.h
===================================================================
--- /trunk/MagicSoft/Cosy/caos/Ring.h	(revision 4356)
+++ /trunk/MagicSoft/Cosy/caos/Ring.h	(revision 4357)
@@ -22,4 +22,6 @@
     Double_t fDphi;
 
+    Double_t fMag;
+
     Double_t sqr(Double_t x) { return x*x; }
 
@@ -39,4 +41,6 @@
     Double_t GetPhi() const { return fPhi; }
 
+    Double_t GetMag() const { return fMag; }
+
     bool CalcCenter(const Leds &leds, Int_t i, Int_t j, Int_t k);
     void InterpolCenters(const Rings &rings);
Index: /trunk/MagicSoft/Cosy/main/MStarguider.cc
===================================================================
--- /trunk/MagicSoft/Cosy/main/MStarguider.cc	(revision 4356)
+++ /trunk/MagicSoft/Cosy/main/MStarguider.cc	(revision 4357)
@@ -904,5 +904,5 @@
     // Check wheter star found
     Led *star = (Led*)leds.At(0);
-    if (!star)
+    if (!star || leds.GetEntries()<1)
         return;
 
@@ -993,4 +993,6 @@
     *fOutTp << " " << -dzd << " " << -daz;
     *fOutTp << " " << setprecision(11) << t.GetMjd();
+    *fOutTp << " " << setprecision(4) << center.GetMag();
+    *fOutTp << " " << star->GetMag();
     *fOutTp << endl;
 
Index: /trunk/MagicSoft/Cosy/tpoint/gui.C
===================================================================
--- /trunk/MagicSoft/Cosy/tpoint/gui.C	(revision 4356)
+++ /trunk/MagicSoft/Cosy/tpoint/gui.C	(revision 4357)
@@ -142,5 +142,10 @@
 {
     TString str;
-    str.ReadLine(fin);
+    do
+    {
+        str.ReadLine(fin);
+        if (!fin)
+            return fin;
+    } while (str[0]=='#');
 
     Float_t v[4];
@@ -577,4 +582,6 @@
         gdaz.SetMinimum(-absmax1);
         gdzd.SetMinimum(-absmax2);
+        graz.SetMinimum(0);
+        grzd.SetMinimum(0);
 
         c1=new TCanvas("CanvGraphs", "Graphs");
@@ -583,4 +590,5 @@
         TLine line;
         line.SetLineColor(kGreen);
+        line.SetLineWidth(2);
 
         c1->cd(1);
@@ -660,16 +668,19 @@
         cout << "Total Spread of Residual:" << endl;
         cout << "-------------------------" << endl;
-        cout << "before: " << hres1.GetMean() << " \xb1 " << hres1.GetRMS() << " deg " << endl;
-        cout << "after:  " << hres2.GetMean() << " \xb1 " << hres2.GetRMS() << " deg " << endl;
+        cout << "before: " << Form("%6.4f", hres1.GetMean()) << " \xb1 " << Form("%6.4f", hres1.GetRMS()) << " deg \t";
+        cout << "before: " << Form("%4.1f", hres1.GetMean()*60) << " \xb1 " << Form("%.1f", hres1.GetRMS()*60) << " arcmin" << endl;
+        cout << "after:  " << Form("%6.4f", hres2.GetMean()) << " \xb1 " << Form("%6.4f", hres2.GetRMS()) << " deg \t";
+        cout << "after:  " << Form("%4.1f", hres2.GetMean()*60) << " \xb1 " << Form("%.1f", hres2.GetRMS()*60) << " arcmin" << endl;
+        cout << "backw:  " << Form("%6.4f", hres3.GetMean()) << " \xb1 " << Form("%6.4f", hres3.GetRMS()) << " deg \t";
+        cout << "backw:  " << Form("%4.1f", hres3.GetMean()*60) << " \xb1 " << Form("%.1f", hres3.GetRMS()*60) << " arcmin" << endl;
         cout << endl;
-        cout << "before: " << Form("%.1f", hres1.GetMean()*60) << " \xb1 " << Form("%.1f", hres1.GetRMS()*60) << " arcmin" << endl;
-        cout << "after:  " << Form("%.1f", hres2.GetMean()*60) << " \xb1 " << Form("%.1f", hres2.GetRMS()*60) << " arcmin" << endl;
+        cout << "before: " << Form("%4.1f", hres1.GetMean()*16348/360) << " \xb1 " << Form("%.1f", hres1.GetRMS()*16384/360) << " SE \t\t";
+        cout << "before: " << Form("%4.1f", hres1.GetMean()*60*60/23.4) << " \xb1 " << Form("%.1f", hres1.GetRMS()*60*60/23.4) << " pix" << endl;
+        cout << "after:  " << Form("%4.1f", hres2.GetMean()*16384/360) << " \xb1 " << Form("%.1f", hres2.GetRMS()*16384/360) << " SE \t\t";
+        cout << "after:  " << Form("%4.1f", hres2.GetMean()*60*60/23.4) << " \xb1 " << Form("%.1f", hres2.GetRMS()*60*60/23.4) << " pix" << endl;
+        cout << "backw:  " << Form("%4.1f", hres3.GetMean()*16384/360) << " \xb1 " << Form("%.1f", hres3.GetRMS()*16384/360) << " SE \t\t";
+        cout << "backw:  " << Form("%4.1f", hres3.GetMean()*60*60/23.4) << " \xb1 " << Form("%.1f", hres3.GetRMS()*60*60/23.4) << " pix" << endl;
         cout << endl;
-        cout << "before: " << Form("%.1f", hres1.GetMean()*60*60/23.4) << " \xb1 " << Form("%.1f", hres1.GetRMS()*60*60/23.4) << " pix" << endl;
-        cout << "after:  " << Form("%.1f", hres2.GetMean()*60*60/23.4) << " \xb1 " << Form("%.1f", hres2.GetRMS()*60*60/23.4) << " pix" << endl;
-        cout << "after:  " << Form("%.1f", hres2.GetMean()*16384/360) << " \xb1 " << Form("%.1f", hres2.GetRMS()*16384/360) << " SE" << endl;
-        cout << endl;
-        cout << "backw:  " << Form("%.1f", hres3.GetMean()*60) << " \xb1 " << Form("%.1f", hres3.GetRMS()*60) << " arcmin" << endl;
-        cout << endl;                                            // ±
+        cout << endl; // ±
     
 
@@ -870,11 +881,11 @@
     {
         TGLabel *l1 = (TGLabel*)fLabel.At(3*MBending::GetNumPar()+1);
-        l1->SetText(Form("Before: %.1f +- %.1f SE", before));
+        l1->SetText(Form("Before: %.1f +- %.1f SE", before, 0));
 
         TGLabel *l2 = (TGLabel*)fLabel.At(3*MBending::GetNumPar()+2);
-        l2->SetText(Form("After:  %.1f +- %.1f SE", after));
+        l2->SetText(Form("After:  %.1f +- %.1f SE", after, 0));
 
         TGLabel *l3 = (TGLabel*)fLabel.At(3*MBending::GetNumPar()+3);
-        l3->SetText(Form("Backw:  %.1f +- %.1f SE", backw));
+        l3->SetText(Form("Backw:  %.1f +- %.1f SE", backw, 0));
     }
 
@@ -885,5 +896,5 @@
             gVirtualX->DeleteFont(fFont);
     }
-    MFit() : TGMainFrame(gClient->GetRoot(), 740, 370, kHorizontalFrame)
+    MFit() : TGMainFrame(gClient->GetRoot(), 750, 370, kHorizontalFrame)
     {
         fCoordinates.SetOwner();
