#include "sopnamsp.h" #include "machdefs.h" #include #include #include #include #include #include #include "sophyainit.h" #include "timing.h" #include "dvlist.h" #include "histos.h" #include "fabtcolread.h" #include "fftwserver.h" #include "constcosmo.h" #include "geneutils.h" #include "genefluct3d.h" // cmvrvloscorf -n 1,30 -K 75 -S ginit3d_6_0p0_100_r.fits ginit3d_6_0p0_100_rv.fits void usage(void); void usage(void) { cout <<"cmvrvloscor [options] rho.fits vlos.fits"<=narg-1) {usage(); return -1;} //----TRY-CATCH-TRY-CATCH-TRY-CATCH-TRY-CATCH-TRY-CATCH-TRY-CATCH try { //----TRY-CATCH-TRY-CATCH-TRY-CATCH-TRY-CATCH-TRY-CATCH-TRY-CATCH SophyaInit(); InitTim(); // --- open FITS files (dRho/Rho and Vlos) cout<<"> read rho: "< read vlos: "<* rgen = NULL; if(docube) { cout<<"...Create and fill 3D cube"<Print(); rgen = &(fluct3d->GetRealArray()); *rgen = 0.; } // --- Vector for real-space correlation computation int imil = Nz-1; dvlcor("imil") = (int_4)imil; TVector nKsi; TVector Ksirv, Ksirvc, Ksirr, Ksirrc; if(npixcor>0) { Ksirv.ReSize(2*Nz-1); Ksirv = 0.; Ksirvc.ReSize(2*Nz-1); Ksirvc = 0.; Ksirr.ReSize(2*Nz-1); Ksirr = 0.; Ksirrc.ReSize(2*Nz-1); Ksirrc = 0.; nKsi.ReSize(2*Nz-1); nKsi = 0; cout<<"...Compute R*V correlation on +/-"< > FR, FV; TVector< complex > pkvr, FRdis; TVector pkr, pkrc; FFTWServer fftserv; if(dopk) cout<<"...compute V*conj(R) cross-power spectrum"< R(Nz), V(Nz); TVector Rdis(Nz); if(nplany>Ny) nplany = Ny; cout<<"...Will read one Y plane every "< fill one los every "<>> filling redshift distorted cube"<(0.); pkr.ReSize(nf); pkr = 0.; pkrc.ReSize(nf); pkrc = 0.; } fftserv.FFTForward(R,FR); for(int l=0;l0) { hmpc.Show(); pos.PutObject(hmpc,"hmpc"); } if(Ksirr.Size()>0) { for(int l=0;l0) { Ksirr(l) /= nKsi(l); Ksirrc(l) /= nKsi(l); Ksirv(l) /= nKsi(l); Ksirvc(l) /= nKsi(l); } pos.PutObject(Ksirr,"ksirr"); pos.PutObject(Ksirrc,"ksirrc"); pos.PutObject(Ksirv,"ksirv"); pos.PutObject(Ksirvc,"ksirvc"); pos.PutObject(nKsi,"nksi"); } if(npk>0) { pkvr /= (double)npk; pkr /= (double)npk; pkrc /= (double)npk; pos.PutObject(pkvr,"pkvr"); pos.PutObject(pkr,"pkr"); pos.PutObject(pkrc,"pkrc"); } PrtTim(">>>> End filling redshift distorted cube"); // --- Fourier transform 3D cube and compute 1D and 2D power spectra if(fluct3d) { cout<<">>> Fourier transform 3D cube and compute 1D and 2D power spectra"<ReComputeFourier(); PrtTim(">>>> End ReComputing spectrum"); // Compute 1D spectrum cout<GetKincMin(), knyqmax = fluct3d->GetKmax(); long nherr = long(knyqmax/dkmin+0.5); cout<<"\nFor HistoErr: d="<>>> End Computing final spectrum"); // Compute 2D spectrum cout<<"\n--- Computing final 2D spectrum"<GetKTincMin(), ktnyqmax = fluct3d->GetKTmax(); double dkzmin = fluct3d->GetKinc()[2], kznyqmax = fluct3d->GetKnyq()[2]; long nherrt = long(ktnyqmax/dktmin+0.5), nherrz = long(kznyqmax/dkzmin+0.5); cout<<"For Histo2DErr: d="<ComputeSpectrum2D(hpkrec2); pos.PutObject(hpkrec2,"hpkrec2"); PrtTim(">>>> End Computing final 2D spectrum"); } // --- end of job, write objects in ppf pos.PutObject(dvlcor,"dvlcor"); if(fluct3d) delete fluct3d; //----TRY-CATCH-TRY-CATCH-TRY-CATCH-TRY-CATCH-TRY-CATCH-TRY-CATCH } catch (PException& exc) { cerr<<"cmvrvloscor.cc catched PException"<0 ! "nsta cpts logx" # recosntructed 2D power spectrum imag hpkrec2 addoval 0 0 0.05 0.05 "green" false addoval 0 0 0.1 0.1 "green" false addoval 0 0 0.25 0.25 "green" false addoval 0 0 0.5 0.5 "green" false x = ${hpkrec2.xmax} / 2. addoval 0 0 $x $x "green" false x = ${hpkrec2.ymax} / 2. addoval 0 0 $x $x "green" false # proj selon kT (black), selon kZ (red) n/plot hpkrec2.val%sqrt(x*x+y*y) ! ! "nsta crossmarker3 logx" */