OpendTect  7.0
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
SeisTrcTranslator Class Reference

Seismic Trace translator. More...

Inheritance diagram for SeisTrcTranslator:
[legend]

Classes

class  ComponentData
 Information for one component. More...
 
class  TargetComponentData
 ComponentData as it should be when the Translator puts it away. More...
 

Public Member Functions

virtual ~SeisTrcTranslator ()
 
virtual int bytesOverheadPerTrace () const
 
virtual void cleanUp ()
 Prepare for new initialization. More...
 
virtual bool close ()
 
bool commitSelections ()
 
ObjectSet< TargetComponentData > & componentInfo ()
 
const ObjectSet< TargetComponentData > & componentInfo () const
 
virtual ConncurConn ()
 
Pos::GeomID curGeomID () const
 
const char * dataName () const
 
void enforceRegularWrite (bool yn)
 
void enforceSurvinfoWrite (bool yn)
 
uiString errMsg () const
 
virtual int estimatedNrTraces () const
 
void getComponentNames (BufferStringSet &) const
 
SeisTrcgetEmpty ()
 
SeisTrcgetFilled (const BinID &)
 
virtual bool getGeometryInfo (PosInfo::CubeData &) const
 
virtual bool goTo (const BinID &)
 
bool haveWarnings () const
 
bool initRead (Conn *, Seis::ReadMode rt=Seis::Prod)
 
bool initWrite (Conn *, const SeisTrc &)
 
virtual bool inlCrlSorted () const
 
int inpNrSamples () const
 
const SamplingData< float > & inpSD () const
 
const ObjectSet< ComponentData > & inputComponentData () const
 
bool is2D () const
 
bool isPS () const
 
bool isUserSelectable (bool) const override
 
int nrSelComps () const
 
int outNrSamples () const
 
const SamplingData< float > & outSD () const
 
SeisPacketInfopacketInfo ()
 
virtual bool read (SeisTrc &)
 
virtual bool readData (TraceData *extbuf=nullptr)
 
virtual bool readDataPack (RegularSeisDataPack &, TaskRunner *=nullptr)
 
virtual bool readInfo (SeisTrcInfo &)
 
bool readTraceData (TraceData *td=nullptr)
 
int selComp (int nr=0) const
 
const Seis::SelDataselData () const
 
void setComponentNames (const BufferStringSet &)
 
virtual void setCoordSys (const Coords::CoordSystem &)
 
virtual void setCurGeomID (Pos::GeomID)
 
void setDataName (const char *nm)
 
virtual void setIs2D (bool yn)
 
virtual void setIsPS (bool yn)
 
void setSelData (const Seis::SelData *t)
 
virtual bool skip (int nrtrcs=1)
 
virtual bool supportsGoTo () const
 
bool supportsMultiCompTrc () const
 
const LinScalertraceScaler () const
 
void usePar (const IOPar &) override
 
const BufferStringSetwarnings () const
 
virtual bool write (const SeisTrc &)
 
- Public Member Functions inherited from Translator
 Translator (const char *nm, const char *usr_nm)
 
virtual ~Translator ()
 
virtual const char * connType () const
 
virtual IOObjcreateWriteIOObj (const IOObjContext &, const MultiID &) const
 
virtual const char * defExtension () const
 
virtual bool getConfirmRemoveMsg (const IOObj *, uiString &msg, uiString &canceltxt, uiString &deepremovetxt, uiString &shallowremovetxt) const
 
const char * getDisplayName () const
 "username [group]" More...
 
virtual TranslatorgetNew () const =0
 
const TranslatorGroupgroup () const
 
virtual const char * iconName () const
 
virtual bool implExists (const IOObj *, bool forread) const
 
virtual bool implIsLink (const IOObj *) const
 
virtual bool implReadOnly (const IOObj *) const
 
virtual bool implRemove (const IOObj *, bool deep=true) const
 
virtual bool implRename (const IOObj *, const char *newnm) const
 
virtual bool implSetReadOnly (const IOObj *, bool) const
 
virtual const uiStringmessage () const
 
