Changeset 900 in Sophya for trunk/SophyaProg/PMixer/extractRS.cc


Ignore:
Timestamp:
Apr 13, 2000, 10:06:55 AM (25 years ago)
Author:
ansari
Message:

Sophie: new FITS_IO server implementation...correction of a bug

File:
1 edited

Legend:

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

    r884 r900  
    1919#include "datacards.h"
    2020#include "fitsioserver.h"
    21 
     21#include "fitsspherehealpix.h"
    2222#include "radspecvector.h"
    2323#include "blackbody.h"
     
    2828#include "specrespvector.h"
    2929#include "gaussfilt.h"
    30 
     30#include "fitstarray.h"
    3131// -----------------------------------------------------------------
    3232// ------------- Function declaration ------------------------------
     
    102102  try {
    103103   
    104     FitsIoServer fios; // Our FITS IO Server
     104    //    FitsIoServer fios; // Our FITS IO Server
    105105    char * flnm, buff[90];
    106106    string key;
     
    123123        TMatrix<float> ings;   
    124124        // Opening the file containing the map
    125        
    126         if (printlev > 2) cout << " Processing map's frequency component No " << sk+1 << endl;
     125        cout << "-------------------" << endl;
     126        cout << " Processing map's frequency component No " << sk+1 << endl;
    127127        sprintf(buff, "%d", sk+1);
    128128        key = (string)"RADSPECMAP" + buff;
    129129       
    130130        flnm = BuildFITSFileName(dc.SParam(key,0));
    131         if (printlev > 2) cout << " Reading Input FITS map " << (string)flnm << endl;
    132        
    133         fios.load(ings, flnm) ;
     131        cout << " Reading Input FITS map " << (string)flnm << endl;
     132        FITS_TArray<float> read_input(flnm);
     133        ings = (TArray<float>)read_input;
     134
    134135        if (printlev > 2)
    135136          {
     
    232233        int randomPix = random*OutputMap.NbPixels();
    233234        int outpix = random*nbOfPix;
    234         OutputMap(i) = outCoeff(outpix)*1.e18;
     235        OutputMap(i) = outCoeff(outpix);
    235236      }
    236237
     
    256257        int outPix = random*OutputMap.NbPixels();
    257258        SourceMap(outPix) = sourceCoeff(i);
    258         OutputMap(outPix) = OutputMap(i)+ SourceMap(outPix)*1.E18;
     259        OutputMap(outPix) = OutputMap(i)+ SourceMap(outPix);
    259260      }
    260261  } 
     
    287288      //       }
    288289      {
    289         FitsIoServer fios;
    290         fios.save(OutputMap, arg[2]);
    291         double moy,sig;
    292         MeanSig(OutputMap.DataBlock(),moy,sig);
    293         cout << " MeanSig for Output Map - Mean= " << moy << " Sigma= " << sig << endl;
    294         cout << "Output Map (SphereHEALPix<float>) written to FITS file "
    295              << (string)(arg[2]) << endl;
     290         FITS_SphereHEALPix<float> fios2(OutputMap);
     291         fios2.Write(arg[2]);
     292         double moy,sig;
     293         MeanSig(OutputMap.DataBlock(),moy,sig);
     294         cout << " MeanSig for Output Map - Mean= " << moy << " Sigma= " << sig << endl;
     295         cout << "Output Map (SphereHEALPix<float>) written to FITS file "
     296              << (string)(arg[2]) << endl;
    296297      }
    297298      if(printlev>2) PrtTim("End of WriteFITS ");
     
    422423
    423424  if (dc.HasKey(key) ) {      // Reading FITS filter file
    424     FitsIoServer fios;
    425425    char ifnm[256];
    426426    strncpy(ifnm, dc.SParam(key, 1).c_str(), 255);
    427427    ifnm[255] = '\0';
    428     Matrix mtx(2,10);
    429     fios.load(mtx, ifnm);
     428    TMatrix<float> mtx(2,10);
     429    FITS_TArray<float> read_input(ifnm);
     430    mtx = (TMatrix<float>)read_input;
     431
    430432    double numin = dc.DParam(key, 2, 1.);
    431433    double numax = dc.DParam(key, 3, 9999.);
Note: See TracChangeset for help on using the changeset viewer.