Changeset 668 in Sophya for trunk/SophyaLib/SkyT/gaussfilt.cc


Ignore:
Timestamp:
Nov 29, 1999, 3:16:10 PM (26 years ago)
Author:
ansari
Message:

Ajout de classes deleguees PPersist et correction integration - Sophie 29/11/99

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SkyT/gaussfilt.cc

    r610 r668  
    11//--------------------------------------------------------------------------
    22// File and Version Information:
    3 //      $Id: gaussfilt.cc,v 1.3 1999-11-21 23:25:45 ansari Exp $
     3//      $Id: gaussfilt.cc,v 1.4 1999-11-29 14:16:04 ansari Exp $
    44//
    55// Description:
     
    2222// Constructor --
    2323//----------------
     24GaussianFilter::GaussianFilter()
     25  : SpectralResponse()
     26{
     27  setParams(100, 10., 1.);
     28}
     29
    2430GaussianFilter::GaussianFilter(double nu0, double s, double a, double numin, double numax)
    2531  : SpectralResponse(numin, numax)
    2632{
    27   if (s < 1.e-19) s = 1.e-19;
    28   _s = s;
    29   _nu0 = nu0;
    30   _a = a;
     33  setParams(nu0, s, a);
    3134}
    3235
     
    6669}
    6770
     71
     72
     73void
     74GaussianFilter::setParams(double nu0, double s, double a)
     75{
     76  if (s < 1.e-19) s = 1.e-19;
     77  _s = s;
     78  _nu0 = nu0;
     79  _a = a;
     80}
     81
     82
     83
    6884void
    6985GaussianFilter::Print(ostream& os)  const
     
    7692
    7793}
     94
     95void
     96ObjFileIO<GaussianFilter>::WriteSelf(POutPersist& s) const
     97{
     98  if(dobj == NULL)
     99    {
     100      cout << " ObjFileIO<GaussianFilter>::WriteSelf:: dobj= null " << endl;
     101      return;
     102    }
     103  int_4 version, nothing;
     104  version = 1;
     105  nothing = 0;   // Reserved for future use
     106  s.PutI4(version);
     107  s.PutI4(nothing);
     108
     109  s.PutR8(dobj->minFreq());
     110  s.PutR8(dobj->maxFreq());
     111  s.PutR8(dobj->giveNorm());
     112  s.PutR8(dobj->giveNu0());
     113  s.PutR8(dobj->giveDNu());
     114}
     115
     116void
     117ObjFileIO<GaussianFilter>::ReadSelf(PInPersist& s) 
     118{
     119  int_4 version, nothing;
     120  version = 1;
     121  nothing = 0;   // Reserved for future use
     122  s.GetI4(version);
     123  s.GetI4(nothing);
     124
     125  if(dobj == NULL)
     126    {
     127      dobj= new GaussianFilter();
     128      ownobj= true;
     129    }
     130
     131  r_8 a, nu0, dnu, numin, numax;
     132  s.GetR8(numin);
     133  s.GetR8(numax);
     134  s.GetR8(a);
     135  s.GetR8(nu0);
     136  s.GetR8(dnu);
     137  dobj->setMinMaxFreq(numin, numax);
     138  dobj->setParams(nu0, dnu, a);
     139  //  cout << " Norm - Nu0 - DNu - minFreq - maxFreq " << endl;
     140  // cout << _a << "-" << _nu0  << "-" << _s << "-" << _numin << "-" << _numax << endl;
     141}
     142
     143
     144#ifdef __CXX_PRAGMA_TEMPLATES__
     145#pragma define_template ObjFileIO<GaussianFilter>
     146#endif
     147
     148#if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES)
     149template class ObjFileIO<GaussianFilter>;
     150#endif
Note: See TracChangeset for help on using the changeset viewer.