Changeset 3496 in Sophya for trunk


Ignore:
Timestamp:
Apr 30, 2008, 3:29:47 PM (17 years ago)
Author:
ansari
Message:

MAJ prog test fits suite ajout methodes lecture-ecriture tableaux par morceaux - Reza 30/04/2008

File:
1 edited

Legend:

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

    r3168 r3496  
    168168    }
    169169
     170    {
     171      cout << "5/=== Ecriture tableau par morceaux dans tamor.fits  " << endl;
     172      FitsInOutFile fiosc("!tamor.fits", FitsInOutFile::Fits_Create);
     173      cout << "5.a/ TArray<int_4> iam(6,4) = RegularSequence(0., 1.) " << endl;
     174      TArray<int_4> iam(6,4);     
     175      iam = RegularSequence(0., 1.);
     176      LONGLONG naxes[3] = {6,4,3};
     177      int_4 x;
     178      fiosc.CreateImageHDU(FitsTypes::ImageType(x), 3, naxes);
     179      iam.Info()["Info"] = "Write test of 3 x TArray<r_4>(6,4)";
     180      fiosc.WriteHeaderRecords(iam.Info());
     181      sa_size_t off[3] = {0,0,0};
     182      FitsArrayHandler<int_4> fah(iam);
     183      for(int_4 kk=0; kk<3; kk++) {
     184        iam += 100;
     185        off[2] = kk;
     186        cout << "5.b/ Appel fah.WriteAtOffset(fiosc, off) Avec off[2]="
     187             << off[2] << endl;
     188        fah.WriteAtOffset(fiosc, off);
     189      }
     190    }
     191
     192    {
     193      cout << "6/=== lecture tableau par morceaux depuis tamor.fits  " << endl;
     194      FitsInOutFile fiosc("tamor.fits", FitsInOutFile::Fits_RO);
     195      TArray<int_4> iam(6,4), iamck(6,4), diff(6,4);     
     196      iamck = RegularSequence(0., 1.);
     197      int rc = 0;
     198      int_4 min,max;
     199      sa_size_t off[3] = {0,0,0};
     200      int rcf[3] = {7,70,700};
     201      FitsArrayHandler<int_4> fah(iam);
     202      for(int_4 kk=0; kk<3; kk++) {
     203        iamck += 100;
     204        off[2] = kk;
     205        cout << "6.b/ Appel fah.ReadAtOffset(fiosc, off) Avec off[2]="
     206             << off[2] << endl;
     207        fah.ReadAtOffset(fiosc, off);
     208        cout << iam;
     209        diff = iam-iamck;
     210        diff.MinMax(min, max);
     211        if ((min != 0) || (max != 0))  rc += rcf[kk];
     212      }
     213      cout << "6.b/ fah.ReadAtOffset(tamor.fits ...) Rc= " << rc << endl;
     214    }
     215
    170216  }
    171217  catch (PThrowable & exc) {
Note: See TracChangeset for help on using the changeset viewer.