void setGroup (TranslatorGroup *g)
 
uiString sSelObjectIsWrongType ()
 
const OD::StringtypeName () const
 
const OD::StringuserName () const
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
void stopReceivingNotifications () const
 
virtual CallBackertrueCaller ()
 

Static Public Member Functions

static bool getRanges (const IOObj &, TrcKeyZSampling &, const char *linekey=nullptr)
 
static bool getRanges (const MultiID &, TrcKeyZSampling &, const char *linekey=nullptr)
 
static bool is2D (const IOObj &, bool only_internal=false)
 
static bool isLineSet (const IOObj &)
 
static bool isPS (const IOObj &, bool only_internal=false)
 
static void setCoordSys (const Coords::CoordSystem &, IOPar &)
 
static void setGeomID (Pos::GeomID, IOPar &)
 
static void setType (Seis::GeomType, IOPar &)
 
static const char * sKeyIs2D ()
 
static const char * sKeyIsPS ()
 
static const char * sKeyRegWrite ()
 
static const char * sKeySeisTrPars ()
 
static const char * sKeySIWrite ()
 
- Static Public Member Functions inherited from Translator
static const TranslatorgetTemplateInstance (const char *displayname)
 
static uiString sBadConnection ()
 
static uiString sNoIoobjMsg ()
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

Protected Member Functions

 SeisTrcTranslator (const char *, const char *)
 
void addComp (const DataCharacteristics &, const char *nm=0, int dtype=0)
 
virtual void addWarn (int, const char *)
 
virtual void blockDumped (int nrtrcs)
 
virtual bool commitSelections_ ()
 
virtual bool dumpBlock ()
 will call blockDumped() More...
 
virtual bool forRead () const
 
virtual bool initRead_ ()
 
virtual bool initWrite_ (const SeisTrc &)
 
void prepareComponents (SeisTrc &, int actualsz) const
 
virtual bool prepareWriteBlock (StepInterval< int > &, bool &)
 
void setDataType (int icomp, int d)
 
virtual bool writeTrc_ (const SeisTrc &)
 

Protected Attributes

ObjectSet< ComponentDatacds_
 
BufferStringSetcompnms_ = nullptr
 
Connconn_ = nullptr
 
ConstRefMan< Coords::CoordSystemcoordsys_
 
const LinScalercurtrcscalebase_ = nullptr
 
BufferString dataname_
 
bool datareaddone_ = false
 
bool enforce_regular_write
 
bool enforce_survinfo_write
 
uiString errmsg_
 
Pos::GeomID geomid_
 
bool headerdonenew_ = false
 
int innrsamples_
 
ComponentData ** inpcds_ = nullptr
 
SamplingData< float > insd_
 
bool is_2d = false
 
bool is_prestack = false
 
TargetComponentData ** outcds_ = nullptr
 
int outnrsamples_
 
SamplingData< float > outsd_
 
SeisPacketInfopinfo_
 
Seis::ReadMode read_mode = Seis::Prod
 
Interval< int > samprg_
 
const Seis::SelDataseldata_ = nullptr
 
TraceDatastorbuf_ = nullptr
 
ObjectSet< TargetComponentDatatarcds_
 
SeisTrcBuftrcblock_
 
LinScalertrcscalebase_ = nullptr
 
BufferStringSetwarnings_
 
TypeSet< int > warnnrs_
 
- Protected Attributes inherited from Translator
TranslatorGroupgroup_ = nullptr
 
uiString msg_
 
BufferString typname_
 
BufferString usrname_
 

Private Member Functions

bool copyDataToTrace (SeisTrc &)
 
void enforceBounds ()
 
bool initConn (Conn *)
 
bool writeBlock ()
 

Private Attributes

int * inpfor_ = nullptr
 
int lastinlwritten_
 
int nrout_ = 0
 
int prevnr_ = mUdf(int)
 

Friends

class SeisTrcReader
 

Additional Inherited Members

- Static Protected Member Functions inherited from Translator
static BufferString getAssociatedFileName (const char *fnm, const char *extension)
 
