Changeset 3507 in Sophya for trunk/SophyaProg


Ignore:
Timestamp:
Aug 8, 2008, 12:53:04 PM (17 years ago)
Author:
ansari
Message:

modif prog test pour appel a SphereECP::ExtractPartial() , Reza 08/08/2008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaProg/Tests/tsphereecp.cc

    r2615 r3507  
    1010#include <typeinfo>
    1111#include "timing.h"
     12#include "resusage.h"
     13
    1214#include "sphereecp.h"
    1315#include "fiosphereecp.h"
     
    2123  try {
    2224    SophyaInit();
     25    ResourceUsage ru;
    2326   
    2427    InitTim();
     
    3134    ecp2 += 4.;
    3235    cout << " ecp2 = ecp+4. = \n " << ecp2 ;
     36   
    3337    {
    3438      cout << " Writing ecp ecp2 to POutPersist sphecp.ppf " << endl;
     
    4549      cout << recp2;
    4650    }
     51   
     52    // On cree une carte complete et on la remplit
     53    SphereECP<r_4> ecpf(200);
     54    for(int_4 kk=0; kk<ecpf.NbPixels(); kk++) {
     55      double tet, phi;
     56      ecpf.PixThetaPhi(kk, tet, phi);
     57      ecpf(kk) = sin(tet)*cos(phi);
     58    }
     59    // Extraction d'une carte partielle de ecpf
     60    SphereECP<r_4> ecpex = ecpf.ExtractPartial(M_PI/2.-M_PI/12., M_PI/2.+M_PI/12, 0.23, 0.23+M_PI/2.5);
     61    cout << " ecpf (full) and ecpex (extracted partiel) created ... " << endl;
     62    cout << ecpf << ecpex ;
     63    {
     64      cout << " Writing ecpf ecpex to POutPersist sphecpfp.ppf " << endl;
     65      POutPersist po("sphecpfp.ppf");
     66      po << PPFNameTag("ecpf") << ecpf << PPFNameTag("ecpex") << ecpex;
     67    }
     68         
    4769    // Test avec transforme Ylm
    4870    int lmax = 92;
     
    5981    cout << " Computing Cl from map " << endl;
    6082    Vector clout = ylmserver.DecomposeToCl(map, lmax,  0.);
     83   
    6184    SphereECP<r_8> mappar(0.25*M_PI, 0.75*M_PI, 128, 0.25*M_PI, 1.25*M_PI, 256);
    6285    cout << " Generating partial map from Cl " << endl;
     
    6588    Vector cloutpar = ylmserver.DecomposeToCl(mappar, lmax,  0.);
    6689
     90    cout << " Extracting partial map and Computing Cl from mapex " << endl;
     91    SphereECP<r_8> mapex = map.ExtractPartial(0.25*M_PI, 0.75*M_PI, 0.25*M_PI, 1.25*M_PI);
     92    Vector clmex = ylmserver.DecomposeToCl(mapex, lmax,  0.);
     93
    6794    cout << " Writing clin, map, clout to ecpylm.ppf" << endl;
    6895    POutPersist so("ecpylm.ppf");
    6996    so << PPFNameTag("clin") << clin <<  PPFNameTag("map") << map
    7097       << PPFNameTag("clout") << clout ;
     98    cout << " Writing mapex, clmex to ecpylm.ppf" << endl;
     99    so << PPFNameTag("clmex") << clmex <<  PPFNameTag("mapex") << mapex;
    71100    cout << " Writing mappar, cloutpar to ecpylm.ppf" << endl;
    72101    so << PPFNameTag("mappar") << mappar
    73102       << PPFNameTag("cloutpar") << cloutpar ;
     103   
     104    cout << " --> End of tsphereecp computations \n" << ru;
     105   
    74106  }
    75107  catch (PThrowable & exc) {
Note: See TracChangeset for help on using the changeset viewer.