Changeset 668 in Sophya for trunk/SophyaLib/SkyT/radspec.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/radspec.cc

    r607 r668  
    11//--------------------------------------------------------------------------
    22// File and Version Information:
    3 //      $Id: radspec.cc,v 1.2 1999-11-20 21:00:50 ansari Exp $
     3//      $Id: radspec.cc,v 1.3 1999-11-29 14:16:06 ansari Exp $
    44//
    55// Description:
     
    104104RadSpectra::integratedFlux(double f1, double f2)  const
    105105{
    106     _raypourfinteg = const_cast<RadSpectra *>(this);
    107     TrpzInteg I(RadSpectra_fluxFunction , f1, f2); 
    108     double val = (double)I;
    109     _raypourfinteg = NULL;  // On ne peut pas faire ca avant la destruction de I
    110     return(val);       
     106//   cout << endl;
     107//   cout <<  this->minFreq() << " = " << this->maxFreq() << endl;
     108//   cout <<  f1 << " = " << f2 << endl;
     109  if(f1 < this->minFreq()) f1 = this->minFreq();
     110  if(f2 > this->maxFreq()) f2 = this->maxFreq();
     111  _raypourfinteg = const_cast<RadSpectra *>(this);
     112  TrpzInteg I(RadSpectra_fluxFunction , f1, f2); 
     113  double val = (double)I;
     114  _raypourfinteg = NULL;  // On ne peut pas faire ca avant la destruction de I
     115  return(val);       
    111116}
    112117double
    113118RadSpectra::integratedFlux()  const
    114119{
    115   return integratedFlux(_numin, _numax);
     120  return integratedFlux(this->minFreq(),this->maxFreq());
    116121}
    117122
     
    129134RadSpectra::logIntegratedFlux(double f1, double f2)  const
    130135{
     136  if(f1 < this->minFreq()) f1 = this->minFreq();
     137  if(f2 > this->maxFreq()) f2 = this->maxFreq();
     138
    131139  double f1Log = log10(f1);
    132140  double f2Log = log10(f2);
     
    161169  _raypourfinteg = const_cast<RadSpectra *>(this);
    162170  _filter = const_cast<SpectralResponse *>(&filter);
     171   if(f1 < this->minFreq()) f1 = this->minFreq();
     172   if(f2 > this->maxFreq()) f2 = this->maxFreq();
     173
    163174  TrpzInteg I(RadSpectra_filteredFlux,f1,f2);
    164175  double val = (double)I;
     
    185196  double nu = pow(10,tau);
    186197  double flux = _raypourfinteg->flux(nu)*nu;
    187   return(flux * _filter->transmission(nu));
     198  double result = flux * _filter->transmission(nu);
     199  return(result);
    188200}
    189201
     
    192204RadSpectra::filteredLogIntFlux(SpectralResponse const& filter, double f1, double f2) const
    193205{
    194 
    195 //   double f1Log = log10(f1);
    196 //   double f2Log = log10(f2);
    197 //   if(f1Log < -1.e99) f1Log = -1.e99;
    198 //   if(f2Log > 1.e99)  f2Log = 1.e99;
    199 //   _rayIntLog = const_cast<RadSpectra *>(this);
    200 //   TrpzInteg I(RadSpectra_logFluxFunction,f1Log,f2Log);
    201 //   double value = (double)I * log(10.);
    202 //   return(value);       
    203 //   _rayIntLog = NULL;
    204206 
    205207   _raypourfinteg = NULL;
    206208   _filter = NULL;
     209   if(f1 < this->minFreq()) f1 = this->minFreq();
     210   if(f2 > this->maxFreq()) f2 = this->maxFreq();
     211   
    207212   double f1Log = log10(f1);
    208213   double f2Log = log10(f2);
     
    226231
    227232
     233
    228234void
    229235RadSpectra::Print(ostream& os) const
Note: See TracChangeset for help on using the changeset viewer.