static BufferString getAssociatedFileName (const IOObj &, const char *extension)
 
static bool removeAssociatedFile (const char *fnm, const char *ext)
 
static bool renameAssociatedFile (const char *fnm, const char *ext, const char *newnm)
 
static bool renameLargeFile (const char *fnm, const char *newfnm, const CallBack *cb=nullptr)
 
static bool setPermAssociatedFile (const char *fnm, const char *ext, bool setwritable)
 

Detailed Description

Seismic Trace translator.

The protocol is as follows:

1) Client opens Connection apropriate for Translator. This connection will remain managed by client.

READ:

2) initRead() call initializes SeisPacketInfo, Component info and SelData on input (if any) 3) Client subselects in components and space (SelData) 4) commitSelections() 5) By checking readInfo(), client may determine whether space selection was satisfied. Space selection is just a hint. This is done to protect client against (possible) freeze during (possible) search. 6) readData() reads actual trace components, or skip() skips trace(s).

WRITE:

2) with initWrite() client passes Connection and example trace. Translator will fill default writing layout. If Translator is single component, only the first component will have a destidx != -1. 3) Client sets trace selection and components as wanted 4) commitSelections() writes 'global' header, if any 5) write() writes selected traces/trace sections

lastly) close() finishes work (does not close connection). If you don't close yourself, the destructor will do it but make sure it's done because otherwise you'll likely loose an entire inline when writing.

Another note: the SelData type 'TrcNrs' is not supported by this class. That is because of nasty implementation details on this level. The classes SeisTrcReader and SeisTrcWriter do support it.

<>

<>

Constructor & Destructor Documentation

◆ ~SeisTrcTranslator()

virtual SeisTrcTranslator::~SeisTrcTranslator ( )
virtual

◆ SeisTrcTranslator()

SeisTrcTranslator::SeisTrcTranslator ( const char *  ,
const char *   
)
protected

Member Function Documentation

◆ addComp()

void SeisTrcTranslator::addComp ( const DataCharacteristics ,
const char *  nm = 0,
int  dtype = 0 
)
protected

◆ addWarn()

virtual void SeisTrcTranslator::addWarn ( int  ,
const char *   
)
protectedvirtual

Reimplemented in SEGYSeisTrcTranslator.

◆ blockDumped()

virtual void SeisTrcTranslator::blockDumped ( int  nrtrcs)
inlineprotectedvirtual

Reimplemented in CBVSSeisTrcTranslator.

◆ bytesOverheadPerTrace()

virtual int SeisTrcTranslator::bytesOverheadPerTrace ( ) const
inlinevirtual

◆ cleanUp()

virtual void SeisTrcTranslator::cleanUp ( )
virtual

Prepare for new initialization.

Reimplemented in CBVSSeisTrcTranslator, BlocksSeisTrcTranslator, SEGYSeisTrcTranslator, and SEGYDirectSeisTrcTranslator.

◆ close()

virtual bool SeisTrcTranslator::close ( )
virtual

◆ commitSelections()

bool SeisTrcTranslator::commitSelections ( )

If not called, will be called by Translator. For write, this will put tape header (if any)

◆ commitSelections_()

virtual bool SeisTrcTranslator::commitSelections_ ( )
inlineprotectedvirtual

◆ componentInfo() [1/2]

ObjectSet<TargetComponentData>& SeisTrcTranslator::componentInfo ( )
inline

◆ componentInfo() [2/2]

const ObjectSet<TargetComponentData>& SeisTrcTranslator::componentInfo ( ) const
inline

◆ copyDataToTrace()

bool SeisTrcTranslator::copyDataToTrace ( SeisTrc )
private

◆ curConn()

virtual Conn* SeisTrcTranslator::curConn ( )
inlinevirtual

Reimplemented in SEGYDirectSeisTrcTranslator.

◆ curGeomID()

Pos::GeomID SeisTrcTranslator::curGeomID ( ) const
inline

◆ dataName()

const char* SeisTrcTranslator::dataName ( ) const
inline

◆ dumpBlock()

