Changeset 2983 in Sophya


Ignore:
Timestamp:
Jun 21, 2006, 5:51:29 PM (19 years ago)
Author:
ansari
Message:

Ajout commande szidx2resol ds le module skymapmdule.cc , Reza 21/6/2006

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/ProgPI/skymapmodule.cc

    r2976 r2983  
    4747
    4848  void Resol2SizeIndex(vector<string>& tokens);
     49  void SizeIndex2Resol(vector<string>& tokens);
    4950  void TypeMap(vector<string>& tokens);
    5051  void Map2Double(vector<string>& tokens);
     
    105106usage += "\n Usage: resol2szidx resol";
    106107mpiac->RegisterCommand(kw, usage, this, hgrp);
     108kw = "szidx2resol";
     109usage = "Compute resolution for a given SizeIndex (=nside for HEALPix)";
     110usage += "\n Usage: szidx2resol szidx_m";
     111mpiac->RegisterCommand(kw, usage, this, hgrp);
    107112
    108113kw = "typemap";
     
    287292  }
    288293  Resol2SizeIndex(tokens);
     294} else if(kw == "szidx2resol") {
     295  if(tokens.size()<1) {
     296    cout<<"Usage: szidx2resol szidx_m"<<endl;
     297    return(0);
     298  }
     299  SizeIndex2Resol(tokens);
    289300} else if(kw == "typemap") {
    290301  if(tokens.size()<1) {
     
    440451      << resrad << " radian  NPix ~= " << 4.*M_PI/(resrad*resrad)
    441452      << " \n  ===> nside=m_HEALPix= " << mh << "  m_ThetaPhi= " << mt << endl;
     453 return;
     454}
     455
     456void skymapmoduleExecutor::SizeIndex2Resol(vector<string>& tokens)
     457{
     458 int_4 m = atoi(tokens[0].c_str());
     459 double resh = SphereHEALPix<r_4>::SizeIndexToResol(m);
     460 double rest = SphereThetaPhi<r_4>::SizeIndexToResol(m);
     461 cout << "SizeIndex2Resol: SizeIndex (m)= " << m
     462      << "\n HEALPix:  " << Angle(resh).ToArcMin() << " arcmin "
     463      << " NPix= " << 12*m*m
     464      << "\n ThetaPhi: " << Angle(rest).ToArcMin() << " arcmin "
     465      << " NPix ~= " <<  4.*M_PI/(rest*rest) << endl;
    442466 return;
    443467}
Note: See TracChangeset for help on using the changeset viewer.