PRES Plotting Configuration from XML files

Creates PRES configurations from LgFormat XML files.

Created on Dec 16, 2011

exception TotalDepth.util.plot.PRESCfgXML.ExceptionPRESCfgXML

Specialisation of exception for PRESCfgXML module.

exception TotalDepth.util.plot.PRESCfgXML.ExceptionCurveCfgXMLRead

Specialisation of exception for CurveCfgXMLRead module.

exception TotalDepth.util.plot.PRESCfgXML.ExceptionPresCfgXMLRead

Specialisation of exception for PresCfgXMLRead module.

TotalDepth.util.plot.PRESCfgXML.XML_CODI_MAP = {'LG_SOLID_LINE': Stroke(width=0.5, colour='black', coding=None, opacity=1.0), 'LG_DASH_LINE': Stroke(width=0.5, colour='black', coding=(4, 4), opacity=1.0), 'LG_SOLID_HEAVY_DOT': Stroke(width=1.5, colour='black', coding=(2, 2), opacity=1.0), 'LG_SOLID_HEAVY_DASH': Stroke(width=1.5, colour='black', coding=(4, 4), opacity=1.0), None: Stroke(width=0.5, colour='black', coding=None, opacity=1.0), 'LG_LONG_DASH_LINE': Stroke(width=0.5, colour='black', coding=(6, 2), opacity=1.0), 'LG_SOLID_HEAVY_LONG_DASH': Stroke(width=1.5, colour='black', coding=(6, 2), opacity=1.0), 'LG_DOT_LINE': Stroke(width=0.5, colour='black', coding=(2, 2), opacity=1.0), 'LG_SOLID_HEAVY_LINE': Stroke(width=1.5, colour='black', coding=None, opacity=1.0)}

Maps LgFormat mnemonics to a Stroke object: If either value is None an SVG attribute is not needed i.e. default SVG behaviour

TotalDepth.util.plot.PRESCfgXML.BACKUP_FROM_MODE_MAP = {'1': (-1, 1), 'LG_RIGHT_WRAPPED': (1, 0), None: (0, 0), 'LG_X10': (0, 0), 'LG_LEFT_WRAPPED': (0, -1), '2': (-2, 2), 'LG_WRAPPED': (0, 0)}

Maps LgFormat backup specifications to an internal representation Taken from the <WrapMode> element.

TotalDepth.util.plot.PRESCfgXML.BACKUP_FROM_COUNT_MAP = {None: (0, 0), '1': (-1, 1), '2': (-2, 2)}

Fallback mapping LgFormat backup specifications to an internal representation Taken from the <WrapCount> element.

class TotalDepth.util.plot.PRESCfgXML.CurveCfgXMLRead(e, theTrac, theFILMCfg)

Represents a single curve from an XML file specification

TRAC_XML_UNIQUEID_TO_PRES = {'Track2': b'T2 ', 'trackLHT1': b'LHT1', 'track23': b'T23 ', 'Track3': b'T3 ', 'depthTrack': b'TD ', 'track1': b'T1 ', 'track3': b'T3 ', 'track2': b'T2 ', 'DepthTrack': b'TD ', 'track12': b'T12 ', 'TrackFC0': b'LHT2', 'TrackFC1': b'LHT2', 'TrackFC2': b'RHT2', 'TrackFC3': b'LHT3', 'TrackFC4': b'RHT2', 'trackRHT1': b'RHT1', 'track4': b'T4 '}

First column is observed tracks in the XML, note capitalisation inconsistencies. Second column is LIS DEST equivalent

__init__(e, theTrac, theFILMCfg)

Creates a single CurveCfg object from an XML LgCurve element and populates a CurveCfg. e is the root LgCurve element. theTrac is the track name that this is being plotted on. theFILMCfg is expected to be a FilmCfgXMLRead object.

Example:

<LgCurve UniqueId="ROP5">
    <ChannelName>ROP5</ChannelName>
    <Color>0000FF</Color>
    <LeftLimit>500</LeftLimit>
    <RightLimit>0</RightLimit>
    <LineStyle>LG_DASH_LINE</LineStyle>
    <Thickness>1.75</Thickness>
    <WrapMode>LG_LEFT_WRAPPED</WrapMode>
</LgCurve>
Or:
<LgCurve UniqueId="PSR">
    <ChannelName>PSR</ChannelName>
    <Color>00C000</Color>
    <LeftLimit>0.2</LeftLimit>
    <RightLimit>2000</RightLimit>
    <Thickness>2</Thickness>
    <Transform>LG_LOGARITHMIC</Transform>
    <WrapCount>0</WrapCount>
</LgCurve>
class TotalDepth.util.plot.PRESCfgXML.PresCfgXMLRead(theFILMCfg, theUniqueId)

Extracts all curve presentation information from a single XML file.

__init__(theFILMCfg, theUniqueId)

Reads a XML and creates a CurveCfgXMLRead for each LgFormat/LgTrack/LgCurve element.

theFILMCfg is expected to be a FILMCfgXMLRead object.

Previous topic

PRES Plotting Configuration

Next topic

Plotting Well Log API headers

This Page