virtual bool SeisTrcTranslator::dumpBlock ( )
protectedvirtual

will call blockDumped()

◆ enforceBounds()

void SeisTrcTranslator::enforceBounds ( )
private

◆ enforceRegularWrite()

void SeisTrcTranslator::enforceRegularWrite ( bool  yn)
inline

◆ enforceSurvinfoWrite()

void SeisTrcTranslator::enforceSurvinfoWrite ( bool  yn)
inline

◆ errMsg()

uiString SeisTrcTranslator::errMsg ( ) const
inline

◆ estimatedNrTraces()

virtual int SeisTrcTranslator::estimatedNrTraces ( ) const
inlinevirtual

◆ forRead()

virtual bool SeisTrcTranslator::forRead ( ) const
protectedvirtual

◆ getComponentNames()

void SeisTrcTranslator::getComponentNames ( BufferStringSet ) const

◆ getEmpty()

SeisTrc* SeisTrcTranslator::getEmpty ( )

Returns an empty trace with the target data characteristics for component 0

◆ getFilled()

SeisTrc* SeisTrcTranslator::getFilled ( const BinID )

Returns a full sized trace with zeros.

◆ getGeometryInfo()

virtual bool SeisTrcTranslator::getGeometryInfo ( PosInfo::CubeData ) const
inlinevirtual

◆ getRanges() [1/2]

static bool SeisTrcTranslator::getRanges ( const IOObj ,
TrcKeyZSampling ,
const char *  linekey = nullptr 
)
static

◆ getRanges() [2/2]

static bool SeisTrcTranslator::getRanges ( const MultiID ,
TrcKeyZSampling ,
const char *  linekey = nullptr 
)
static

◆ goTo()

virtual bool SeisTrcTranslator::goTo ( const BinID )
inlinevirtual

◆ haveWarnings()

bool SeisTrcTranslator::haveWarnings ( ) const

◆ initConn()

bool SeisTrcTranslator::initConn ( Conn )
private

◆ initRead()

bool SeisTrcTranslator::initRead ( Conn ,
Seis::ReadMode  rt = Seis::Prod 
)

Init functions must be called, because a Conn object must always be available Conn* ptr will become mine, and it may be deleted immediately!After call, component and packet info will be available. Some STT's require a valid IOObj in Conn.

◆ initRead_()

virtual bool SeisTrcTranslator::initRead_ ( )
inlineprotectedvirtual

◆ initWrite()

bool SeisTrcTranslator::initWrite ( Conn ,
const SeisTrc  
)

Conn* ptr will become mine, and it may be deleted immediately! After call, default component and packet info will be generated according to the example trace. Some STT's require a valid IOObj in Conn

◆ initWrite_()

virtual bool SeisTrcTranslator::initWrite_ ( const SeisTrc )
inlineprotectedvirtual

◆ inlCrlSorted()

virtual bool SeisTrcTranslator::inlCrlSorted ( ) const
inlinevirtual

◆ inpNrSamples()

int SeisTrcTranslator::inpNrSamples ( ) const
inline

◆ inpSD()

const SamplingData<float>& SeisTrcTranslator::inpSD ( ) const
inline

◆ inputComponentData()

const ObjectSet<ComponentData>& SeisTrcTranslator::inputComponentData ( ) const
inline

◆ is2D() [1/2]

bool SeisTrcTranslator::is2D ( ) const
inline

◆ is2D() [2/2]

static bool SeisTrcTranslator::is2D ( const IOObj ,
bool  only_internal = false 
)
static

◆ isLineSet()

static bool SeisTrcTranslator::isLineSet ( const IOObj )
static

Should only be used to filter out old LineSet entries in .omf

◆ isPS() [1/2]

bool SeisTrcTranslator::isPS ( ) const
inline

◆ isPS() [2/2]

static bool SeisTrcTranslator::isPS ( const IOObj ,
bool  only_internal = false 
)
static

◆ isUserSelectable()

bool SeisTrcTranslator::isUserSelectable ( bool  ) const
inlineoverridevirtual

Reimplemented from Translator.

◆ nrSelComps()

