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


Ignore:
Timestamp:
Jun 27, 2010, 4:57:36 PM (15 years ago)
Author:
ansari
Message:

Corrections diverses, Reza 27/06/2010

File:
1 edited

Legend:

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

    r3788 r3789  
    33    R. Ansari , C. Magneville - Juin 2010
    44
    5   Usage: applobe In3DPPFName Out3DPPFName
     5  Usage: applobe In3DPPFName Out3DPPFName [ResmapleFactor=0.5,0.333...] [TargetBeamArcmin]
    66---------------------------------------------------------------  */
    77
     
    5050
    5151  if (narg < 3) {
    52     cout << "Usage: applobe In3DPPFName Out3DPPFName \n" << endl;
     52    cout << "Usage: applobe In3DPPFName Out3DPPFName [ResmapleFactor=0.5,0.333...] [TargetBeamArcmin]\n" << endl;
    5353    return 1;
    5454  }
     
    5757  string outname = arg[2];
    5858  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;
     64  }
     65  bool fgcorrbeam=false;
     66  double tbeamarcmin=15.;
     67  if (narg>4) {
     68    tbeamarcmin=atof(arg[4]);
     69    if (tbeamarcmin>1.e-3)  fgcorrbeam=true;
     70  }
     71
    5972  int rc = 91;
    6073
     
    88101    conv.setFrequency(Freq0MHz);
    89102    double lambda = conv.getLambda();
    90     Four2DResponse fresp(2, InterfArrayDiametre/lambda, InterfArrayDiametre/lambda);
     103    Four2DResponse fresp(2, InterfArrayDiametre/lambda, InterfArrayDiametre/lambda, lambda);   
    91104    BeamEffect beam(fresp);
    92105
    93     cout << "applobe[3]: calling ApplyLobe3D() ... " << endl;
    94     beam.ApplyLobe3D(incube, dx, dy, Freq0MHz, dfreq);
     106    if (fgcorrbeam) {
     107      double DoL = 1.22/ArcminToRadian(tbeamarcmin);
     108      Four2DResponse tbeam(2, DoL, DoL );
     109      cout << "applobe[3]: calling Correct2RefLobe() with target beam:" << tbeamarcmin
     110           << " arcmin -> D/Lambda=" << DoL << endl;
     111      beam.Correct2RefLobe(tbeam, incube, dx, dy, Freq0MHz, dfreq);
     112    }
     113    else {
     114      cout << "applobe[3]: calling ApplyLobe3D() ... " << endl;
     115      beam.ApplyLobe3D(incube, dx, dy, Freq0MHz, dfreq);
     116    }
     117    TArray< r_4 > outcube;
     118    if (fgresample) {
     119      cout << "applobe[4]: calling ReSample(incube," << fresamp << "," << ",1.) ... " << endl;
     120      outcube.Share(beam.ReSample(incube, fresamp, fresamp, 1.));
     121    }
     122    else outcube.Share(incube);
    95123
    96     cout << "applobe[4]: calling ReSample(incube, 0.5, 0.5, 1.) ... " << endl;
    97     TArray< r_4 > outcube = beam.ReSample(incube, 0.5, 0.5, 1.);
    98    
    99124    outcube.Show();
    100125    MeanSigma(outcube, mean, sigma);
Note: See TracChangeset for help on using the changeset viewer.