Changeset 3792 in Sophya for trunk/Cosmo
- Timestamp:
- Jun 28, 2010, 6:06:00 PM (15 years ago)
- Location:
- trunk/Cosmo/RadioBeam
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/RadioBeam/README
r3788 r3792 13 13 14 14 A.1/ (u-v) plane coverage and Noise-P(k) computation for different interferometer configuration 15 - pknoise.cc : main program for Noise-P(k)computation15 - pknoise.cc , repicon.cc : main program for Noise-P(k) computation and interferometer response computation 16 16 - plpkn.pic : spiapp script for plotting pknoise.cc program output 17 17 A.2/ power spectrum computation and foreground/radio source … … 28 28 - lobe.h lobe.cc : 2D (k_alpha, k_delta) beam effect on 3D sky cubes 29 29 - specpk.h specpk.cc : 3D power spectrum computation classes 30 - interfconfigs.h interfconfigs.c : functions creating different dish arrays / cylinder configuration 30 31 - mdish.h mdish.cc : Classes for representing Multi-Dish interferometer configurations 31 32 - radutil.h radutil.cc : utilitaire de conversion a 21 cm -
trunk/Cosmo/RadioBeam/applobe.cc
r3789 r3792 3 3 R. Ansari , C. Magneville - Juin 2010 4 4 5 Usage: applobe In3DPPFName Out3DPPFName [ResmapleFactor=0.5,0.333...] [TargetBeam Arcmin]5 Usage: applobe In3DPPFName Out3DPPFName [ResmapleFactor=0.5,0.333...] [TargetBeamDoL] 6 6 --------------------------------------------------------------- */ 7 7 … … 50 50 51 51 if (narg < 3) { 52 cout << "Usage: applobe In3DPPFName Out3DPPFName [ResmapleFactor=0.5,0.333...] [TargetBeam Arcmin]\n" << endl;52 cout << "Usage: applobe In3DPPFName Out3DPPFName [ResmapleFactor=0.5,0.333...] [TargetBeamDoL]\n" << endl; 53 53 return 1; 54 54 } … … 64 64 } 65 65 bool fgcorrbeam=false; 66 double tbeam arcmin=15.;66 double tbeamDoL=135; 67 67 if (narg>4) { 68 tbeam arcmin=atof(arg[4]);69 if (tbeam arcmin>1.e-3) fgcorrbeam=true;68 tbeamDoL=atof(arg[4]); 69 if (tbeamDoL>1) fgcorrbeam=true; 70 70 } 71 71 72 72 int rc = 91; 73 73 74 cout << " ====== applobe : Input NVSS catalogname= " << inname << " OutName=" << outname;74 cout << " ====== applobe : Input skycube name= " << inname << " OutName=" << outname; 75 75 bool fginmap=true; 76 76 try { … … 105 105 106 106 if (fgcorrbeam) { 107 double DoL = 1.22/ArcminToRadian(tbeamarcmin); 107 double DoL = tbeamDoL; 108 double tbeamarcmin = RadianToDegree(1.22/DoL)*60.; 108 109 Four2DResponse tbeam(2, DoL, DoL ); 109 cout << "applobe[3]: calling Correct2RefLobe() with target beam :" << tbeamarcmin110 << " arcmin -> D/Lambda=" << DoL<< endl;110 cout << "applobe[3]: calling Correct2RefLobe() with target beam D/Lambda=" << DoL 111 << " -> arcmin " << tbeamarcmin << endl; 111 112 beam.Correct2RefLobe(tbeam, incube, dx, dy, Freq0MHz, dfreq); 112 113 } -
trunk/Cosmo/RadioBeam/calcpk2.cc
r3789 r3792 65 65 66 66 bool fgcorrbeam=true; 67 double tbeam arcmin=15.;67 double tbeamDoL=135; 68 68 if (narg>7) { 69 tbeam arcmin=atof(arg[7]);70 if (tbeam arcmin<1.e-6) fgcorrbeam=false;69 tbeamDoL=atof(arg[7]); 70 if (tbeamDoL<1.) fgcorrbeam=false; 71 71 } 72 72 bool fgclnsrc=true; … … 120 120 double lambda = conv.getLambda(); 121 121 Four2DResponse arep(2, InterfArrayDiametre/lambda, InterfArrayDiametre/lambda, lambda); 122 double DoL = 1.22/ArcminToRadian(tbeamarcmin); 122 double DoL = tbeamDoL; 123 double tbeamarcmin = RadianToDegree(1.22/DoL)*60.; 123 124 Four2DResponse tbeam(2, DoL, DoL ); 124 125 ForegroundCleaner cleaner(arep, tbeam, skycube); 125 126 if (fgcorrbeam) { 126 cout << "calcpk2[3.a] : calling cleaner.BeamCorrections() for target beam (" << tbeamarcmin << " arcmin)"127 << " Diam/Lambda=" << DoL<< endl;127 cout << "calcpk2[3.a] : calling cleaner.BeamCorrections() for target beam D/Lambda=" << DoL 128 << " -> arcmin " << tbeamarcmin << endl; 128 129 cleaner.BeamCorrections(); 129 130 } -
trunk/Cosmo/RadioBeam/makefile
r3789 r3792 6 6 include $(SOPHYABASE)/include/sophyamake.inc 7 7 8 all : pknoise calcpk calcpk2 syncube srcat2cube tjyk applobe8 all : pknoise repicon calcpk calcpk2 syncube srcat2cube tjyk applobe 9 9 10 10 clean : 11 11 rm Objs/* 12 12 13 PKGOLIST = Objs/fgndsub.o Objs/lobe.o Objs/specpk.o Objs/mdish.o Objs/ qhist.o Objs/radutil.o14 PKGHLIST = fgndsub.h lobe.h specpk.h mdish.h qhist.h radutil.h cubedef.h13 PKGOLIST = Objs/fgndsub.o Objs/lobe.o Objs/specpk.o Objs/mdish.o Objs/interfconfigs.o Objs/qhist.o Objs/radutil.o 14 PKGHLIST = fgndsub.h lobe.h specpk.h mdish.h interfconfigs.h qhist.h radutil.h cubedef.h 15 15 16 16 ### les executables 17 17 pknoise : Objs/pknoise 18 18 echo 'makefile : pknoise made' 19 20 repicon : Objs/repicon 21 echo 'makefile : repicon made' 19 22 20 23 calcpk : Objs/calcpk … … 42 45 Objs/pknoise.o : pknoise.cc $(PKGHLIST) 43 46 $(CXXCOMPILE) -o Objs/pknoise.o pknoise.cc 47 48 ### programme repicon (calcul et sauvegarde de la reponse de l'interferometre dans le plan (u,v) 49 Objs/repicon : Objs/repicon.o $(PKGOLIST) 50 $(CXXLINK) -o Objs/repicon Objs/repicon.o $(PKGOLIST) $(SOPHYAEXTSLBLIST) 51 52 Objs/repicon.o : repicon.cc $(PKGHLIST) 53 $(CXXCOMPILE) -o Objs/repicon.o repicon.cc 44 54 45 55 ### programme calcpk … … 96 106 $(CXXCOMPILE) -o Objs/mdish.o mdish.cc 97 107 108 Objs/interfconfigs.o : interfconfigs.cc $(PKGHLIST) 109 $(CXXCOMPILE) -o Objs/interfconfigs.o interfconfigs.cc 110 98 111 Objs/lobe.o : lobe.cc $(PKGHLIST) 99 112 $(CXXCOMPILE) -o Objs/lobe.o lobe.cc -
trunk/Cosmo/RadioBeam/mdish.cc
r3789 r3792 59 59 // -- Four2DRespTable : Reponse tabulee instrumentale ds le plan k_x,k_y (angles theta,phi) 60 60 //--------------------------------------------------------------- 61 Four2DRespTable::Four2DRespTable(Histo2D const & hrep, double d) 62 : Four2DResponse(0,d,d) , hrep_(hrep) 61 Four2DRespTable::Four2DRespTable() 62 : Four2DResponse(0,1.,1.) 63 { 64 } 65 66 Four2DRespTable::Four2DRespTable(Histo2D const & hrep, double d, double lambda) 67 : Four2DResponse(0,d,d,lambda) , hrep_(hrep) 63 68 { 64 69 } … … 75 80 } 76 81 82 void Four2DRespTable::writeToPPF(string flnm) 83 { 84 DVList dvinfo; 85 dvinfo["DoL"] = dx_; 86 dvinfo["LambdaRef"] = lambdaref_; 87 dvinfo["Lambda"] = lambda_; 88 POutPersist po(flnm); 89 po << hrep_; 90 po << dvinfo; 91 } 92 93 void Four2DRespTable::readFromPPF(string flnm) 94 { 95 PInPersist pin(flnm); 96 DVList dvinfo; 97 pin >> hrep_; 98 pin >> dvinfo; 99 dx_ = dy_ = dvinfo["DoL"]; 100 setLambdaRef((double)dvinfo["LambdaRef"]); 101 setLambda((double)dvinfo["Lambda"]); 102 } 103 104 105 77 106 //--------------------------------------------------------------- 78 107 // -- Four2DRespRatio : rapport de la reponse entre deux objets Four2DResponse … … 87 116 double ra = a_.Value(kx,ky); 88 117 double rb = b_.Value(kx,ky); 89 if (rb<divzthr_) { 90 if (ra<rb) return 0.; 91 else rb=divzthr_; 92 } 118 if (ra<rb) { 119 if (rb>1.e-39) return(ra/rb); 120 else return 0.; 121 } 122 if (rb<divzthr_) rb=divzthr_; 93 123 return (ra/rb); 94 124 } -
trunk/Cosmo/RadioBeam/mdish.h
r3789 r3792 61 61 class Four2DRespTable : public Four2DResponse { 62 62 public: 63 // Constructeur sans argument, utilise pour lire depuis un fichier 64 Four2DRespTable(); 63 65 // On donne dx=D/lambda=Dx/lambda , dy=Dy/lambda 64 Four2DRespTable(Histo2D const & hrep, double d );66 Four2DRespTable(Histo2D const & hrep, double d, double lambda=1.); 65 67 // Return the 2D response for wave vector (kx,ky) 66 68 virtual double Value(double kx, double ky); 69 70 void writeToPPF(string flnm); 71 void readFromPPF(string flnm); 72 67 73 Histo2D hrep_; 68 74 }; -
trunk/Cosmo/RadioBeam/pknoise.cc
r3769 r3792 9 9 #include "mdish.h" 10 10 #include "specpk.h" 11 #include "interfconfigs.h" 12 11 13 #include "histinit.h" 12 14 // #include "fiosinit.h" … … 55 57 }; 56 58 57 //-----------------------------------------------------------------------------------58 // Fonctions de creation de configuration d'interfero avec des dishs59 //-----------------------------------------------------------------------------------60 61 vector<Dish> CreateFilledSqConfig(int nd, double Ddish=5., double Eta=0.9);62 vector<Dish> CreateSemiFilledSqConfig(int nd, double Ddish=5., double Eta=0.9);63 vector<Dish> CreateConfigA(double Ddish=5., double Eta=0.9);64 vector<Dish> CreateConfigB(double Ddish=5., double Eta=0.9);65 vector<Dish> CreateConfigC(double Ddish=5., double Eta=0.9);66 vector<Dish> CreateConfigD(double Ddish=5., double Eta=0.9);67 68 69 vector<Dish> CreateFilledCylConfig(int ncyl, int nRL, double cylW=10., double cylRL=0.5,70 double etaW=0.9, double etaRL=0.9, bool fgscid=true);71 59 72 60 … … 352 340 353 341 354 //-----------------------------------------------------------------------------------355 //-----------------------------------------------------------------------------------356 // Fonctions de creation de configuration d'interfero avec des dishs357 //-----------------------------------------------------------------------------------358 /* --Fonction -- */359 vector<Dish> CreateFilledSqConfig(int nd, double Ddish, double Eta)360 {361 vector<Dish> vd;362 int cnt=0;363 for(int i=0; i<nd; i++)364 for(int j=0; j<nd; j++) {365 cnt++;366 vd.push_back(Dish(cnt, i*Ddish, j*Ddish, Eta*Ddish));367 }368 cout << ">>>CreateFilledSqConfig(" << nd << "," << Ddish << "," << Eta << ") ---> NDishes=" << vd.size() << endl;369 370 return vd;371 }372 373 /* --Fonction -- */374 vector<Dish> CreateSemiFilledSqConfig(int nd, double Ddish, double Eta)375 {376 vector<Dish> vd;377 int cnt=0;378 int fgst=1;379 for(int i=0; i<nd; i++) {380 fgst = (fgst+1)%2;381 for(int j=0; j<nd; j++) {382 if (j%2==fgst) continue;383 cnt++;384 vd.push_back(Dish(cnt, i*Ddish, j*Ddish, Eta*Ddish));385 }386 }387 cout << ">>>CreateSemiFilledSqConfig(" << nd << "," << Ddish << "," << Eta << ") ---> NDishes=" << vd.size() << endl;388 389 return vd;390 }391 392 /* --Fonction -- */393 vector<Dish> CreateConfigA(double Ddish, double Eta)394 {395 vector<Dish> vd;396 int cnt=0;397 for(int i=0; i<18; i++) {398 cnt++; vd.push_back(Dish(cnt, i*Ddish,0.,Eta*Ddish));399 cnt++; vd.push_back(Dish(cnt, i*Ddish, 17.*Ddish,Eta*Ddish));400 if ((i>0)&&(i<17)) {401 cnt++; vd.push_back(Dish(cnt,0.,i*Ddish,Eta*Ddish));402 cnt++; vd.push_back(Dish(cnt,17.*Ddish,i*Ddish,Eta*Ddish));403 }404 }405 cout << ">>>CreateConfigA(" << Ddish << "," << Eta << ") ---> NDishes=" << vd.size() << endl;406 return vd;407 }408 409 /* --Fonction -- */410 vector<Dish> CreateConfigB(double Ddish, double Eta)411 {412 vector<Dish> vd;413 int cnt=0;414 /*415 for(int i=0; i<13; i++) {416 cnt++; vd.push_back(Dish(cnt, i*Ddish,0.,Eta*Ddish));417 cnt++; vd.push_back(Dish(cnt, i*Ddish, 12.*Ddish,Eta*Ddish));418 if ((i>0)&&(i<12)) {419 cnt++; vd.push_back(Dish(cnt,0.,i*Ddish,Eta*Ddish));420 cnt++; vd.push_back(Dish(cnt,12.*Ddish,i*Ddish,Eta*Ddish));421 }422 }423 for(int i=0; i<5; i++) {424 cnt++; vd.push_back(Dish(cnt, (i+4)*Ddish,4.*Ddish,Eta*Ddish));425 cnt++; vd.push_back(Dish(cnt, (i+4)*Ddish, 8.*Ddish,Eta*Ddish));426 if ((i>0)&&(i<4)) {427 cnt++; vd.push_back(Dish(cnt,4.*Ddish,(i+4)*Ddish,Eta*Ddish));428 cnt++; vd.push_back(Dish(cnt,8.*Ddish,(i+4)*Ddish,Eta*Ddish));429 }430 }431 */432 for(int i=0; i<11; i++) {433 cnt++; vd.push_back(Dish(cnt, i*Ddish,0.,Eta*Ddish));434 cnt++; vd.push_back(Dish(cnt, i*Ddish, 10.*Ddish,Eta*Ddish));435 if ((i>0)&&(i<10)) {436 cnt++; vd.push_back(Dish(cnt,0.,i*Ddish,Eta*Ddish));437 cnt++; vd.push_back(Dish(cnt,10.*Ddish,i*Ddish,Eta*Ddish));438 }439 }440 for(int i=0; i<7; i++) {441 cnt++; vd.push_back(Dish(cnt, (i+2)*Ddish, 2.*Ddish,Eta*Ddish));442 cnt++; vd.push_back(Dish(cnt, (i+2)*Ddish, 8.*Ddish,Eta*Ddish));443 if ((i>0)&&(i<6)) {444 cnt++; vd.push_back(Dish(cnt,2.*Ddish,(i+2)*Ddish,Eta*Ddish));445 cnt++; vd.push_back(Dish(cnt,8.*Ddish,(i+2)*Ddish,Eta*Ddish));446 }447 }448 for(int i=0; i<3; i++) {449 cnt++; vd.push_back(Dish(cnt, (i+4)*Ddish, 4.*Ddish,Eta*Ddish));450 cnt++; vd.push_back(Dish(cnt, (i+4)*Ddish, 6.*Ddish,Eta*Ddish));451 if ((i>0)&&(i<2)) {452 cnt++; vd.push_back(Dish(cnt,4.*Ddish,(i+4)*Ddish,Eta*Ddish));453 cnt++; vd.push_back(Dish(cnt,6.*Ddish,(i+4)*Ddish,Eta*Ddish));454 }455 }456 457 458 cout << ">>>CreateConfigB(" << Ddish << "," << Eta << ") ---> NDishes=" << vd.size() << endl;459 return vd;460 }461 462 463 /* --Fonction -- */464 vector<Dish> CreateConfigC(double Ddish, double Eta)465 {466 vector<int_4> lesx, lesy;467 468 int max = 16;469 for(int i=0; i<4; i++)470 for(int j=0; j<4; j++) {471 lesx.push_back(i); lesy.push_back(j);472 lesx.push_back(max-i); lesy.push_back(max-j);473 lesx.push_back(i); lesy.push_back(max-j);474 lesx.push_back(max-i); lesy.push_back(j);475 }476 477 for(int i=5; i<12; i+=2) {478 lesx.push_back(i); lesy.push_back(0);479 lesx.push_back(i); lesy.push_back(max);480 lesx.push_back(0); lesy.push_back(i);481 lesx.push_back(max); lesy.push_back(i);482 }483 484 for(int i=4; i<=12; i+=2)485 for(int j=4; j<=12; j+=2) {486 lesx.push_back(i); lesy.push_back(j);487 }488 489 for(int i=5; i<=11; i+=2) {490 lesx.push_back(i); lesy.push_back(4);491 lesx.push_back(i); lesy.push_back(max-4);492 lesx.push_back(4); lesy.push_back(i);493 lesx.push_back(max-4); lesy.push_back(i);494 }495 496 EnumeratedSequence esx,esy;497 esx = 2,5;498 esy = 5,2;499 500 for(int k=0; k<esx.Size(); k++) {501 int_4 ix=esx.Value(k);502 int_4 iy=esy.Value(k);503 504 lesx.push_back(ix); lesy.push_back(iy);505 lesx.push_back(max-ix); lesy.push_back(iy);506 lesx.push_back(ix); lesy.push_back(max-iy);507 lesx.push_back(max-ix); lesy.push_back(max-iy);508 }509 cout << "CreateConfigC/Debug: -checkSize/lesx=" << lesx.size() << " -Check/lesy=" << lesy.size() << endl;510 511 vector<Dish> vd;512 int cnt=0;513 for(size_t i=0; i<lesx.size(); i++) {514 cnt++; vd.push_back(Dish(cnt, ((double)lesx[i])*Ddish,((double)lesy[i])*Ddish,Eta*Ddish));515 }516 517 cout << ">>>CreateConfigC(" << Ddish << "," << Eta << ") ---> NDishes=" << vd.size() << endl;518 519 return vd;520 521 }522 /* --Fonction -- */523 vector<Dish> CreateConfigD(double Ddish, double Eta)524 {525 EnumeratedSequence es;526 es = 0,1,3,4,6,8,10,12,14,16,18,20,22,24,25,27,28;527 vector<int_4> lesx, lesy;528 for(int k=0; k<es.Size(); k++) {529 lesx.push_back(es.Value(k)); lesy.push_back(0);530 lesx.push_back(es.Value(k)); lesy.push_back(28);531 }532 for(int k=1; k<es.Size()-1; k++) {533 lesy.push_back(es.Value(k)); lesx.push_back(0);534 lesy.push_back(es.Value(k)); lesx.push_back(28);535 }536 for(int k=1; k<=5; k++) {537 lesy.push_back(k); lesx.push_back(5);538 lesy.push_back(28-k); lesx.push_back(28-5);539 if (k!=5) {540 lesx.push_back(k); lesy.push_back(5);541 lesx.push_back(28-k); lesy.push_back(28-5);542 }543 544 lesy.push_back(k); lesx.push_back(28-5);545 lesy.push_back(28-k); lesx.push_back(5);546 if (k!=5) {547 lesx.push_back(28-k); lesy.push_back(5);548 lesx.push_back(k); lesy.push_back(28-5);549 }550 }551 552 for(int k=6; k<=13; k++) {553 lesy.push_back(k); lesx.push_back(k);554 lesy.push_back(28-k); lesx.push_back(28-k);555 lesy.push_back(k); lesx.push_back(28-k);556 lesy.push_back(28-k); lesx.push_back(k);557 }558 559 560 lesx.push_back(14); lesy.push_back(14);561 562 EnumeratedSequence esx,esy;563 esx = 1,2,4;564 esy = 12,11,13;565 566 for(int k=0; k<esx.Size(); k++) {567 int_4 ix=esx.Value(k);568 int_4 iy=esy.Value(k);569 lesx.push_back(ix); lesy.push_back(iy);570 lesx.push_back(28-ix); lesy.push_back(iy);571 lesx.push_back(ix); lesy.push_back(28-iy);572 lesx.push_back(28-ix); lesy.push_back(28-iy);573 574 lesy.push_back(ix); lesx.push_back(iy);575 lesy.push_back(28-ix); lesx.push_back(iy);576 lesy.push_back(ix); lesx.push_back(28-iy);577 lesy.push_back(28-ix); lesx.push_back(28-iy);578 }579 for(int k=5; k<=13; k+=2) {580 lesy.push_back(k); lesx.push_back(14);581 lesy.push_back(28-k); lesx.push_back(14);582 lesy.push_back(14); lesx.push_back(k);583 lesy.push_back(14); lesx.push_back(28-k);584 }585 586 cout << "CreateConfigB/Debug: -checkSize/lesx=" << lesx.size() << " -Check/lesy=" << lesy.size() << endl;587 588 vector<Dish> vd;589 int cnt=0;590 for(size_t i=0; i<lesx.size(); i++) {591 cnt++; vd.push_back(Dish(cnt, ((double)lesx[i])*Ddish,((double)lesy[i])*Ddish,Eta*Ddish));592 }593 594 cout << ">>>CreateConfigD(" << Ddish << "," << Eta << ") ---> NDishes=" << vd.size() << endl;595 596 return vd;597 }598 599 /* --Fonction -- */600 vector<Dish> CreateFilledCylConfig(int ncyl, int nRL, double cylW, double cylRL, double etaW, double etaRL, bool fgscid)601 {602 vector<Dish> vd;603 int cnt=0;604 605 for(int i=0; i<ncyl; i++)606 for(int j=0; j<nRL; j++) {607 cnt++;608 int rid = (fgscid) ? i+1 : cnt;609 vd.push_back(Dish(rid, i*cylW, j*cylRL, etaW*cylW, etaRL*cylRL));610 }611 cout << ">>>CreateFilledCylConfig(" << ncyl << "," << nRL << "," << cylW << "," << cylRL << ","612 << etaW << "," << etaRL << "," << ((fgscid)?" RId=CylNum":"Cnt")613 << ") ---> NDishes=" << vd.size() << endl;614 615 return vd;616 }
Note:
See TracChangeset
for help on using the changeset viewer.