int SeisTrcTranslator::nrSelComps ( ) const
inline

◆ outNrSamples()

int SeisTrcTranslator::outNrSamples ( ) const
inline

◆ outSD()

const SamplingData<float>& SeisTrcTranslator::outSD ( ) const
inline

◆ packetInfo()

SeisPacketInfo& SeisTrcTranslator::packetInfo ( )
inline

◆ prepareComponents()

void SeisTrcTranslator::prepareComponents ( SeisTrc ,
int  actualsz 
) const
protected

◆ prepareWriteBlock()

virtual bool SeisTrcTranslator::prepareWriteBlock ( StepInterval< int > &  ,
bool &   
)
inlineprotectedvirtual

◆ read()

virtual bool SeisTrcTranslator::read ( SeisTrc )
virtual

◆ readData()

virtual bool SeisTrcTranslator::readData ( TraceData extbuf = nullptr)
inlinevirtual

◆ readDataPack()

virtual bool SeisTrcTranslator::readDataPack ( RegularSeisDataPack ,
TaskRunner = nullptr 
)
inlinevirtual

Reimplemented in CBVSSeisTrcTranslator.

◆ readInfo()

virtual bool SeisTrcTranslator::readInfo ( SeisTrcInfo )
inlinevirtual

◆ readTraceData()

bool SeisTrcTranslator::readTraceData ( TraceData td = nullptr)
inline

◆ selComp()

int SeisTrcTranslator::selComp ( int  nr = 0) const
inline

◆ selData()

const Seis::SelData* SeisTrcTranslator::selData ( ) const
inline

◆ setComponentNames()

void SeisTrcTranslator::setComponentNames ( const BufferStringSet )

◆ setCoordSys() [1/2]

virtual void SeisTrcTranslator::setCoordSys ( const Coords::CoordSystem )
virtual

◆ setCoordSys() [2/2]

static void SeisTrcTranslator::setCoordSys ( const Coords::CoordSystem ,
IOPar  
)
static

◆ setCurGeomID()

virtual void SeisTrcTranslator::setCurGeomID ( Pos::GeomID  )
virtual

Reimplemented in CBVSSeisTrcTranslator.

◆ setDataName()

void SeisTrcTranslator::setDataName ( const char *  nm)
inline

◆ setDataType()

void SeisTrcTranslator::setDataType ( int  icomp,
int  d 
)
inlineprotected

◆ setGeomID()

static void SeisTrcTranslator::setGeomID ( Pos::GeomID  ,
IOPar  
)
static

◆ setIs2D()

virtual void SeisTrcTranslator::setIs2D ( bool  yn)
inlinevirtual

Reimplemented in SEGYSeisTrcTranslator.

◆ setIsPS()

virtual void SeisTrcTranslator::setIsPS ( bool  yn)
inlinevirtual

Reimplemented in SEGYSeisTrcTranslator.

◆ setSelData()

void SeisTrcTranslator::setSelData ( const Seis::SelData t)
inline

This Seis::SelData is seen as a hint ...

◆ setType()

static void SeisTrcTranslator::setType ( Seis::GeomType  ,
IOPar  
)
static

◆ sKeyIs2D()

static const char* SeisTrcTranslator::sKeyIs2D ( )
static

◆ sKeyIsPS()

static const char* SeisTrcTranslator::sKeyIsPS ( )
static

◆ sKeyRegWrite()

static const char* SeisTrcTranslator::sKeyRegWrite ( )
static

◆ sKeySeisTrPars()

static const char* SeisTrcTranslator::sKeySeisTrPars ( )
static

◆ sKeySIWrite()

static const char* SeisTrcTranslator::sKeySIWrite ( )
static

◆ skip()

virtual bool SeisTrcTranslator::skip ( int  nrtrcs = 1)
inlinevirtual

◆ supportsGoTo()

virtual bool SeisTrcTranslator::supportsGoTo ( ) const
inlinevirtual

◆ supportsMultiCompTrc()

bool SeisTrcTranslator::supportsMultiCompTrc ( ) const

◆ traceScaler()

