34 #include "fitshandle.h" 38 #include "string_utils.h" 39 #include "lsconstants.h" 45 Trafo maketrafo (
int num)
49 case 1:
return Trafo(2000,2000,Equatorial,Galactic);
50 case 2:
return Trafo(2000,2000,Galactic,Equatorial);
51 case 3:
return Trafo(2000,2000,Equatorial,Ecliptic);
52 case 4:
return Trafo(2000,2000,Ecliptic,Equatorial);
53 case 5:
return Trafo(2000,2000,Ecliptic,Galactic);
54 case 6:
return Trafo(2000,2000,Galactic,Ecliptic);
55 case 7:
return Trafo(1950,1950,Equatorial,Galactic);
56 case 8:
return Trafo(1950,1950,Galactic,Equatorial);
57 case 9:
return Trafo(1950,1950,Equatorial,Ecliptic);
58 case 10:
return Trafo(1950,1950,Ecliptic,Equatorial);
59 case 11:
return Trafo(1950,1950,Ecliptic,Galactic);
60 case 12:
return Trafo(1950,1950,Galactic,Ecliptic);
61 default: planck_fail(
"Unsupported transformation "+dataToString(num));
67 int main(
int argc,
const char **argv)
69 PLANCK_DIAGNOSIS_BEGIN
70 module_startup(
"rotalm_cxx", (argc==5)||(argc==7),
71 "Usage: rotalm_cxx <infile> <outfile> <itransform> <pol>\n" 72 "or : rotalm_cxx <infile> <outfile> <psi> <theta> <phi> <pol>\n\n" 73 "itransform: 1: Equatorial (2000) -> Galactic (2000)\n" 74 " 2: Galactic (2000) -> Equatorial (2000)\n" 75 " 3: Equatorial (2000) -> Ecliptic (2000)\n" 76 " 4: Ecliptic (2000) -> Equatorial (2000)\n" 77 " 5: Ecliptic (2000) -> Galactic (2000)\n" 78 " 6: Galactic (2000) -> Ecliptic (2000)\n" 79 " 7: Equatorial (1950) -> Galactic (1950)\n" 80 " 8: Galactic (1950) -> Equatorial (1950)\n" 81 " 9: Equatorial (1950) -> Ecliptic (1950)\n" 82 " 10: Ecliptic (1950) -> Equatorial (1950)\n" 83 " 11: Ecliptic (1950) -> Galactic (1950)\n" 84 " 12: Galactic (1950) -> Ecliptic (1950)\n\n" 85 "psi, theta, phi: Euler angles (in degrees)\n\n" 88 string infile = argv[1];
89 string outfile = argv[2];
90 bool polarisation = stringToData<bool>(argv[argc-1]);
94 int trafo = stringToData<int>(argv[3]);
95 Trafo tr(maketrafo(trafo));
100 rm.Make_CPAC_Euler_Matrix(degr2rad*stringToData<double>(argv[5]),
101 degr2rad*stringToData<double>(argv[4]),
102 degr2rad*stringToData<double>(argv[3]));
120 rotate_alm(almT,almG,almC,rm);
void write_Alm_to_fits(fitshandle &out, const Alm< xcomplex< T > > &alms, int lmax, int mmax, PDT datatype)
void read_Alm_from_fits(fitshandle &inp, Alm< xcomplex< T > > &alms, int lmax, int mmax)
void get_almsize_pol(const std::string &filename, int &lmax, int &mmax)
void get_almsize(fitshandle &inp, int &lmax, int &mmax)