Changeset 3785 in Sophya for trunk/Cosmo


Ignore:
Timestamp:
Jun 16, 2010, 11:53:54 PM (15 years ago)
Author:
ansari
Message:

Ajout programme srcat2cube.cc de calcul de carte des radio source, Reza 16/06/2010

Location:
trunk/Cosmo/RadioBeam
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/RadioBeam/README

    r3783 r3785  
    1919  - calcpk2.cc : LSS deltaT/T P(k) computation from LSS+foreground cubes after cleaning
    2020  - syncube.cc : Synchrotron 3D temperature cube from HASLAM 400 MHz map
     21  - srcat2cube.cc : radio source 3D temperature cube from NVSS catalog
    2122  - tjyk.cc : test de la classe H21Conversions
    2223
     
    2526  - mdish.h mdish.cc : Classes for representing Multi-Dish interferometer configurations
    2627  - radutil.h radutil.cc : utilitaire de conversion a 21 cm
     28  - cubedef.h : size and limits for 3D temperature cubes generated by  syncube.cc , srcat2cube.cc
    2729 
    2830E/ P(k) in temperature plot + "cosmic variance" + noise ...
  • trunk/Cosmo/RadioBeam/makefile

    r3783 r3785  
    66include $(SOPHYABASE)/include/sophyamake.inc
    77
    8 all : pknoise calcpk calcpk2 syncube tjyk
     8all : pknoise calcpk calcpk2 syncube srcat2cube tjyk
    99
    1010clean :
     
    2323syncube : Objs/syncube
    2424        echo 'makefile : syncube made'
     25
     26srcat2cube : Objs/srcat2cube
     27        echo 'makefile : srcat2cube made'
    2528
    2629tjyk : Objs/tjyk
     
    5558        $(CXXCOMPILE) -o Objs/syncube.o syncube.cc
    5659
    57 ### programme syncube
     60### programme srcat2cube
     61Objs/srcat2cube : Objs/srcat2cube.o
     62        $(CXXLINK) -o Objs/srcat2cube Objs/srcat2cube.o  Objs/radutil.o $(SOPHYAEXTSLBLIST)
     63
     64Objs/srcat2cube.o : srcat2cube.cc radutil.h
     65        $(CXXCOMPILE) -o Objs/srcat2cube.o srcat2cube.cc
     66
     67### programme tjyk
    5868Objs/tjyk : Objs/tjyk.o Objs/radutil.o
    5969        $(CXXLINK) -o Objs/tjyk Objs/tjyk.o Objs/radutil.o $(SOPHYAEXTSLBLIST)
  • trunk/Cosmo/RadioBeam/syncube.cc

    r3783 r3785  
    4444#include "fiosinit.h"     
    4545
    46 
    4746#include "timing.h"
    4847#include "ctimer.h"
     48
     49#include "cubedef.h"
    4950
    5051//----------------------------------------------------------------------------
     
    6566    return 1;
    6667  }
    67 
    68   //---  Parametres des lois de puissance en frequence
    69   double AmpPL1 = 1.;   // amp max PowerLaw 2
    70   double PLidx1 = -2.5;  // index de la loi de puissance synchrotron
    71   double sigPLidx1 = 0.1;  // Sigma de la variation (gaussienne) de index1
    72   // Amplitude max de la 2eme composante en loi de puissance (tirage plat 0 ... AmpPL2)
    73   double AmpPL2 = 0.1;   // amp max PowerLaw 2
    74   double PLidx2 = -3.2;
    75   double sigPLidx2 = 0.15;
    7668
    7769  // decodage arguments
     
    10193    cout << "syncube[1]: Input resolution doubled : " << inmap << endl;
    10294
    103     sa_size_t NTet=256;
    104     sa_size_t NPhi=256;
    105     LocalMap<r_4> outmap(NPhi,NTet,60.,60.,110.,150.);
     95   LocalMap<r_4> outmap(NPhi,NTheta,60.,60.,110.,150.);
    10696    for(int_4 kk=0; kk<outmap.NbPixels(); kk++) {
    10797      double theta, phi;  // Theta, Phi en radians
     
    110100    }   
    111101
    112     TArray<r_4> omap(NPhi,NTet);
    113     double tet0 = Angle(60.,Angle::Degree).ToRadian();
    114     double phi0 = Angle(120.,Angle::Degree).ToRadian();
    115     double dtet = Angle(60.,Angle::Degree).ToRadian()/(double)NTet;
    116     double dphi = Angle(60.,Angle::Degree).ToRadian()/(double)NPhi;
     102    TArray<r_4> omap(NPhi,NTheta);
     103    double tet0 = Angle(Theta0Degre,Angle::Degree).ToRadian();
     104    double phi0 = Angle(Phi0Degre,Angle::Degree).ToRadian();
     105    double dtet = Angle(ThetaSizeDegre,Angle::Degree).ToRadian()/(double)NTheta;
     106    double dphi = Angle(PhiSizeDegre,Angle::Degree).ToRadian()/(double)NPhi;
    117107    for (sa_size_t j=0; j<omap.SizeY(); j++)  {
    118108      double theta = j*dtet+tet0;
     
    122112      }
    123113    }
     114
     115    double mean, sigma;
     116    MeanSigma(omap, mean, sigma);
     117    cout << "syncube[2] omap : Mean=" << mean << " Sigma=" << sigma << "  Jy - Sizes:" << endl;
     118    omap.Show();
     119
    124120    //    Sph2Sph(inmap,outmap);
    125121   
    126     cout << "syncube[2]: Output rectangular map computed " << outmap << endl;
    127122    if (narg > 3) {
    128123      string ppfname = arg[3];
     
    134129    }
    135130
    136     sa_size_t NFreq = 128;
    137     TArray<r_4> ocube(NPhi,NTet,NFreq);
     131    TArray<r_4> ocube(NPhi,NTheta,NFreq);
    138132
    139133    double infreq = 400.; // Frequence carte input en MHz
    140     double freq0 = 840.;  // Freq0 du cube de sortie
    141     double dfreq = 1.
     134    double freq0 = Freq0MHz;  // Freq0 du cube de sortie
     135    double dfreq = FreqSizeMHz/(double)NFreq
    142136
    143137    ThSDR48RandGen rg;
     
    162156    // On sauve le cube de sortie
    163157    {
    164       cout << " syncube[2]: Saving output cube to -> " << outname << endl;
     158      cout << " syncube[4]: Saving output cube to -> " << outname << endl;
    165159      POutPersist poc(outname);
    166160      poc << ocube;
     
    170164  }
    171165  catch (PThrowable& exc) {
    172     cerr << " treccyl.cc catched Exception " << exc.Msg() << endl;
     166    cerr << " syncube.cc catched Exception " << exc.Msg() << endl;
    173167    rc = 77;
    174168  } 
  • trunk/Cosmo/RadioBeam/tjyk.cc

    r3783 r3785  
    22#include <iostream>
    33
     4// Appel : tjyk [z=redshift] [resol_arcmin]
     5 
    46int main(int narg, char* arg[])
    57{
     
    79  H21Conversions conv;
    810 
    9   conv.setRedshift(0.6);
    10   conv.setOmegaPixArcmin2(10.*10.);
    11   cout << " --------------------------------------------------------------- " << endl;
     11  double z = 0.;
     12  double resol = 10.;
     13  if (narg>1) z = atof(arg[1]);
     14  if (narg>2) resol = atof(arg[2]);
     15
     16  conv.setRedshift(z);
     17  conv.setOmegaPixArcmin2(resol*resol);
     18  cout << " ------------------------------ H21Conversions ------------------------- " << endl;
     19  cout << "  Redshift=z= " << z << " Resol(arcmin)= " << resol << endl;
    1220  cout << " H21Conversions: z=" << conv.getRedshift() << " Freq=" << conv.getFrequency()
    1321       << " MHz , Lambda=" << conv.getLambda() << " m , OmegaPix=" << conv.getOmegaPix() << " srad" << endl;
Note: See TracChangeset for help on using the changeset viewer.