const LinScaler* SeisTrcTranslator::traceScaler ( ) const
inline

◆ usePar()

void SeisTrcTranslator::usePar ( const IOPar )
overridevirtual

Reimplemented from Translator.

◆ warnings()

const BufferStringSet& SeisTrcTranslator::warnings ( ) const
inline

◆ write()

virtual bool SeisTrcTranslator::write ( const SeisTrc )
virtual

Reimplemented in SEGYDirectSeisTrcTranslator.

◆ writeBlock()

bool SeisTrcTranslator::writeBlock ( )
private

◆ writeTrc_()

virtual bool SeisTrcTranslator::writeTrc_ ( const SeisTrc )
inlineprotectedvirtual

Friends And Related Function Documentation

◆ SeisTrcReader

friend class SeisTrcReader
friend

Member Data Documentation

◆ cds_

ObjectSet<ComponentData> SeisTrcTranslator::cds_
protected

◆ compnms_

BufferStringSet* SeisTrcTranslator::compnms_ = nullptr
protected

◆ conn_

Conn* SeisTrcTranslator::conn_ = nullptr
protected

◆ coordsys_

ConstRefMan<Coords::CoordSystem> SeisTrcTranslator::coordsys_
protected

◆ curtrcscalebase_

const LinScaler* SeisTrcTranslator::curtrcscalebase_ = nullptr
protected

◆ dataname_

BufferString SeisTrcTranslator::dataname_
protected

◆ datareaddone_

bool SeisTrcTranslator::datareaddone_ = false
protected

◆ enforce_regular_write

bool SeisTrcTranslator::enforce_regular_write
protected

◆ enforce_survinfo_write

bool SeisTrcTranslator::enforce_survinfo_write
protected

◆ errmsg_

uiString SeisTrcTranslator::errmsg_
protected

◆ geomid_

Pos::GeomID SeisTrcTranslator::geomid_
protected

◆ headerdonenew_

bool SeisTrcTranslator::headerdonenew_ = false
protected

◆ innrsamples_

int SeisTrcTranslator::innrsamples_
protected

◆ inpcds_

ComponentData** SeisTrcTranslator::inpcds_ = nullptr
protected

◆ inpfor_

int* SeisTrcTranslator::inpfor_ = nullptr
private

◆ insd_

SamplingData<float> SeisTrcTranslator::insd_
protected

◆ is_2d

bool SeisTrcTranslator::is_2d = false
protected

◆ is_prestack

bool SeisTrcTranslator::is_prestack = false
protected

◆ lastinlwritten_

int SeisTrcTranslator::lastinlwritten_
private

◆ nrout_

int SeisTrcTranslator::nrout_ = 0
private

◆ outcds_

TargetComponentData** SeisTrcTranslator::outcds_ = nullptr
protected

◆ outnrsamples_

int SeisTrcTranslator::outnrsamples_
protected

◆ outsd_

SamplingData<float> SeisTrcTranslator::outsd_
protected

◆ pinfo_

SeisPacketInfo& SeisTrcTranslator::pinfo_
protected

◆ prevnr_

int SeisTrcTranslator::prevnr_ = mUdf(int)
private

◆ read_mode

Seis::ReadMode SeisTrcTranslator::read_mode = Seis::Prod
protected

◆ samprg_

Interval<int> SeisTrcTranslator::samprg_
protected

◆ seldata_

const Seis::SelData* SeisTrcTranslator::seldata_ = nullptr
protected

◆ storbuf_

TraceData* SeisTrcTranslator::storbuf_ = nullptr
protected

◆ tarcds_

ObjectSet<TargetComponentData> SeisTrcTranslator::tarcds_
protected

◆ trcblock_

SeisTrcBuf& SeisTrcTranslator::trcblock_
protected

◆ trcscalebase_

LinScaler* SeisTrcTranslator::trcscalebase_ = nullptr
protected

◆ warnings_

BufferStringSet& SeisTrcTranslator::warnings_
protected

◆ warnnrs_

TypeSet<int> SeisTrcTranslator::warnnrs_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024