Changeset 2051 in Sophya
- Timestamp:
- Jun 11, 2002, 10:39:57 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaProg/PrgMap/map2cl.cc
r1841 r2051 34 34 -iter_order lval : 1,2,3,4... order of an iterative analysis, 35 35 3rd order is usually optimal (default=0 -> standard analysis) 36 -fitsout: Select the FITS format for the output map (default PPF format) 37 -fitsin : Select the FITS format for the input vector (default PPF format) 36 -keepalm : Save Alm's as a 2-D array (Matrix) 37 -fitsout: Select the FITS format for the output vector/alm's (default PPF format) 38 -fitsin : Select the FITS format for the input map (default PPF format) 38 39 InFileName : Input file name (HEALPix map) 39 OutFileName : Output file name (the C_l vector )40 OutFileName : Output file name (the C_l vector / and Alm's) 40 41 41 42 \endverbatim … … 53 54 cout << " map2cl : Spherical harmonics analysis - HEALPix map -> Power spectrum C_l \n" 54 55 << " Usage: map2cl [-float/-r4] [-lmax lval] [-thetacut dtdeg] [-iter_order lval]\n" 55 << " [- fitsin] [-fitsout] InFileName OutFileName \n"56 << " [-keepalm AlmFileName] [-fitsin] [-fitsout] InFileName OutFileName \n" 56 57 << " -float (-r4): single precision C_l and map (default = double) \n" 57 58 << " -lmax lval: Maximum value for l index (default=255)\n" 58 59 << " -thetacut dtdeg : Symmetric delta-theta cut (in degree) along equator \n" 59 60 << " (default=0 -> no cut)\n" 60 << " -iter_order lval : 1,2,3,4... order of an iterative analysis , 3rd order is usually optimal (default=0 -> standard analysis)\n" 61 << " -fitsout: Select the FITS format for the output map (default PPF format) \n" 62 << " -fitsin : Select the FITS format for the input vector (default PPF format) \n" 61 << " -iter_order lval : 1,2,3,4... order of an iterative analysis\n" 62 << " 3rd order is usually optimal (default=0 -> standard analysis)\n" 63 << " -keepalm : Save Alm's as a 2-D complex array (Matrix<complex>) - only with PPF format \n" 64 << " -fitsout: Select the FITS format for the output files (Map/Alm) (default PPF format) \n" 65 << " -fitsin : Select the FITS format for the input map (default PPF format) \n" 63 66 << " InFileName : Input file name (HEALPix map) \n" 64 67 << " OutFileName : Output file name (the C_l vector) \n" << endl; … … 72 75 public : 73 76 static void ComputeCl(string & infile, string & outfile, int lmax, double tcut, 74 int iterationOrder, bool fgfitsin, bool fgfitsout )77 int iterationOrder, bool fgfitsin, bool fgfitsout, bool keepalm) 75 78 { 76 79 double deg2rad = M_PI/180.; … … 98 101 // Decomposition de la carte en C_l 99 102 SphericalTransformServer<T> sphtr; 100 TVector<T> clvec = sphtr.DecomposeToCl(sph, lmax, ctcut, iterationOrder); 101 103 TVector<T> clvec; 104 TMatrix< complex<T> > almmtx; 105 if (keepalm) { 106 Alm<T> alm(lmax); 107 sphtr.DecomposeToAlm(sph, alm, lmax, ctcut, iterationOrder); 108 almmtx.SetSize(alm.Lmax()+1, alm.Lmax()+1); 109 for(int il=0; il<alm.Lmax()+1; il++) 110 for(int im=0; im<il; im++) 111 almmtx(il, im) = alm(il, im); 112 clvec = alm.powerSpectrum(); 113 } 114 else { 115 clvec = sphtr.DecomposeToCl(sph, lmax, ctcut, iterationOrder); 116 } 102 117 T min, max; 103 118 double mean, sigma; … … 109 124 110 125 if (fgfitsout) { 126 FitsOutFile fio(outfile, FitsFile::clear); 111 127 cout << "--- Writing C_l vector to Output FITS file " << outfile << endl; 112 FitsOutFile fio(outfile, FitsFile::clear);113 128 fio << clvec; 114 129 } 115 130 else { 116 cout << "--- Writing C_l vector to Output PPF file " << outfile << endl;117 131 POutPersist ppo(outfile); 118 ppo << clvec; 132 if (keepalm) { 133 cout << "--- Writing C_l vector to Output PPF file " << outfile << endl; 134 ppo.PutObject(clvec, "Cl"); 135 cout << "--- Writing Alm Matrix to Output PPF file " << outfile << endl; 136 ppo.PutObject(almmtx, "Alm"); 137 } 138 else { 139 cout << "--- Writing C_l vector to Output PPF file " << outfile << endl; 140 ppo << clvec; 141 } 119 142 } 120 143 } … … 135 158 bool fgfitsout = false; 136 159 bool fgr4 = false; 160 bool fgkeepalm = false; 137 161 cout << " map2cl : Decoding command line options ... " << endl; 138 162 … … 156 180 else if (strcmp(arg[k], "-fitsout") == 0) { 157 181 fgfitsout = true; 182 } 183 else if (strcmp(arg[k], "-keepalm") == 0) { 184 fgkeepalm = true; 158 185 } 159 186 else if ((strcmp(arg[k], "-float") == 0) || (strcmp(arg[k], "-r4") == 0) ) { … … 174 201 if (fgr4) { 175 202 cout << " SphereHEALPix<r_4> --> Power spectrum C_l<r_4> (float)" << endl; 176 _Map2Cl<r_4>::ComputeCl(infile, outfile, lmax, tcut, iterationOrder, fgfitsin, fgfitsout); 203 _Map2Cl<r_4>::ComputeCl(infile, outfile, lmax, tcut, iterationOrder, 204 fgfitsin, fgfitsout, fgkeepalm); 177 205 } 178 206 else { 179 207 cout << " SphereHEALPix<r_8> --> Power spectrum C_l<r_8> (double)" << endl; 180 _Map2Cl<r_8>::ComputeCl(infile, outfile, lmax, tcut, iterationOrder,fgfitsin, fgfitsout); 208 _Map2Cl<r_8>::ComputeCl(infile, outfile, lmax, tcut, iterationOrder, 209 fgfitsin, fgfitsout, fgkeepalm); 181 210 } 182 211 }
Note:
See TracChangeset
for help on using the changeset viewer.