Changeset 3796 in Sophya for trunk/Cosmo/RadioBeam/applobe.cc


Ignore:
Timestamp:
Jun 29, 2010, 7:26:01 PM (15 years ago)
Author:
ansari
Message:

Suite modif utilisation de reponse calcule (tabulee) de l'interferometre pour soustraction avant-plans, Reza 29/06/2010

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/RadioBeam/applobe.cc

    r3792 r3796  
    33    R. Ansari , C. Magneville - Juin 2010
    44
    5   Usage: applobe In3DPPFName Out3DPPFName [ResmapleFactor=0.5,0.333...] [TargetBeamDoL]
     5  Usage: applobe Diameter/Four2DRespTableFile In3DPPFName Out3DPPFName
     6                 [TargetBeamDoL] [ResmapleFactor=0.5,0.333...]
    67---------------------------------------------------------------  */
    78
     
    5051
    5152  if (narg < 3) {
    52     cout << "Usage: applobe In3DPPFName Out3DPPFName [ResmapleFactor=0.5,0.333...] [TargetBeamDoL]\n" << endl;
     53    cout << "Usage: applobe Diameter/Four2DRespTableFile In3DPPFName Out3DPPFName "
     54         << "             [TargetBeamDoL] [ResmapleFactor=0.5,0.333...] \n" << endl;
    5355    return 1;
    5456  }
    5557
    5658  // decodage arguments
    57   string outname = arg[2];
    58   string inname = arg[1];
    59   bool fgresample=false;
    60   double fresamp=1.;
    61   if (narg>3) {
    62     fresamp=atof(arg[3]);
    63     if ((fabs(fresamp)>1.e-2)&&(fabs(fresamp-1.)>1.e-2))  fgresample=true;
     59  bool fgresptbl=true;
     60  double DIAMETRE=100.;
     61  string resptblname;
     62  if (isdigit(*arg[1])) {
     63    fgresptbl=false;
     64    DIAMETRE=atof(arg[1]);
    6465  }
     66  else resptblname=arg[1];
     67
     68  string inname = arg[2];
     69  string outname = arg[3];
    6570  bool fgcorrbeam=false;
    6671  double tbeamDoL=135;
     
    6873    tbeamDoL=atof(arg[4]);
    6974    if (tbeamDoL>1)  fgcorrbeam=true;
     75  }
     76  bool fgresample=false;
     77  double fresamp=1.;
     78  if (narg>5) {
     79    fresamp=atof(arg[5]);
     80    if ((fabs(fresamp)>1.e-2)&&(fabs(fresamp-1.)>1.e-2))  fgresample=true;
    7081  }
    7182
     
    101112    conv.setFrequency(Freq0MHz);
    102113    double lambda = conv.getLambda();
    103     Four2DResponse fresp(2, InterfArrayDiametre/lambda, InterfArrayDiametre/lambda, lambda);   
    104     BeamEffect beam(fresp);
     114   
     115    Four2DResponse fresp(2, DIAMETRE/lambda, DIAMETRE/lambda, lambda);
     116    Four2DResponse* fresp_p=&fresp;
     117    Four2DRespTable resptbl;
     118    if (fgresptbl) {
     119      cout << "applobe[2.b]: initializing Four2DRespTable from file" << resptblname << endl;
     120      resptbl.readFromPPF(resptblname);
     121      fresp_p=&resptbl;
     122    }
     123    else cout << " applobe[2.b]: Four2DResponse ( Diameter=" << DIAMETRE << " Lambda= " << lambda
     124              << " DoL=" << DIAMETRE/lambda << " ) " << endl;
     125    BeamEffect beam(*fresp_p);
    105126
    106127    if (fgcorrbeam) {
    107128      double DoL = tbeamDoL;
    108129      double tbeamarcmin = RadianToDegree(1.22/DoL)*60.;
    109       Four2DResponse tbeam(2, DoL, DoL );
     130      int typcb = 2;
     131      if (fgresptbl) typcb=22;
     132      Four2DResponse tbeam(typcb, DoL, DoL );
    110133      cout << "applobe[3]: calling Correct2RefLobe() with target beam D/Lambda=" << DoL 
    111            << " -> arcmin " << tbeamarcmin << endl;
     134           << " -> arcmin " << tbeamarcmin << " TypDishResp=" << typcb << endl;
    112135      beam.Correct2RefLobe(tbeam, incube, dx, dy, Freq0MHz, dfreq);
    113136    }
Note: See TracChangeset for help on using the changeset viewer.