Changeset 7179 for trunk


Ignore:
Timestamp:
07/11/05 10:34:49 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7178 r7179  
    2121
    2222                                                 -*-*- END OF LINE -*-*-
     23
     24 2005/07/11 Thomas Bretz
     25
     26   * callisto.cc, ganymed.cc, mars.cc, showlog.cc,
     27     showplot.cc, sponde.cc, mimage/MImgCleanStd.cc:
     28     - fixed some typos
     29
     30   * mastro/MAstro.[h,cc]:
     31     - added new member function GetStringDeg and GetStringHor
     32
     33   * mastro/MAstroCatalog.cc:
     34     - don't display empty ":  " in tooltip for sources without name
     35
     36   * mbase/MParContainer.cc, mbase/MTask.cc:
     37     - fixed usage of a ?:-operator
     38
     39   * mbase/MString.h:
     40     - added two new constructors
     41
     42   * mjobs/MDataSet.cc:
     43     - made sure that all files read later are sorted correctly.
     44       This is necessary to ensure correct reading of subsystem
     45       data.
     46     - skipped adding a sequence twice
     47
     48     - print effective on time only in debug mode
     49     
     50   * mjobs/MSequence.cc:
     51     - skipped adding a run twice
     52
     53   * mpointing/MSrcPosCalc.cc:
     54     - reformatted the comments
     55     - add MTime and MPointingPos to branch list
     56     - fTime and fObservatory are now presearched in PreProcess
     57       to allow usage in macros having no RunHeaders (if they are
     58       not found no warning is printed!)
     59     - added sanity checks for these pointers in Process
     60
     61
    2362
    2463 2005/07/08 Thomas Bretz
  • trunk/MagicSoft/Mars/NEWS

    r7177 r7179  
    1616
    1717   - general: MHillas - the case of CorrXY==0 is now handled properly
     18
     19   - general: Runs in sequences and datasets are now automatically
     20     ordered (it is assumed that the order of their filenames correctly
     21     represents the order of observations) to ensure correct reading
     22     of the subsystem data
     23
     24   - general: Runs cannot be added to a sequence twice anymore. Also
     25     Sequences cannot be added twice anymore to a dataset.
    1826
    1927   - showplot: got a new option to start a root interpreter, too
  • trunk/MagicSoft/Mars/callisto.cc

    r7125 r7179  
    4646    gLog << " callisto [-c] [-y] [options] sequence.txt" << endl << endl;
    4747    gLog << " Arguments:" << endl;
    48     gLog << "   sequence.txt:             Ascii file defining a sequence of runs" << endl;
     48    gLog << "   sequence.txt:             ASCII file defining a sequence of runs" << endl;
    4949    gLog << "                             For more details see MSequence" << endl;
    5050    gLog << " Root Options:" << endl;
     
    9494    gLog << " is used." << endl << endl;
    9595    gLog << " Using  --iny=,  --outc=,  --outy=,  --out=  or --path= automatically" << endl;
    96     gLog << " enables the corresponmding modes.  In this case  -c/-y are obsolete." << endl << endl;
     96    gLog << " enables the corresponding modes.  In this case  -c/-y are obsolete." << endl << endl;
    9797    gLog << "Description:" << endl;
    9898    gLog << " callisto will calculate pedestals  from  pedestal-files defined in a" << endl;
    9999    gLog << " sequence-file.  This pedestals are used to calculate the calibration" << endl;
    100     gLog << " contants. These constants are stored in a so called calibration-file" << endl;
     100    gLog << " constants. These constants are stored in a so called calibration-file" << endl;
    101101    gLog << " together with some datacheck plots  which can be viewed using either" << endl;
    102102    gLog << " showplot or MStatusDisplay in the interpreter.  A description  of  a" << endl;
     
    111111    gLog << " Jupiter at a mean distance of 1,883,000km. Its mass is 1.1e23 kg. It" << endl;
    112112    gLog << " takes Callisto  16.7 days to orbit  Jupiter  in a synchronous orbit." << endl;
    113     gLog << " Jupiter's moon Callisto was discovered independantly by  Galileo and" << endl;
     113    gLog << " Jupiter's moon Callisto was discovered independently by  Galileo and" << endl;
    114114    gLog << " S.Marius in 1610." << endl << endl;
    115115    gLog << "Example:" << endl;
  • trunk/MagicSoft/Mars/ganymed.cc

    r7134 r7179  
    4343    gLog << " ganymed [options] sequences.txt" << endl << endl;
    4444    gLog << " Arguments:" << endl;
    45     gLog << "   dataset.txt:              Ascii file defining a collection of sequences" << endl;
     45    gLog << "   dataset.txt:              ASCII file defining a collection of sequences" << endl;
    4646    gLog << "                             For more details see MDataSet." << endl;
    4747    gLog << " Root Options:" << endl;
     
    142142    if (arg.GetNumOptions()>0)
    143143    {
    144         gLog << warn << "WARNING - Unknown commandline options..." << endl;
     144        gLog << warn << "WARNING - Unknown command-line options..." << endl;
    145145        arg.Print("options");
    146146        gLog << endl;
     
    158158
    159159    //
    160     // Setup sequence file and check for its existance
     160    // Setup sequence file and check for its existence
    161161    //
    162162    const TString kSequences = arg.GetArgumentStr(0);
  • trunk/MagicSoft/Mars/mars.cc

    r7135 r7179  
    2323//    MARS main program 
    2424//
    25 //    The only job of the main program is the initialisation of ROOT and
    26 //    the start of the guiinterface for the mars program
     25//    The only job of the main program is the initialization of ROOT and
     26//    the start of the GUI interface for the mars program
    2727//
    2828//    started by  h. kornmayer      january, 3rd  2001
     
    6868
    6969    //
    70     // This is to make argv[i] more readable insidethe code
     70    // This is to make argv[i] more readable inside the code
    7171    //
    7272    const TString kFilename = arg.GetArgumentStr(0);
     
    7878
    7979    //
    80     // initialise ROOT
     80    // initialize ROOT
    8181    //
    8282    TApplication app("mars", &argc, argv);
     
    8888
    8989    //
    90     // Swtich of TObjectStreamer in our base classes derived from TObject
     90    // Switch of TObject Streamer in our base classes derived from TObject
    9191    //
    9292    MArray::Class()->IgnoreTObjectStreamer();
  • trunk/MagicSoft/Mars/mastro/MAstro.cc

    r6277 r7179  
    3636
    3737#include "MTime.h"    // MTime::GetGmst
     38#include "MString.h"
    3839
    3940#include "MAstroCatalog.h" // FIXME: replace by MVector3!
     
    191192{
    192193    Day2Hm(h/24, sgn, deg, min);
     194}
     195
     196TString MAstro::GetStringDeg(Double_t deg, const char *fmt)
     197{
     198    Char_t sgn;
     199    UShort_t d, m, s;
     200    Deg2Dms(deg, sgn, d, m, s);
     201
     202    MString str;
     203    str.Print(fmt, sgn, d, m ,s);
     204    return str;
     205}
     206
     207TString MAstro::GetStringHor(Double_t deg, const char *fmt)
     208{
     209    Char_t sgn;
     210    UShort_t h, m, s;
     211    Hor2Hms(deg, sgn, h, m, s);
     212
     213    MString str;
     214    str.Print(fmt, sgn, h, m ,s);
     215    return str;
    193216}
    194217
  • trunk/MagicSoft/Mars/mastro/MAstro.h

    r6277 r7179  
    4545    static void Hor2Hm(Double_t rad, Char_t &sgn, UShort_t &hor, Double_t &min);
    4646
     47    // Print funtions
     48    static TString GetStringDeg(Double_t deg, const char *fmt="%c%d:%02d:%02d");
     49    static TString GetStringHor(Double_t deg, const char *fmt="%c%d:%02d:%02d");
     50
    4751    // Angle treatment functions
    4852    static Bool_t  String2Angle(TString &str, Double_t &ret);
  • trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc

    r4977 r7179  
    733733    const Double_t mag = -2.5*log10(v.Mag());
    734734
    735     MString str;
    736     str.Print("%s:  Ra=%.2fh  Dec=%.1fd  Mag=%.1f", v.GetName(), ra, dec, mag);
     735    TString str(v.GetName());
     736    if (!str.IsNull())
     737        str += ":  ";
     738    str += MString::Form("Ra=%.2fh  Dec=%.1fd  Mag=%.1f", ra, dec, mag);
    737739    if (txt)
    738740    {
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r6949 r7179  
    229229    // point to a random memory segment, because the TString has gone.
    230230    //
    231     MString desc;
    232     desc.Print("%s [%s]", o.GetName(), o.ClassName());
    233     return (TString)o.GetName()==o.ClassName() ? o.ClassName() : desc;
     231    return (TString)o.GetName()==o.ClassName() ? (TString)o.ClassName() :
     232        MString::Form("%s [%s]", o.GetName(), o.ClassName());
    234233}
    235234
  • trunk/MagicSoft/Mars/mbase/MString.h

    r5713 r7179  
    1212{
    1313public:
     14    MString(const char *txt=0)  : TString(txt) { }
     15    MString(const TString &txt) : TString(txt) { }
     16
    1417    MString &Print(const char *fmt, va_list &ap);
    1518    MString &Print(const char *fmt, ...);
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r7091 r7179  
    356356    //
    357357    if (fName==ClassName())
    358         return fSerialNumber==0 ? ClassName() : MString::Form("%s;%d", ClassName(), fSerialNumber);
     358        return fSerialNumber==0 ? (TString)ClassName() : MString::Form("%s;%d", ClassName(), fSerialNumber);
    359359
    360360    return fSerialNumber>0 ?
    361361        MString::Form("%s;%d [%s]", fName.Data(), fSerialNumber, ClassName()) :
    362         MString::Form("%s [%s]", fName.Data(), ClassName());
     362        MString::Form("%s [%s]",    fName.Data(), ClassName());
    363363}
    364364
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc

    r6855 r7179  
    3939// In both cases, the possibility to have a camera with pixels of
    4040// different area is taken into account.
    41 // The too noisy pixels can be recognized and eventally switched off
     41// The too noisy pixels can be recognized and eventually switched off
    4242// (Unmap: set blind pixels to UNUSED) separately, using the
    4343// MBlindPixelCalc Class. In the MBlindPixelCalc class there is also the
     
    170170// ===================
    171171// You use this cleaning method when you want to compare the number of
    172 // photo-electons of each pixel with the average pedestal RMS of the
     172// photo-electrons of each pixel with the average pedestal RMS of the
    173173// inner pixels (for the MAGIC camera they are the smaller ones):
    174174//Begin_Html
     
    259259// informations of the boundary part of the shower only on the first
    260260// neighbors of the CORE pixels.
    261 // There is the possibility now to look not only at the firs neighbors
     261// There is the possibility now to look not only at the first neighbors
    262262// (first ring),but also further away, around the CORE pixels. All the new
    263263// pixels you can find with this method, are tested with the second level
     
    511511//  Look for the boundary pixels around the core pixels
    512512//  if a pixel has more than 2.5 (clean level 2.5) sigma, and
    513 //  a core neigbor, it is declared as used.
     513//  a core neighbor, it is declared as used.
    514514//
    515515void MImgCleanStd::CleanStep3()
     
    744744// --------------------------------------------------------------------------
    745745//
    746 //  Process the GUI Events comming from the two text entry fields.
     746//  Process the GUI Events coming from the two text entry fields.
    747747//
    748748Bool_t MImgCleanStd::ProcessMessage(Int_t msg, Int_t submsg, Long_t param1, Long_t param2)
  • trunk/MagicSoft/Mars/mjobs/MDataSet.cc

    r7170 r7179  
    4949//
    5050// The sequence number are used to concatenate the filenames of the
    51 // sequences using the file structure used in the datacenter.
     51// sequences using the file structure used in the datacenter. Each sequence
     52// can be added to the on and off data at the same time but only once.
    5253//
    5354// If you have different file names you can overwrite the default file names
     
    6061//
    6162// Resource file entries are case sensitive!
     63//
     64// IMPORTANT:
     65//   * Run filenames must begin with a string which allows correct
     66//     ordering in time, otherwise synchronization might fail.
     67//   * Sequence filenames should also have names allowing to order them
     68//     in time, but it is not necessary.
    6269//
    6370// MISSING (27/01/04): The default name and paths cannot be used yet, because
     
    9097// --------------------------------------------------------------------------
    9198//
    92 // Copy the run numbers from the TString runs into the TArrayI data
     99// Copy the sequence numbers from the TString runs into the TArrayI data
     100// Sequences which are twice in the list are only added once. In this case
     101// a warning is emitted.
    93102//
    94103void MDataSet::Split(TString &runs, TArrayI &data) const
     
    103112        TString num = runs(regexp);
    104113
    105         const Int_t n = data.GetSize();
     114        const Int_t seq = atoi(num.Data());
     115        const Int_t n   = data.GetSize();
     116
     117        // skip already existing entries
     118        int i;
     119        for (i=0; i<n; i++)
     120            if (data[i] == seq)
     121                break;
     122
     123        if (i<n)
     124        {
     125            *fLog << warn << "WARNING - Sequence #" << seq << " alraedy in list... skipped." << endl;
     126            continue;
     127        }
     128
     129        // set new entry
    106130        data.Set(n+1);
    107         data[n] = atoi(num.Data());
    108 
     131        data[n] = seq;
     132
     133        // remove entry from string
    109134        runs.Remove(0, runs.First(num)+num.Length());
    110135    }
    111136}
    112137
     138// --------------------------------------------------------------------------
     139//
     140// After resolving the sequence filename and directory either from the
     141// default (/magic/data/sequences/0004/sequence00004000.txt) or from
     142// the corresponding entries in the dataset file.
     143// The entries are sorted by filename.
     144//
    113145void MDataSet::ResolveSequences(TEnv &env, const TArrayI &num, TList &list) const
    114146{
     
    235267}
    236268
     269// --------------------------------------------------------------------------
     270//
     271// Adds all sequences contained in list to the MDirIter. After adding
     272// everything MDirIter::Sort is called to sort all entries by name.
     273//
    237274Bool_t MDataSet::AddSequencesFromList(const TList &list, MDirIter &files)
    238275{
     
    251288        seq.SetupDatRuns(files, MSequence::kImages, dir.IsNull() ? 0 : dir.Data());
    252289    }
     290
     291    // This is important in case of synchronisation, because the
     292    // files in the sequences can be interleaved (eg W1, W2)
     293    // Filenames MUST begin with an appropriate string which allow
     294    // to order them correctly in time!
     295    files.Sort();
    253296
    254297    if (gLog.GetDebugLevel()>4)
  • trunk/MagicSoft/Mars/mjobs/MSequence.cc

    r6964 r7179  
    3131//
    3232//  A sequence is a collection of runs which should be used together.
     33//  Any run can be contained only once.
    3334//
    3435//  Here is an example how a file describing a sequence could look like:
     
    152153// --------------------------------------------------------------------------
    153154//
    154 // Copy the run numbers from the TString runs into the TArrayI data
     155// Copy the run numbers from the TString runs into the TArrayI data.
     156// Runs which are twice in the list are only added once. In this case
     157// a warning is emitted.
    155158//
    156159void MSequence::Split(TString &runs, TArrayI &data) const
     
    165168        TString num = runs(regexp);
    166169
    167         const Int_t n = data.GetSize();
     170        const Int_t run = atoi(num.Data());
     171        const Int_t n   = data.GetSize();
     172
     173        // skip already existing entries
     174        int i;
     175        for (i=0; i<n; i++)
     176            if (data[i] == run)
     177                break;
     178
     179        if (i<n)
     180        {
     181            *fLog << warn << "WARNING - Run #" << run << " alraedy in list... skipped." << endl;
     182            continue;
     183        }
     184
     185        // set new entry
    168186        data.Set(n+1);
    169         data[n] = atoi(num.Data());
     187        data[n] = run;
    170188
    171189        runs.Remove(0, runs.First(num)+num.Length());
    172190    }
    173191}
    174 /*
    175 UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw) const
    176 {
    177     TString d(path);
    178 
    179     // Setup path
    180     if (d.IsNull())
    181     {
    182         d = GetStandardPath();
    183         d += raw ? "rawfiles/" : "merpp/";
    184         d += fNight.GetStringFmt("%Y/%m/%d");
    185     }
    186     else
    187         gSystem->ExpandPathName(d);
    188 
    189     for (int i=0; i<arr.GetSize(); i++)
    190     {
    191         // R. DeLosReyes and T. Bretz
    192         // Changes to read the DAQ numbering format. Changes takes place
    193         // between runs 35487 and 00035488 (2004_08_30)
    194         const char *fmt = arr[i]>35487 ? "%08d_%s_*_E" : "%05d_%s_*_E";
    195 
    196         TString n;
    197 
    198         // Create file name
    199         n =  fNight.GetStringFmt("%Y%m%d_");
    200         n += Form(fmt, arr[i], id);
    201         n += raw ? ".raw" : ".root";
    202 
    203         // Add Path/File to TIter
    204         iter.AddDirectory(d, n, 0);
    205     }
    206 
    207     return iter.GetNumEntries();
    208 }
    209 */
     192
    210193UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, FileType_t type, const char *path) const
    211194{
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc

    r7028 r7179  
    1919!   Author(s): Abelardo Moralejo 1/2005 <mailto:moralejo@pd.infn.it>
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2004
     21!   Copyright: MAGIC Software Development, 2000-2005
    2222!
    2323!
     
    2828// MSrcPosCalc
    2929//
    30 // Calculate the current source position in the camera from the (possibly already
    31 // corrected, by starguider) J2000 sky coordinates of the camera center (contained
    32 // in MPointingPos), and the source J2000 sky coordinates contained in MSourcePos
    33 // (of type MPointingPos as well). If no MSourcePos is found in the parameter list,
    34 // source position is assumed to be the same for all events, that specified in
    35 // MSrcPosCam (if it already existed in the parameter list), or (0,0), the center
    36 // of the camera, if no MSrcPosCam was present in the parameter list. In both cases,
    37 // no calculation is necessary and then the PreProcess returns kSKIP so that the task
    38 // is removed from the task list.
    39 //
    40 // The conversion factor between the camera plain (mm) and the
    41 // sky (deg) is taken from MGeomCam. The time is taken from MTime, and the coordinates
    42 // of the observatory from MObservatory.
    43 //
     30// Calculate the current source position in the camera from the (possibly
     31// already corrected, by starguider) J2000 sky coordinates of the camera
     32// center (contained in MPointingPos), and the source J2000 sky
     33// coordinates contained in MSourcePos (of type MPointingPos as well). If
     34// no MSourcePos is found in the parameter list,  source position is
     35// assumed to be the same for all events, that specified in  MSrcPosCam
     36// (if it already existed in the parameter list), or (0,0), the center  of
     37// the camera, if no MSrcPosCam was present in the parameter list. In both
     38// cases, no calculation is necessary and then the PreProcess returns
     39// kSKIP so that the task is removed from the task list.
     40//
     41// The conversion factor between the camera plain (mm) and the sky (deg)
     42// is taken from MGeomCam. The time is taken from MTime, and the
     43// coordinates of the observatory from MObservatory.
     44//
    4445// Input Container:
    4546//   MPointingPos
     
    5354//
    5455// To be done:
    55 //   - wobble mode missing   /// NOTE, A. Moralejo: I see no need for special code
    56 //
    5756//   - a switch between using sky-coordinates and time or local-coordinates
    5857//     from MPointingPos for determine the rotation angle
     
    9897    fName  = name  ? name  : "MSrcPosCalc";
    9998    fTitle = title ? title : "Calculates the source position in the camera";
     99
     100    AddToBranchList("MTime.*");
     101    AddToBranchList("MPointingPos.*");
    100102}
    101103
     
    191193    //*fLog << "Pointing Position: " << GetRaDec(*fPointPos)  << endl;
    192194    *fLog << "Source Position: " << GetRaDec(*fSourcePos) << endl;
     195
     196    // For the case ReInit is never called we try:
     197    fObservatory = (MObservatory*)pList->FindObject("MObservatory");
     198    fTime        = (MTime*)       pList->FindObject("MTime");
     199    fRunType     = MRawRunHeader::kRTNone;
    193200
    194201    return kTRUE;
     
    321328Int_t MSrcPosCalc::Process()
    322329{
    323     if (fRunType==MRawRunHeader::kRTMonteCarlo || !fSourcePos)
     330    if (fRunType==MRawRunHeader::kRTMonteCarlo || !fSourcePos || !fTime || !fObservatory)
    324331        return kTRUE;
    325332
    326   //     *fLog << dbg << "Camera center : Zd=" << fPointPos->GetZd() << " Az=" << fPointPos->GetAz() << endl;
    327   //     *fLog << dbg << "Camera center : RA=" << fPointPos->GetRa() << " Dec=" << fPointPos->GetDec() << endl;
    328   //     *fLog << dbg << "MJD: " << fTime->GetMjd() << ", time [ms]: " << fTime->GetTime() << endl;
    329 
    330   MVector3 pos, pos0;  // pos: source position;  pos0: camera center
    331 
    332   if (fSourcePos)
    333     {
    334       // Set Sky coordinates of source, taken from container "MSourcePos" of type MPointingPos. The sky
    335       // coordinates must be J2000, as the sky coordinates of the camera center that we get from the container
    336       // "MPointingPos" filled by the Drive.
    337 
    338       pos.SetRaDec(fSourcePos->GetRaRad(), fSourcePos->GetDecRad());
    339 
    340       //        *fLog << dbg << "Sky position of source: Ra=" << fSourcePos->GetRa() <<
    341       //          " Dec=" << fSourcePos->GetDec() << endl;
    342     }
    343 
    344   // Convert sky coordinates of source to local coordinates. Warning! These are not the "true" local
    345   // coordinates, since this transformation ignores precession and nutation effects.
    346   const MAstroSky2Local conv(*fTime, *fObservatory);
    347   pos *= conv;
    348 
    349 
    350   // Set sky coordinates of camera center in pos0, and then convert to local. Same comment as above. These
    351   // coordinates differ from the true local coordinates of the camera center that one could get from
    352   // "MPointingPos", calculated by the Drive: the reason is that the Drive takes into account precession
    353   // and nutation corrections, while MAstroSky2Local (as of Jan 27 2005 at least) does not. Since we just
    354   // want to get the source position on the camera from the local coordinates of the center and the source,
    355   // it does not matter that the coordinates contained in pos and pos0 ignore precession and nutation...
    356   // since the shift would be the same in both cases. What would be wrong is to set in pos0 directly the
    357   // local coordinates found in MPointingPos!
    358 
    359   pos0.SetRaDec(fPointPos->GetRaRad(), fPointPos->GetDecRad());
    360   pos0 *= conv;
    361 
    362   //     *fLog << dbg << "From MAstroSky2Local, without precession and nutation corrections:" << endl;
    363   //     *fLog << dbg << "- Camera center (2) from RA,dec and time : Zd=" << pos0.Theta()*180./TMath::Pi()
    364   //      << " Az=" << pos0.Phi()*180./TMath::Pi() << endl;
    365   //     *fLog << dbg << "- Local position of source: Zd=" << pos.Theta()*TMath::RadToDeg() << " Az=" << pos.Phi()*TMath::RadToDeg() << endl;
    366 
    367 
    368   // Calculate source position in camera, and convert to mm:
    369   TVector2 v = CalcXYinCamera(pos0, pos)*fGeom->GetCameraDist()*1000;
    370   SetSrcPos(v);
    371 
    372   //     v *= fGeom->GetConvMm2Deg();
    373   //     *fLog << dbg << "X=" << v.X() << " deg,  Y=" << v.Y() << " deg" << endl;
    374   //     *fLog << *fTime << endl;
    375   //     *fLog << endl;
    376 
    377   return kTRUE;
     333    // Set Sky coordinates of source, taken from container "MSourcePos"
     334    // of type MPointingPos. The sky coordinates must be J2000, as the
     335    // sky coordinates of the camera center that we get from the container
     336    // "MPointingPos" filled by the Drive.
     337    MVector3 pos;  // pos: source position
     338    pos.SetRaDec(fSourcePos->GetRaRad(), fSourcePos->GetDecRad());
     339
     340    // Convert sky coordinates of source to local coordinates. Warning! These are not the "true" local
     341    // coordinates, since this transformation ignores precession and nutation effects.
     342    const MAstroSky2Local conv(*fTime, *fObservatory);
     343    pos *= conv;
     344
     345    // Set sky coordinates of camera center in pos0, and then convert to
     346    // local. Same comment as above. These coordinates differ from the true
     347    // local coordinates of the camera center that one could get from
     348    // "MPointingPos", calculated by the Drive: the reason is that the Drive
     349    // takes into account precession and nutation corrections, while
     350    // MAstroSky2Local (as of Jan 27 2005 at least) does not. Since we just
     351    // want to get the source position on the camera from the local
     352    // coordinates of the center and the source, it does not matter that
     353    // the coordinates contained in pos and pos0 ignore precession and
     354    // nutation... since the shift would be the same in both cases. What
     355    // would be wrong is to set in pos0 directly the local coordinates
     356    // found in MPointingPos!
     357    MVector3 pos0;  // pos0: camera center
     358    pos0.SetRaDec(fPointPos->GetRaRad(), fPointPos->GetDecRad());
     359    pos0 *= conv;
     360
     361    // Calculate source position in camera, and convert to mm:
     362    TVector2 v = CalcXYinCamera(pos0, pos)*fGeom->GetCameraDist()*1000;
     363    SetSrcPos(v);
     364
     365    return kTRUE;
    378366}
    379367
  • trunk/MagicSoft/Mars/showlog.cc

    r7001 r7179  
    2222    gLog << "   -?, -h, --help            This help" << endl;
    2323    gLog << endl;
    24     gLog << " This program converts colored output  made with ansi codes" << endl;
     24    gLog << " This program converts colored output  made with ANSI codes" << endl;
    2525    gLog << " (like it is done by MLog)  and redirected into a file back" << endl;
    2626    gLog << " into colored output." << endl << endl;
    27     gLog << " It cannot be used to get rid of the Ansi codes. To display" << endl;
     27    gLog << " It cannot be used to get rid of the ANSI codes. To display" << endl;
    2828    gLog << " colored output with less use the option -R, eg." << endl;
    2929    gLog << "   less -R logfile.log" << endl << endl;
     
    4545}
    4646
    47 // FIXME: Enhance this tool with a converter to HTMl, etc.
     47// FIXME: Enhance this tool with a converter to HTML, etc.
    4848//        Add option for 'no-colors'
    4949int main(int argc, char **argv)
     
    6666    if (arg.GetNumOptions()>0)
    6767    {
    68         gLog << warn << "WARNING - Unknown commandline options..." << endl;
     68        gLog << warn << "WARNING - Unknown command line options..." << endl;
    6969        arg.Print("options");
    7070        gLog << endl;
  • trunk/MagicSoft/Mars/showplot.cc

    r7176 r7179  
    130130    if (arg.GetNumOptions()>0)
    131131    {
    132         gLog << err << "Unknown commandline options..." << endl;
     132        gLog << err << "Unknown command line options..." << endl;
    133133        arg.Print("options");
    134134        gLog << endl;
  • trunk/MagicSoft/Mars/sponde.cc

    r7091 r7179  
    123123    if (arg.GetNumOptions()>0)
    124124    {
    125         gLog << warn << "WARNING - Unknown commandline options..." << endl;
     125        gLog << warn << "WARNING - Unknown command line options..." << endl;
    126126        arg.Print("options");
    127127        gLog << endl;
     
    139139
    140140    //
    141     // Setup sequence file and check for its existance
     141    // Setup sequence file and check for its existence
    142142    //
    143143    const TString kInfile  = arg.GetArgumentStr(0);
Note: See TracChangeset for help on using the changeset viewer.