Changeset 931 in Sophya for trunk/SophyaProg/PMixer/tgsky.cc


Ignore:
Timestamp:
Apr 14, 2000, 3:37:06 PM (25 years ago)
Author:
ansari
Message:

Sophie: adapt to new class MapOperations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaProg/PMixer/tgsky.cc

    r928 r931  
    1 #include "machdefs.h"
    2 #include <iostream.h>
    3 #include <math.h>
     1#include "pmixer.h"
     2#include "mapoperation.h"
    43
    5 #include "sambainit.h"
    6 #include "spherehealpix.h"
    7 #include "fiospherehealpix.h"
    8 #include "fitsioserver.h"
    9 #include "nbrandom.h"
    10 #include "bruit.h"
    11 #include "timing.h"
    124/*! \ingroup PMixer
    13   \file tgsky.cc
     5 * \file tgsky.cc
    146 * \brief \b PROGRAM \b tgsky  <BR>
    157 * \l Program which generates different types of random skies
    168 */
     9// ------------- Main program --------------
    1710
    18 // Test program to generate different type of random skies
    19 template <class T>
    20 void  MeanSig(PixelMap<T> const & map, double& gmoy, double& gsig);
    21 
    22 // ------------- Main program --------------
    2311int main(int narg, char* arg[])
    2412{
     
    10290
    10391  // Computing mean and sigma on the sphere
    104   MeanSig(sph, gmoy, gsig);
     92  MeanSig(sph.DataBlock(), gmoy, gsig);
    10593  cout << "SphereHEALPix<float> Mean= " << gmoy << "  Sigma = " << gsig << endl;
    10694  PrtTim("End of Mean-Sig ");
     
    126114}
    127115
    128 /* Nouvelle-Methode */
    129 template <class T>
    130 void  MeanSig(PixelMap<T> const & map, double& gmoy, double& gsig)
    131 
    132 {
    133   gmoy=0.;
    134   gsig = 0.;
    135   double valok;
    136   for(int k=0; k<map.NbPixels(); k++) {
    137     valok = map(k);
    138     gmoy += valok;  gsig += valok*valok;
    139   }
    140   gmoy /= (double)map.NbPixels();
    141   gsig = gsig/(double)map.NbPixels() - gmoy*gmoy;
    142   if (gsig >= 0.) gsig = sqrt(gsig);
    143 }
Note: See TracChangeset for help on using the changeset viewer.