Commit ab17108c authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

added functions for SU reading

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/branches/libdatrwxx.su
SVN Revision: 3456
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 77448d6b
......@@ -10,6 +10,22 @@
* read Seismic Unix data (prototypes)
*
* 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
* - 19/11/2010 V1.0 Thomas Forbriger
......@@ -25,8 +41,32 @@
#define DATRW_SU_H_CVSID \
"$Id$"
#include<datrwxx/datread.h>
#include<datrwxx/suheader.h>
namespace datrw {
/*! \brief class to read SeismicUnix data
*
* \ingroup su
*/
class isustream: public idatstream {
public:
typedef idatstream Tbase;
isustream(std::istream& is, const bool& debug=false);
virtual ~isustream() { }
virtual Tdseries dseries();
virtual Tfseries fseries();
virtual Tiseries iseries();
virtual void skipseries();
static void help(std::ostream& os=std::cout);
private:
void readnextheader();
bool Mdebug;
sff::SRCE Msrce;
datrw::su::SUheader Mnextheader;
}; // class isacstream
} // namespace datrw
#endif // DATRW_SU_H_VERSION (includeguard)
......
......@@ -10,6 +10,22 @@
* read Seismic Unix data (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
* - 19/11/2010 V1.0 Thomas Forbriger
......@@ -27,6 +43,68 @@ namespace datrw {
namespace su {
isustream::isustream(std::istream& is, const bool& debug):
Tbase(is, true, true, false, true), Mdebug(debug)
{
DATRWXX_assert(is.good()
"ERROR (isustream::isustream): input stream is bad");
Mnextheader.read(is);
}
/*----------------------------------------------------------------------*/
Tdseries isustream::dseries()
{
return(datrw::util::convert<Tfseries, Tdseries>(this->fseries()));
} // Tdseries isustream::dseries()
/*----------------------------------------------------------------------*/
Tfseries isustream::fseries()
{
this->readheader();
return(datrw::su::read_su_data(this->Mis, this->wid2().nsamples));
} // Tiseries isustream::fseries()
/*----------------------------------------------------------------------*/
/*
Tiseries isustream::iseries()
{
return(datrw::util::convert<Tfseries, Tiseries>(this->fseries()));
} // Tiseries isustream::iseries()
*/
/*----------------------------------------------------------------------*/
void isustream::skipseries()
{
} // void isustream::skipseries()
/*----------------------------------------------------------------------*/
void isustream::readheader()
{
} // void isustream::readheader()
/*----------------------------------------------------------------------*/
void isustream::help(std::ostream& os)
{
os <<
std::endl <<
"SeismicUnix reading functions" << std::endl <<
"-----------------------------" << std::endl <<
DATRW_SU_CC_VERSION << std::endl <<
DATRW_SU_CC_CVSID << std::endl <<
DATRW_SU_H_CVSID << std::endl <<
std::endl <<
"This module provides reading of SeismicUnix binary data files."
<< std::endl <<
"Only a few header fields are extracted."
<< std::endl;
} // void isustream::help(std::ostream& os)
} // namespace su
} // namespace datrw
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment