Changeset 1161 in Sophya


Ignore:
Timestamp:
Aug 29, 2000, 6:14:59 PM (25 years ago)
Author:
ansari
Message:

Modifs programmes test - Reza 29/8/2000

Location:
trunk/SophyaProg/Tests
Files:
3 edited

Legend:

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

    r1107 r1161  
    7676     ra = ia;
    7777     cout << " ra = ia(= RegularSequence(10., 2.)) = \n " << ra << endl;
    78      cout << ra << endl; 
    7978     TArray<r_4> rb(5,3);
    8079     rb =  RegularSequence(20., .5); 
  • trunk/SophyaProg/Tests/timg.cc

    r837 r1161  
    33// Utilisation de la classe Image<T>
    44#include "ntoolsinit.h"
     5#include "array.h"
    56#include "cimage.h"
    67// Utilisation des generateurs aleatoires
     
    1819{
    1920int i,j;
     21double mean,sig;
    2022
     23try {
    2124// ----- ATTENTION -------
    2225// Initialisation de Sophya
     
    3235  for(j=0; j<200; j++) img(i,j) = imgo(i,j) =  frand01()*1000.+1000.;
    3336// Verification de la dynamique de l'image
    34 img.CheckDyn();
    35 img.Print();
     37MeanSigma(img, mean, sig);
     38cout << " img: Mean= " << mean << " Sigma= " << sig << endl;
     39cout << img ;
     40
    3641// On sauve l'image ds img.ppf (fichier  format PPersist)
    37 img.Write("img.ppf");
     42{
     43POutPersist po("img.ppf");
     44po << img;
     45}
    3846
    3947// On rajoute du bruit a l'image (Gaussienne de sigma=3)
     
    4250
    4351// Verification de la dynamique de l'image
    44 img.CheckDyn();
    45 img.Print();
     52MeanSigma(img, mean, sig);
     53cout << "ApresNoise img: Mean= " << mean << " Sigma= " << sig << endl;
    4654
    4755// On verifie la date de creation du fichier .ppf
     
    5260       << " Created: " << pin.CreationDate() << endl;
    5361  }
     62
    5463// On cree une nouvelle image
    5564ImageR4  img2;
    5665// On lit le contenu du fichier imgin.ppf
    57 img2.Read("img.ppf");
     66{
     67PInPersist pi("img.ppf");
     68pi >> img2;
     69}
     70
    5871// On calcule la difference entre les images img et img2
    5972//    Avant ajout de bruit
     
    6174imgo -= img2;
    6275// Verification de la dynamique de l'image soustraite
    63 imgo.CheckDyn();
    64 imgo.Print();
     76r_4 min,max;
     77imgo.MinMax(min, max);
     78cout << " Min(imgo) = " << min << " Max(imgo) = " << max << endl;
    6579
    6680//    Apres  ajout de bruit
    67 cout << " img(avecbruit) - img2 (fromfile) == Noise, sigma=1 ? " << endl;
     81cout << " img(avecbruit) - img2 (fromfile) == Noise, sigma=3 ? " << endl;
    6882img -= img2;
    6983// Verification de la dynamique de l'image soustraite
    70 img.CheckDyn();
    71 img.Print();
     84imgo.MinMax(min, max);
     85cout << " Min(img) = " << min << " Max(img) = " << max << endl;
     86MeanSigma(img, mean, sig);
     87cout << "Apres img -= img2 img: Mean= " << mean << " Sigma= " << sig << endl;
    7288
    7389// ---- Test des NDataBlock
     
    110126st = typeid(irp).name();
    111127cout << "typeid(irp).name() - " << st << endl;
     128}
     129
     130catch (PThrowable & exc) {
     131  cerr << "timg/Error Catched Exception " << (string)typeid(exc).name()
     132       << " - Msg= " << exc.Msg() << endl;
     133}
     134catch (...) {
     135  cerr << "timg/Error some other exception was caught ! " << endl;
     136}
     137
    112138cout << "\n ========= Fin de timg.cc ======== " << endl;
    113139exit(0);
  • trunk/SophyaProg/Tests/tnt.cc

    r1082 r1161  
    5858     nt1.Fill(xnt); k++; }
    5959
     60 nt1.Info().Comment() = "NTuple de Test - Cree par tnt.cc";
     61 nt1.Info()["Version"] = SophyaVersion();
    6062 nt1.Show(cout);
    6163 nt1.Print(0, 5);
     
    8991DVList dvl;
    9092
    91 cout << "\n ======= test_dvl:  Testing DVList ======= " << endl;
     93cout << "\n ======= test_dvl:  Testing MuTyV ======= " << endl;
     94MuTyV zvs = " ( 1.41 -2.71) ";
     95MuTyV dvs = "434.898";
     96MuTyV fvu = 314.1596;
     97MuTyV ivu = 7654321;
     98cout << " float->string: fvu= " << fvu << " (string)fvu=" << (string)fvu << endl;
     99cout << " int->string: ivu= " << ivu << " (string)ivu=" << (string)ivu << endl;
     100cout << "String->complex<double>: zvs = " << zvs
     101     << " (complex<double>)zvs= " << (complex<double>)zvs << endl;
     102cout << "String->double: dvs = " << dvs
     103     << " (double)zvs= " << (double)dvs << endl;
     104
     105
     106cout << "\n\n ======= test_dvl:  Testing DVList ======= " << endl;
    92107dvl.SetI("Var XXX", 12345);
    93108dvl.SetI("IV1-80", 80);
     
    109124dvl.SetComment("IntegerValue", "This variable has a comment");
    110125dvl.Comment() = "This is a test DVL produced by the program tdvl.cc \n Using SOPHYA , Feb 2000";
     126
     127dvl["Sinf"] = "inf 0985";
    111128dvl.Print();
     129
    112130
    113131double d = dvl("DV2-4.5");
Note: See TracChangeset for help on using the changeset viewer.