DATRW++ library: seismic data I/O with multiple formats
sucomanager.cc File Reference

manage coordinate scaling (implementation) More...

#include <cmath>
#include <climits>
#include <datrwxx/suformat.h>
#include <datrwxx/sucomanager.h>
#include <datrwxx/error.h>
#include <datrwxx/debug.h>
#include <datrwxx/util.h>
Include dependency graph for sucomanager.cc:

Go to the source code of this file.

Classes

class  datrw::su::helper::MyOutputFormat
 output format modifier for debug output More...
 

Namespaces

 datrw
 Root namespace of library.
 
 datrw::su
 All classes and functions to extract data from Seismic Unix files.
 
 datrw::su::helper
 

Macros

#define DATRW_SUCOMANAGER_CC_VERSION   "DATRW_SUCOMANAGER_CC V1.7"
 

Functions

void datrw::su::fixscalevalue (short &s, const bool &strict)
 fix a SeismicUn*x scale value More...
 
std::ostream & datrw::su::helper::operator<< (std::ostream &os, const MyOutputFormat &f)
 output operator to apply output format modifier More...
 
short datrw::su::powertoscale (const int &p)
 convert a decimal power to a SeismicUn*x scale value More...
 
double datrw::su::scalefactor (short s, const bool &strict)
 convert scale value to a factor to be applied More...
 
int datrw::su::scaletopower (short s, const bool &strict)
 convert a SeismicUn*x scale value to a decimal power More...
 

Detailed Description

manage coordinate scaling (implementation)


Author
Thomas Forbriger
Date
06/12/2010

manage coordinate scaling (implementation)

Copyright (c) 2010 by Thomas Forbriger (BFO Schiltach)


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software

Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

REVISIONS and CHANGES

  • 06/12/2010 V1.0 Thomas Forbriger
  • 14/01/2011 V1.1 extended modifications:
    • resolved problem with coordinate values close to zero which lead to a logarithm approaching infinity upon testing the number of significant digits
    • resolved a problem with unreasonable large scale values in case of small round off errors in floating point coordinate values
    • apply proper rounding to coordinate values, such that 0.0999999 will be stored as 0.1
    • check actual round-off error rather than scale and issue a warning in cases where round-off error exceed 0.1%
  • 29/03/2011 V1.2 - search for the smallest possible power larger or equal a desired value
  • 22/01/2012 V1.3
    - handle control parameters
    • pass control parameters to Coordinates and ScalCoo
    • add conversion functions
  • 24/01/2012 V1.4
    - static cast of value to type float in function ScalCoo::set(const double&) caused terrible roundoff resulting in awfully many trailing digits. I see no reason for this cast and remove it.
    • reworked ScalCoo::smallestpower(const short&)
  • 26/01/2012 V1.5 bug fix: ScalCoo::set(const double&): initial scale value must equal one see ticket:168
  • 08/07/2016 V1.6 make correct use of new DATRW_report_assert
  • 01/12/2016 V1.7 provide improved error message and warning to user

Definition in file sucomanager.cc.