Changeset 3986 in Sophya for trunk


Ignore:
Timestamp:
May 5, 2011, 7:25:18 PM (14 years ago)
Author:
ansari
Message:

modification rapport maxi a appliquer lors des corrections de beams, Reza 05/05/2011

Location:
trunk/Cosmo/RadioBeam
Files:
8 edited

Legend:

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

    r3973 r3986  
    77    R. Ansari , C. Magneville - Juin 2010
    88
    9 Usage: calcpk2 [-t -g] InMapLSS convFacLSS InMapSync convFacSync InMapRadioSource convFacRsc OutPkFile
     9Usage: calcpk2 [-t -g -mxr val] InMapLSS convFacLSS InMapSync convFacSync InMapRadioSource convFacRsc OutPkFile
    1010               [PixNoiseLevel] [Diameter/Four2DRespTableFile] [TargetBeamArcmin] [NSigSrcThr]
    1111---------------------------------------------------------------  */
     
    4444{
    4545  if ( (narg<6)||((narg>1)&&(strcmp(arg[1],"-h")==0)) ) {
    46     cout << " Usage: [-t -g] calcpk2 InMapLSS convFacLSS InMapFgnd convFacFgnd OutPkFile \n"
     46    cout << " Usage: [-t -g -mxr val] calcpk2 InMapLSS convFacLSS InMapFgnd convFacFgnd OutPkFile \n"
    4747         << "        [PixNoiseLevel] [D_Dish/Four2DRespTableFile CorBeamDiam] \n"
    4848         << "        [NSigSrcThr] [P2/P1] [RecMapFile] " << endl;
    4949    if ((narg>1)&&(strcmp(arg[1],"-h")==0)) {
    5050      cout << "-t -g : Triangular / gaussian beam shape (def=gaussian) \n"
     51           << "-mxr val: Max beam correction factor (default=10.) \n "
    5152           << "- InMapLSS: Input 3D LSS cube (PPF file name) \n "
    5253           << "- convFacLSS: LSS cube conversion factor to mK (milliKelvin) \n"
     
    7879    // decodage argument optionnel
    7980    bool fgoptarg=true;
     81    double maxratio=10.;
    8082    while (fgoptarg) {
    8183      string fbo = arg[1];
    8284      if (fbo=="-t")  { fggaussian=false; arg++; narg--; }
    8385      else if (fbo=="-g")  { fggaussian=true; arg++; narg--; }
     86      else if (fbo=="-mxr")  { arg++; maxratio=atof(arg[1]); arg++; narg-=2; }
    8487      else fgoptarg=false;
    8588    }
     
    197200    Four2DResponse tbeam(typcb, DoL, DoL );
    198201
    199     ForegroundCleaner  cleaner(*arep_p, tbeam, skycube);
     202    ForegroundCleaner  cleaner(*arep_p, tbeam, skycube, maxratio);
    200203    if (fgcorrbeam) {
    201204      cout << "calcpk2[3.b] : calling cleaner.BeamCorrections() for target beam Diameter=" << tbeamDiam 
  • trunk/Cosmo/RadioBeam/fgndsub.cc

    r3830 r3986  
    1414
    1515/* --Methode-- */
    16 ForegroundCleaner::ForegroundCleaner(Four2DResponse& arrep, Four2DResponse& tbeam, TArray< TF >& skycube)
    17   : arrep_(arrep) , tbeam_(tbeam), skycube_(skycube)
     16ForegroundCleaner::ForegroundCleaner(Four2DResponse& arrep, Four2DResponse& tbeam, TArray< TF >& skycube, double maxratio)
     17  : arrep_(arrep) , tbeam_(tbeam), skycube_(skycube), maxratio_(maxratio)
    1818{
    1919  double dxdeg = ThetaSizeDegre/(double)NTheta;
     
    3232{
    3333  BeamEffect beam(arrep_);
    34   beam.Correct2RefLobe(tbeam_, skycube_, dx_, dy_, freq0_, dfreq_);
    35   cout << " ForegroundCleaner::BeamCorrections() done " << endl;
     34  beam.Correct2RefLobe(tbeam_, skycube_, dx_, dy_, freq0_, dfreq_, maxratio_);
     35  cout << " ForegroundCleaner::BeamCorrections() done Maxratio=" << maxratio_ << endl;
    3636}
    3737
  • trunk/Cosmo/RadioBeam/fgndsub.h

    r3830 r3986  
    2525class ForegroundCleaner {
    2626public:
    27   ForegroundCleaner(Four2DResponse& arrep, Four2DResponse& tbeam, TArray< TF >& skycube);
     27  ForegroundCleaner(Four2DResponse& arrep, Four2DResponse& tbeam, TArray< TF >& skycube, double maxratio=10.);
    2828  void BeamCorrections();
    2929  int CleanNegatives(TF seuil=1.e-6);
     
    3737  Four2DResponse& tbeam_;    // Target beam to which would be corrected using BeamCorrections()
    3838  TArray< TF > skycube_;
     39  double maxratio_;
    3940  double dx_, dy_;   // taille des pixels (radians) de skycube
    4041  double freq0_, dfreq_;    // 1ere frequence et bin en frequence de skycube_;
  • trunk/Cosmo/RadioBeam/lobe.cc

    r3973 r3986  
    8585
    8686/* --Methode-- */
    87 void BeamEffect::Correct2RefLobe(Four2DResponse& rep, TArray< TF >& a, double dx, double dy, double f0, double df)
     87void BeamEffect::Correct2RefLobe(Four2DResponse& rep, TArray< TF >& a, double dx, double dy, double f0, double df, double maxratio)
    8888// dx, dy en radioans, f0, df en MHz
    8989{
     
    103103    conv.setFrequency(f0+kz*df);
    104104    fresp_.setLambda(conv.getLambda());
    105     Four2DRespRatio rratio(rep, fresp_);
     105    Four2DRespRatio rratio(rep, fresp_, maxratio);
    106106    ApplyLobeK2D(rratio, fourAmp, dkx, dky);
    107107    ffts.FFTBackward(fourAmp, slice, true);
  • trunk/Cosmo/RadioBeam/lobe.h

    r3973 r3986  
    3636
    3737  // Corrige de l'effet de l'effet de lobe, pour chaque plan de frequence, pour tout ramener au lobe defini par "rep"
    38   void Correct2RefLobe(Four2DResponse& rep, TArray< TF >& a, double dx, double dy, double f0, double df);
     38  void Correct2RefLobe(Four2DResponse& rep, TArray< TF >& a, double dx, double dy, double f0, double df, double maxratio=10.);
    3939
    4040  // Applique l'effet de lobe "rep" dans le plan de Fourier  pour une frequence (longueur d'onde) fixee
  • trunk/Cosmo/RadioBeam/mdish.cc

    r3974 r3986  
    167167// -- Four2DRespRatio : rapport de la reponse entre deux objets Four2DResponse
    168168//---------------------------------------------------------------
    169 Four2DRespRatio::Four2DRespRatio(Four2DResponse& a, Four2DResponse& b, double divzthr)
    170   : Four2DResponse(0, a.D(), a.D()), a_(a), b_(b), divzthr_(divzthr)
     169Four2DRespRatio::Four2DRespRatio(Four2DResponse& a, Four2DResponse& b, double maxratio)
     170  : Four2DResponse(0, a.D(), a.D()), a_(a), b_(b), maxratio_(maxratio)
    171171{
    172172}
     
    177177  double rb = b_.Value(kx,ky);
    178178  if (ra<rb) {
    179     if (rb>1.e-39)  return(ra/rb); 
     179    if (rb>1.e-9)  return(ra/rb); 
    180180    else return 0.;
    181181  }
    182   if (rb<divzthr_)  rb=divzthr_;
    183   return (ra/rb);
     182  double rval=1.;
     183  if (rb<1.e-9) rval=ra/rb;
     184  if (rval<maxratio_) return rval;
     185  return maxratio_;
    184186}
    185187
  • trunk/Cosmo/RadioBeam/mdish.h

    r3973 r3986  
    9090class Four2DRespRatio : public  Four2DResponse {
    9191public:
    92   Four2DRespRatio(Four2DResponse& a, Four2DResponse& b, double divzthr=5.e-2);
     92  Four2DRespRatio(Four2DResponse& a, Four2DResponse& b, double maxratio=10.);
    9393  // Return the ratio a.Value(kx,ky) / b.Value(kx, ky) - with protection against divide by zero
    9494  virtual double Value(double kx, double ky);
    9595  Four2DResponse& a_;
    9696  Four2DResponse& b_;
    97   double divzthr_;
     97  double maxratio_;
    9898};
    9999
  • trunk/Cosmo/RadioBeam/subtractradsrc.cmd

    r3984 r3986  
    1717# 1.d/ To run SimLSS with GSM map parametersand 90x30 deg maps (DeltaFreq=500 MHz) @ z=1 [ 90deg-> phi/alpha, 30deg -> theta/delta]
    1818csh> ~/Objs/exe/cmvginit3df -a -1 -2 -C -G 0. -F 0 -x 600,2.9 -y 1800,2.9 -z 256,3.5 -Z 1.0 -8 1. -n 10000 -O 0,2 -o lssz100 -T 2
     19
     20csh> ~/Objs/exe/cmvginit3df -a -1 -2 -C -G 0. -F 0 -x 600,3.8 -y 1800,3.8 -z 256,4.2 -Z 1.5 -8 1. -n 10000 -O 0,2 -o lssz150 -T 2
    1921
    2022# 1.c/ Change the X and Z axis of the cube to adapt it to RadioBeam package convention
Note: See TracChangeset for help on using the changeset viewer.