Changeset 3783 in Sophya for trunk


Ignore:
Timestamp:
Jun 16, 2010, 12:23:38 AM (15 years ago)
Author:
ansari
Message:

Ajout des programmes calcpk.cc calcpk2.cc syncube.cc tjyk.cc (voir fichier README) Reza 15/06/2010

Location:
trunk/Cosmo/RadioBeam
Files:
7 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/RadioBeam/README

    r3756 r3783  
    11===============================================================================
    2   Projet BAORadio / HSHS
     2  Projet BAORadio
    33  Simulation programs for radio lobe reconstruction, noise estimate etc ...
    44 
     
    99Note :  Uses SOPHYA class library  (http://www.sophya.org )
    1010
    11 A/ (u-v) plane coverage and Noise-P(k) computation for different interferometer configuration
    12 ==============================================================================================
    13 List of files :
     11A/ Interferometer sensitivity/noise power spectrum and foreground/radio sources
     12==============================================================================================
     13
     14A.1/ (u-v) plane coverage and Noise-P(k) computation for different interferometer configuration
     15  - pknoise.cc : main program for Noise-P(k) computation
     16  - plpkn.pic : spiapp script for plotting pknoise.cc program output
     17A.2/ power spectrum computation and foreground/radio source
     18  - calcpk.cc : power spectrum P(k) computation from 3D mass or temperature map
     19  - calcpk2.cc : LSS deltaT/T P(k) computation from LSS+foreground cubes after cleaning
     20  - syncube.cc : Synchrotron 3D temperature cube from HASLAM 400 MHz map
     21  - tjyk.cc : test de la classe H21Conversions
     22
     23A.3/ List of other common files :
    1424  - specpk.h specpk.cc : 3D power spectrum computation classes 
    1525  - mdish.h mdish.cc : Classes for representing Multi-Dish interferometer configurations
    16   - pknoise.cc : main program , makefile
    17   - plpkn.pic : spiapp script for plotting pknoise.cc program output
    18    
    19 B/ P(k) in temperature plot + "cosmic variance" + noise ...
     26  - radutil.h radutil.cc : utilitaire de conversion a 21 cm
     27 
     28E/ P(k) in temperature plot + "cosmic variance" + noise ...
    2029=============================================================
    2130Note : to be executed in spiapp
    2231List of Files : anapkn.pic + cmvhpkz.ppf
    2332
    24 C/ Interferometer configuration / noise estimate
     33F/ Interferometer configuration / noise estimate
    2534=================================================
    2635Note : to be executed in spiapp
    2736
    28 C.1/ formnoise.pic + vnpairs.cc + vnpairs.h
     37F.1/ formnoise.pic + vnpairs.cc + vnpairs.h
    2938
    30 C.2/ pa.pic + pa.cc + pa.h : Lobe synthesis (dipoles sum)
     39F.2/ pa.pic + pa.cc + pa.h : Lobe synthesis (dipoles sum)
    3140
    32 D/ 3D reconstruction (alpha,delta,freq) simulation program
     41G/ 3D reconstruction (alpha,delta,freq) simulation program
    3342===========================================================
    3443
  • trunk/Cosmo/RadioBeam/makefile

    r3756 r3783  
    66include $(SOPHYABASE)/include/sophyamake.inc
    77
    8 all : pknoise  
     8all : pknoise calcpk calcpk2 syncube tjyk
    99
    1010clean :
    1111        rm Objs/*
    1212
     13### les executables
    1314pknoise : Objs/pknoise
    1415        echo 'makefile : pknoise made'
    1516
    16 Objs/pknoise : Objs/pknoise.o Objs/specpk.o Objs/mdish.o
    17         $(CXXLINK) -o Objs/pknoise Objs/pknoise.o Objs/specpk.o Objs/mdish.o $(SOPHYAEXTSLBLIST)
     17calcpk : Objs/calcpk
     18        echo 'makefile : calcpk made'
    1819
    19 Objs/pknoise.o : pknoise.cc specpk.h  mdish.h
     20calcpk2 : Objs/calcpk2
     21        echo 'makefile : calcpk2 made'
     22
     23syncube : Objs/syncube
     24        echo 'makefile : syncube made'
     25
     26tjyk : Objs/tjyk
     27        echo 'makefile : tjyk made'
     28
     29### programme pknoise
     30Objs/pknoise : Objs/pknoise.o Objs/specpk.o Objs/mdish.o Objs/qhist.o
     31        $(CXXLINK) -o Objs/pknoise Objs/pknoise.o Objs/specpk.o Objs/mdish.o Objs/qhist.o  $(SOPHYAEXTSLBLIST)
     32
     33Objs/pknoise.o : pknoise.cc specpk.h  mdish.h qhist.h
    2034        $(CXXCOMPILE) -o Objs/pknoise.o pknoise.cc
    2135
    22 Objs/specpk.o : specpk.cc specpk.h  mdish.h
     36### programme calcpk
     37Objs/calcpk : Objs/calcpk.o Objs/specpk.o Objs/mdish.o Objs/qhist.o
     38        $(CXXLINK) -o Objs/calcpk Objs/calcpk.o Objs/specpk.o Objs/mdish.o Objs/qhist.o  $(SOPHYAEXTSLBLIST)
     39
     40Objs/calcpk.o : calcpk.cc specpk.h  mdish.h qhist.h
     41        $(CXXCOMPILE) -o Objs/calcpk.o calcpk.cc
     42
     43### programme calcpk2
     44Objs/calcpk2 : Objs/calcpk2.o Objs/specpk.o Objs/mdish.o Objs/qhist.o
     45        $(CXXLINK) -o Objs/calcpk2 Objs/calcpk2.o Objs/specpk.o Objs/mdish.o Objs/qhist.o  $(SOPHYAEXTSLBLIST)
     46
     47Objs/calcpk2.o : calcpk2.cc specpk.h  mdish.h qhist.h
     48        $(CXXCOMPILE) -o Objs/calcpk2.o calcpk2.cc
     49
     50### programme syncube
     51Objs/syncube : Objs/syncube.o
     52        $(CXXLINK) -o Objs/syncube Objs/syncube.o $(SOPHYAEXTSLBLIST)
     53
     54Objs/syncube.o : syncube.cc
     55        $(CXXCOMPILE) -o Objs/syncube.o syncube.cc
     56
     57### programme syncube
     58Objs/tjyk : Objs/tjyk.o Objs/radutil.o
     59        $(CXXLINK) -o Objs/tjyk Objs/tjyk.o Objs/radutil.o $(SOPHYAEXTSLBLIST)
     60
     61Objs/tjyk.o : tjyk.cc radutil.h
     62        $(CXXCOMPILE) -o Objs/tjyk.o tjyk.cc
     63
     64### les classes / fonctions
     65Objs/specpk.o : specpk.cc specpk.h  mdish.h qhist.h
    2366        $(CXXCOMPILE) -o Objs/specpk.o specpk.cc
    2467
    25 Objs/mdish.o : mdish.cc mdish.h
     68Objs/mdish.o : mdish.cc mdish.h qhist.h
    2669        $(CXXCOMPILE) -o Objs/mdish.o mdish.cc
     70
     71Objs/qhist.o : qhist.cc qhist.h
     72        $(CXXCOMPILE) -o Objs/qhist.o qhist.cc
     73
     74Objs/radutil.o : radutil.cc radutil.h
     75        $(CXXCOMPILE) -o Objs/radutil.o radutil.cc
  • trunk/Cosmo/RadioBeam/mdish.cc

    r3769 r3783  
    102102};
    103103
    104 // -----------------------------------
    105 // -- Classe ressemblant a un histo 2D
    106 // -----------------------------------
    107 QHis2D::QHis2D()
    108   : nx(0),ny(0),xmin(0),xmax(0),ymin(0),ymax(0),sumw0(0.)
    109 {
    110   ixb0 = jyb0 = 0;
    111 }
    112 QHis2D::QHis2D(r_8 xMin,r_8 xMax,int_4 nxb,r_8 yMin,r_8 yMax,int_4 nyb)
    113   : nx(0),ny(0),xmin(0),xmax(0),ymin(0),ymax(0),sumw0(0.)
    114 {
    115   Define(xMin, xMax, nxb, yMin, yMax, nyb);
    116 }
    117 void QHis2D::Define(r_8 xMin,r_8 xMax,int_4 nxb,r_8 yMin,r_8 yMax,int_4 nyb)
    118 {
    119   nx=nxb; ny=nyb;
    120   xmin=xMin;  xmax=xMax; 
    121   ymin=yMin;  ymax=yMax; 
    122   dxb=(xmax-xmin)/(double)nx;
    123   dyb=(ymax-ymin)/(double)ny;
    124   sa_size_t sz[5];  sz[0]=nx;  sz[1]=ny;
    125   aw.ReSize(2,sz);
    126   SetZeroBin();
    127   sumw0=0.;
    128   return;
    129 }
    130 double QHis2D::Add(r_8 x, r_8 y, r_8 w, bool fgfh)
    131 {
    132   sa_size_t ix = (sa_size_t)((x-xmin)/dxb);
    133   sa_size_t jy = (sa_size_t)((y-ymin)/dyb);
    134   if ((ix<0)||(ix>=nx)||(jy<0)||(jy>=ny))  return 0.;
    135   double rw = ((ix==ixb0)&&(jy==jyb0)) ? w : 0.;
    136   sumw0 += rw;
    137   if (fgfh) aw(ix,jy) += w;
    138   return rw;
    139 }
    140 void QHis2D::SetZeroBin(r_8 x, r_8 y)
    141 {
    142   ixb0 = (sa_size_t)((x-xmin)/dxb);
    143   jyb0 = (sa_size_t)((y-ymin)/dyb);
    144 }
    145 Histo2D QHis2D::Convert()
    146 {
    147   int_4 imn,jmn,imx,jmx;
    148   r_8 min = aw(0,0);
    149   r_8 max = aw(0,0);
    150   imn=jmn=imx=jmx=0;
    151   Histo2D h2(xmin,xmax,nx,ymin,ymax,ny);
    152   for(int_4 j=0; j<ny; j++)
    153     for(int_4 i=0; i<nx; i++) {
    154       h2(i,j) = aw(i,j);
    155       if (aw(i,j)>max) {
    156         imx=i;  jmx=j;  max=aw(i,j);
    157       }
    158       if (aw(i,j)<min) {
    159         imn=i;  jmn=j;  min=aw(i,j);
    160       }
    161     }
    162   cout << "QHis2D::Convert()/Info: Nx,Ny=" << nx << "," << ny << " SumW=" << sumw0
    163        << "\n ... Max:" << imx << "," << jmx << " ->" << max
    164        << " @" << imx*dxb+xmin << "," << jmx*dyb+ymin
    165        << "\n ...Min:" << imn << "," << jmn << " ->" << min
    166        << " @" << imn*dxb+xmin << "," << jmn*dyb+ymin << endl;
    167   return h2;
    168 }
    169104
    170105//----------------------------------------------------------------------
  • trunk/Cosmo/RadioBeam/mdish.h

    r3769 r3783  
    1414#include "genericfunc.h"   // SOPHYA .h 
    1515#include "array.h"         // SOPHYA .h 
    16 #include "histats.h"       // SOPHYA .h
     16#include "qhist.h"
    1717
     18#ifndef DeuxPI
    1819#define DeuxPI 2.*M_PI
     20#endif
    1921
    2022// -- Four2DResponse : Reponse instrumentale ds le plan k_x,k_y (angles theta,phi)
     
    7880};
    7981
    80 // -----------------------------------
    81 // -- Classe ressemblant a un histo 2D
    82 class QHis2D {
    83 public:
    84   QHis2D();
    85   QHis2D(r_8 xMin,r_8 xMax,int_4 nxBin,r_8 yMin,r_8 yMax,int_4 nyBin);
    86   void Define(r_8 xMin,r_8 xMax,int_4 nxBin,r_8 yMin,r_8 yMax,int_4 nyBin);
    87   double Add(r_8 x, r_8 y, r_8 w, bool fgfh);
    88   void SetZeroBin(r_8 x=0, r_8 y=0);
    89   inline double WBinX() { return dxb; }
    90   inline double WBinY() { return dyb; }
    91   Histo2D Convert();
    92  
    93   r_8 xmin,xmax,ymin,ymax;
    94   r_8 dxb,dyb;
    95   sa_size_t nx,ny;
    96   sa_size_t ixb0, jyb0;
    97   TArray<r_8> aw;
    98   double sumw0;
    99 };
    10082
    10183// -------------------------------------------------------------------
  • trunk/Cosmo/RadioBeam/specpk.cc

    r3769 r3783  
    225225  double kxx, kyy, kzz;
    226226  // sa_size_t is large integer type 
    227   for(sa_size_t kz=0; kz<fourAmp.SizeZ(); kz++) {
     227  // We ignore 0th term in all frequency directions ...
     228  for(sa_size_t kz=1; kz<fourAmp.SizeZ(); kz++) {
    228229    kzz =  (kz > fourAmp.SizeZ()/2) ? (double)(fourAmp.SizeZ()-kz)*dkz_ : (double)kz*dkz_;
    229     for(sa_size_t ky=0; ky<fourAmp.SizeY(); ky++) {
     230    for(sa_size_t ky=1; ky<fourAmp.SizeY(); ky++) {
    230231      kyy =  (ky > fourAmp.SizeY()/2) ? (double)(fourAmp.SizeY()-ky)*dky_ : (double)ky*dky_;
    231       for(sa_size_t kx=0; kx<fourAmp.SizeX(); kx++) {
     232      for(sa_size_t kx=1; kx<fourAmp.SizeX(); kx++) {  // ignore the 0th coefficient (constant term)
    232233        double kxx=(double)kx*dkx_;
    233234        complex<TF> za = fourAmp(kx, ky, kz);
Note: See TracChangeset for help on using the changeset viewer.