Changeset 3787 in Sophya for trunk/Cosmo/RadioBeam/calcpk2.cc


Ignore:
Timestamp:
Jun 25, 2010, 12:00:30 PM (15 years ago)
Author:
ansari
Message:

Ajout classes / programmes de calcul d'effet de lobe sur les radio-sources, Reza 25/06/2010

File:
1 edited

Legend:

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

    r3784 r3787  
    77    R. Ansari , C. Magneville - Juin 2010
    88
    9 Usage: calcpk2 InMapLSS convFacLSS InMapSync convFacSync OutPk
     9Usage: calcpk2 InMapLSS convFacLSS InMapSync convFacSync InMapRadioSource convFacRsc OutPk [PixNoiseLevel]
    1010---------------------------------------------------------------  */
    1111
     
    2222
    2323#include "qhist.h"
     24#include "lobe.h"
     25#include "cubedef.h"
     26
    2427#include "histinit.h"
    2528#include "fftwserver.h"
     
    3033typedef ThSDR48RandGen RandomGenerator ;
    3134//--- Declaration des fonctions
    32 TArray<r_4> CleanForeground(TArray<r_4>& maplss, TArray<r_4>& mapsync, TArray<r_8>& synctemp, TArray<r_8>& specidx);
     35TArray<r_4> CleanForeground(TArray<r_4>& maplss, TArray<r_4>& mapsync, double freq0, double dfreq,
     36                            TArray<r_8>& synctemp, TArray<r_8>& specidx);
    3337
    3438//-------------------------------------------------------------------------
     
    3943{
    4044  if (narg<6) {
    41     cout << " Usage: calcpk2 InMapLSS convFacLSS InMapSync convFacSync OutPk " << endl;
     45    cout << " Usage: calcpk2 InMapLSS convFacLSS InMapSync convFacSync  OutPk [PixNoiseLevel] " << endl;
    4246    return 1;
    4347  }
     
    5054    r_4 rfacsync = atof(arg[4]);
    5155    string outname = arg[5];
     56
     57    double pixsignoise = 0.;
     58    bool fgaddnoise=false;
     59    if (narg>6) {
     60      pixsignoise=atof(arg[6]);
     61      fgaddnoise=true;
     62    }
     63
     64
    5265    TArray<r_4> inmaplss, inmapsync;
    5366    const char * tits[2]={"LSS", "Sync"};
     
    6881      cout << " ... Mean=" << mean << " Sigma=" << sigma << endl;
    6982    }
     83
     84    if (fgaddnoise) {
     85      cout << " calcpk2: adding noise to LSS input cube ... " << endl;
     86      BeamEffect::AddNoise(inmaplss, pixsignoise);
     87    }
     88
    7089    tm.Split(" After read ");
    7190    TArray<r_8> synctemp, specidx;
    7291    cout << "calcpk2[3] : calling CleanForeground(...) " << endl;
    73     TArray<r_4> inmap = CleanForeground(inmaplss, inmapsync, synctemp, specidx);
     92    double freq0 = Freq0MHz;
     93    double dfreq = FreqSizeMHz/(double)NFreq;
     94    TArray<r_4> inmap = CleanForeground(inmaplss, inmapsync, freq0, dfreq, synctemp, specidx);
    7495    double mean, sigma;
    7596    MeanSigma(inmap, mean, sigma);
     
    117138
    118139/* --Fonction-- */
    119 TArray<r_4> CleanForeground(TArray<r_4>& maplss, TArray<r_4>& mapsync, TArray<r_8>& synctemp, TArray<r_8>& specidx)
     140TArray<r_4> CleanForeground(TArray<r_4>& maplss, TArray<r_4>& mapsync, double freq0, double dfreq,
     141                            TArray<r_8>& synctemp, TArray<r_8>& specidx)
     142// Inputs : maplss, mapsyc, freq0, dfreq
     143// Outputs : synctemp, specidx  (reconstructed foreground temperature and spectral index
     144// Return_Array : foreground subtracted LSS signal
    120145{
    121146  bool smo;
     
    131156  Vector vlnf(maplss.SizeZ());
    132157  int nprt = 0;
    133   double freq0=840.;  // Frequence premier index en k (MHz)
    134   double dfreq=1.;   // largeur en frequence de chaque plan (Mhz) 
     158  // double freq0 : Frequence premier index en k (MHz)
     159  // double dfreq :   // largeur en frequence de chaque plan (Mhz) 
    135160  for(sa_size_t i=0; i<maplss.SizeX(); i++)
    136161    for(sa_size_t j=0; j<maplss.SizeY(); j++)  {
Note: See TracChangeset for help on using the changeset viewer.