Changeset 3932 in Sophya for trunk/Cosmo
- Timestamp:
- Dec 23, 2010, 7:33:37 PM (15 years ago)
- Location:
- trunk/Cosmo/RadioBeam
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/RadioBeam/mdish.cc
r3931 r3932 183 183 SetThetaPhiRange(); 184 184 SetRespHisNBins(); 185 SetPrtLevel(); 185 186 mcnt_=0; 186 187 } … … 207 208 208 209 double dtet = thetamax_/(double)ntet_; 209 double dphi = phimax_/(double)ntet_; 210 double dphi = phimax_/(double)nphi_; 211 cout << " MultiDish::GetResponse() - ThetaMax=" << thetamax_ << " NTheta=" << ntet_ 212 << " PhiMax=" << phimax_ << " NPhi=" << nphi_ << endl; 210 213 211 214 double sumw = 0.; 212 for(int kt=0; kt<ntet_; kt++) 215 for(int kt=0; kt<ntet_; kt++) { 216 double theta=(double)kt*dtet; 213 217 for(int jp=0; jp<nphi_; jp++) { 214 sumw += CumulResp(rd, (double)kt*dtet, (double)jp*dphi); 215 sumw += CumulResp(rd, (double)kt*dtet, -(double)jp*dphi); 216 sumw += CumulResp(rd, (double)kt*dtet, (double)jp*dphi+M_PI); 217 sumw += CumulResp(rd, (double)kt*dtet, -(double)jp*dphi-M_PI); 218 double phi=(double)jp*dphi; 219 sumw += CumulResp(rd, theta, phi); 220 if (theta<1.e-9) continue; 221 sumw += CumulResp(rd, theta, -phi); 222 sumw += CumulResp(rd, theta, phi+M_PI); 223 sumw += CumulResp(rd, theta, -(phi+M_PI)); 218 224 } 225 if (prtlev_>0) cout << " MultiDish::GetResponse() done ktheta=" << kt << " / MaxNTheta= " << ntet_ << endl; 226 } 219 227 double kx1 = DeuxPI*(dishes_[0].DiameterX())/lambda_; 220 228 double ky1 = DeuxPI*(dishes_[0].DiameterY())/lambda_; -
trunk/Cosmo/RadioBeam/mdish.h
r3930 r3932 120 120 MultiDish(double lambda, double dmax, vector<Dish>& dishes, bool fgnoauto=false); 121 121 122 // Pour phi, les angles phi, -phi, phi+pi, -(phi+pi) sont prises en compte 122 123 inline void SetThetaPhiRange(double thetamax=0., int ntet=1, double phimax=0., int nphi=1) 123 124 { thetamax_=thetamax; ntet_=ntet; phimax_=phimax; nphi_=nphi; } 125 126 inline int SetPrtLevel(int lev=0, int prtmod=10) 127 { int olev=prtlev_; prtlev_=lev; prtmodulo_=prtmod; return olev; } 124 128 125 129 inline void SetRespHisNBins(int nx=128, int ny=128) … … 145 149 QHis2D h2w_; 146 150 int mcnt_; 151 int prtlev_,prtmodulo_; 147 152 }; 148 153 -
trunk/Cosmo/RadioBeam/repicon.cc
r3931 r3932 3 3 R. Ansari , C. Magneville - Juin-Dec 2010 4 4 5 Usage: repicon configId OutPPFName [z_Redshift=0.7] [RenormalizeMax]5 Usage: repicon [-parname value] configId OutPPFName 6 6 --------------------------------------------------------------- */ 7 7 … … 39 39 // --------------------------------------------------------------------- 40 40 41 void Usage() 42 { 43 cout << " Usage: repicon [-parname Value] configId OutPPFName \n" 44 << " configIds: f4x4,f8x8,f20x20, confA,confB,confC,confD, hex12,cross11, f3cyl,f8cyl,f3cylp,f8cylp \n" 45 << " f4x4 , f8x8 , f20x20 Filled array of nxn dishes \n" 46 << " confA , confB, confC, confD : semi-filled array of dishes \n" 47 << " hex12,cross11 : ASKAP like double hexagonal (12xD=12m), cross config (11xD=12m) \n" 48 << " f3cyl, f8cyl , f3cylp, f8cylp : filled array of non perfect/perfect of n cylinders \n" 49 << " [ -parname value] : -renmax -z -prt -D -lmax \n" 50 << " -renmax MaxValue (default : Do NOT renormalize 2D response value \n" 51 << " -z redshift (default=0.7) --> determines Lambda \n" 52 << " -D DishDiameter (default=5 m) \n" 53 << " -lmax array extension (default=100 m ) for response calculation kmax \n" 54 << " -rot ThetaMaxDeg,NTheta,PhiMaxDeg,NPhi (default NO-rotate/pointing -> 23,10,30,15 ) \n" 55 << " -prt PrtLev,PrtModulo (default=0,10) \n" 56 << endl; 57 return; 58 } 59 41 60 // ------------------ MAIN PROGRAM ------------------------------ 42 61 int main(int narg, const char* arg[]) 43 62 { 44 63 if (((narg>1)&&(strcmp(arg[1],"-h")==0))||(narg<3)) { 45 cout << " Usage: repicon configId OutPPFName [z_redshift=0.7] [RenormalizeMax] \n" 46 << " configs: f4x4 , f8x8 , f20x20 Filled array of nxn dishes (D=5m) \n" 47 << " confA , confB, confC, confD : semi-filled array of dishes \n" 48 << " hex12,cross11 : ASKAP like double hexagonal (12xD=12m), cross config (11xD=12m) \n" 49 << " f3cyl, f8cyl , f3cylp, f8cylp : filled array of non perfect/perfect of n cylinders " << endl; 64 Usage(); 50 65 return 1; 51 66 } 52 cout << " ==== repicon.cc program , (u,v) plane response ==== " << endl;53 67 // make sure SOPHYA modules are initialized 54 68 SophyaInit(); … … 57 71 //--- decoding command line arguments 58 72 string config = "f8x8" ; 59 if (narg>1) config = arg[1];60 73 string outfile = "repicon.ppf"; 61 if (narg>2) outfile = arg[2];62 if (outfile==".") outfile = "repicon.ppf";63 double LAMBDA=0.357 ; // 21 cm at z=0.764 if (narg>3) LAMBDA = atof(arg[3]);65 74 bool fgrenorm=false; 66 75 double rmax=1.; 67 if (narg>4) { 68 rmax=atof(arg[4]); 69 fgrenorm=true; 70 } 76 double z_Redshift=0.7 ; // 21 cm at z=0.7 -> 0.357 m 77 int prtlev=0; 78 int prtmod=10; 79 80 double Ddish=5.; 81 bool fgDfixed=false; 82 double LMAX = 100.; // taille de la zone, pour calcul kmax 83 bool fgLMAXfixed=false; 84 double thetamxdeg=23.; // 23 degres : angle d'inclinaison de l'orbite terrestre 85 double phimxdeg=30.; 86 int nteta=10; 87 int nphi=15; 88 bool fgpoint=false; 89 90 int ka=1; 91 while (ka<(narg-1)) { 92 if (strcmp(arg[ka],"-renmax")==0) { 93 rmax=atof(arg[ka+1]); fgrenorm=true; ka+=2; 94 } 95 else if (strcmp(arg[ka],"-z")==0) { 96 z_Redshift=atof(arg[ka+1]); ka+=2; 97 } 98 else if (strcmp(arg[ka],"-D")==0) { 99 Ddish=atof(arg[ka+1]); fgDfixed=true; ka+=2; 100 } 101 else if (strcmp(arg[ka],"-lmax")==0) { 102 LMAX=atof(arg[ka+1]); fgLMAXfixed=true; ka+=2; 103 } 104 else if (strcmp(arg[ka],"-rot")==0) { 105 sscanf(arg[ka+1],"%lg,%d,%lg,%d",&thetamxdeg,&nteta,&phimxdeg,&nphi); fgpoint=true; ka+=2; 106 } 107 else if (strcmp(arg[ka],"-prt")==0) { 108 sscanf(arg[ka+1],"%d,%d",&prtlev,&prtmod); ka+=2; 109 } 110 else break; 111 } 112 113 if ((ka+1)>=narg) { 114 cout << " repicon / Argument error " << endl; 115 Usage(); 116 return 2; 117 } 118 119 config = arg[ka]; 120 outfile = arg[ka+1]; 71 121 //-- end command line arguments 72 122 73 123 int rc = 1; 74 124 try { // exception handling try bloc at top level 75 76 double Ddish = 5.; 77 double Ddish2 = 7.5; 125 cout << " ==== repicon.cc program , (u,v) plane response ==== " << endl; 126 78 127 double Eta=0.95; 79 128 double cylW=12.; // Largeur des cylindres … … 82 131 double etaRL=0.9; // Efficacite de couverture le long du cylindre 83 132 84 double D = 100.; // Taille de la zone85 86 133 int cnt=0; 87 134 … … 89 136 cout << " repicon[1] : creating dish vector/ MultiDish for configuration: " << config << endl; 90 137 91 bool fgpoint=false;92 138 if (config=="f4x4") { 93 139 vdishes=CreateFilledSqConfig(4,Ddish, Eta); … … 116 162 } 117 163 else if (config=="confA") { 118 fgpoint=true;119 164 vdishes=CreateConfigA(Ddish, Eta); 120 165 } 121 166 else if (config=="confB") { 122 fgpoint=true;123 167 vdishes=CreateConfigB(Ddish, Eta); 124 168 } 125 169 else if (config=="confC") { 126 fgpoint=true;127 170 vdishes=CreateConfigC(Ddish, Eta); 128 171 } 129 172 else if (config=="confD") { 130 fgpoint=true;131 173 vdishes=CreateConfigD(Ddish, Eta); 132 174 } 133 175 else if (config=="cross11") { 134 fgpoint=true; 135 Ddish = 12.; 176 if (!fgDfixed) Ddish = 12.; 136 177 double base=20.; 137 178 Eta=0.95; 138 D=250.;179 if (!fgLMAXfixed) LMAX = 250.; 139 180 vdishes=CreateCrossConfig(Ddish,base,Eta); 140 181 } 141 182 else if (config=="hex12") { 142 fgpoint=true; 143 Ddish = 12.; 183 if (!fgDfixed) Ddish = 12.; 144 184 Eta=0.95; 145 D=350.;185 if (!fgLMAXfixed) LMAX = 350.; 146 186 vdishes=CreateDoubleHexagonConfig(Ddish); 147 187 } 148 149 188 else { 150 189 cout << " NON valid configuration option -> exit" << endl; 151 190 return 99; 152 191 } 153 154 double Dol = D/LAMBDA; 155 double LMAX = D; 192 193 H21Conversions conv; 194 double LAMBDA=0.357 ; // 21 cm at z=0.7 195 conv.setRedshift(z_Redshift); 196 LAMBDA = conv.getLambda(); 197 198 double Dol = LMAX/LAMBDA; 156 199 bool fgnoauto = true; 157 200 int NRX=200; 158 201 int NRY=200; 159 202 203 cout << " repicon[1] : Lambda=" << LAMBDA << " LMAX= " << LMAX << " NDishes=" << vdishes.size() 204 << " D-Dish=" << Ddish << " m." << endl; 205 160 206 MultiDish mdish(LAMBDA, LMAX, vdishes, fgnoauto); 207 mdish.SetPrtLevel(prtlev,prtmod); 161 208 mdish.SetRespHisNBins(NRX,NRY); 162 if (fgpoint) // 23 degres : angle d'inclinaison de l'orbite terrestre 163 mdish.SetThetaPhiRange(Angle(23.,Angle::Degree).ToRadian(),10, M_PI/6., 15); 209 210 if (fgpoint) { 211 cout << " repicon[1.b] : activating pointing , ThetaMaxDeg=" << thetamxdeg << " NTheta=" << nteta 212 << " PhiMaxDeg= " << phimxdeg << " NPhi" << nphi << endl; 213 mdish.SetThetaPhiRange(Angle(thetamxdeg,Angle::Degree).ToRadian(),nteta,Angle(phimxdeg,Angle::Degree).ToRadian(), nphi); 214 } 164 215 cout << " repicon[2] : calling mdish.GetResponse() ..."<< endl; 165 216
Note:
See TracChangeset
for help on using the changeset viewer.