This describes how TotalDepth.LIS handles representation codes, it covers several modules.
There is a top level module RepCode that imports all sub-modules and provides some fundamental definitions. Sub-modules pRepCode and cRepCOde provide alternative implementations in Python or Cython.
This provides the main interface to Representation Code processing as well as some fundamental definitions.
This module is the top level module that imports other sub-modules implemented in Python, Cython or C/C++. The Cython implementations take precedence as this module imports the sub-modules thus:
from TotalDepth.LIS.core.pRepCode import *
from TotalDepth.LIS.core.cRepCode import *
Module for translating raw LIS to an appropriate internal type for LIS Representation Codes (‘RepCodes’).
This aggregates pRepCode and cRepCode with the latter overwriting the former.
Created on 11 Nov 2010
@author: p2ross
Exception for indeterminate length when using Rep Code 65.
Exception for unknown Representation codes in look up tables.
Exception for unknown Representation codes in look up tables.
Given theRc as a Rep Code type and a word value this returns the internal value.
Returns a Representation Code 49 value from a File object.
Returns a Representation Code 50 value from a File object.
Returns a Representation Code 56 value from a File object.
Returns a Representation Code 66 value from a File object.
Returns a Representation Code 68 value from a File object.
Returns a Representation Code 70 value from a File object.
Returns a Representation Code 73 value from a File object.
Returns a Representation Code 77 value from a File object.
Returns a Representation Code 79 value from a File object.
Reads a Representation Code from the a bytes() object. If theRc is 65 (string) then theLen must be supplied, up to that length of bytes will be returned.
Reads Dipmeter RepCode 130 and returns a list of (integer) values.
Reads Dipmeter RepCode 234 and returns a list of (integer) values.
Returns a Representation Code 49 value from a bytes object.
Returns a Representation Code 50 value from a bytes object.
Returns a Representation Code 56 value from a bytes object.
Returns a Representation Code 66 value from a bytes object.
Returns a Representation Code 68 value from a bytes object.
Returns a Representation Code 70 value from a bytes object.
Returns a Representation Code 73 value from a bytes object.
Returns a Representation Code 77 value from a bytes object.
Returns a Representation Code 79 value from a bytes object.
Reads a Representation Code from the file and returns a value. If theRc is 65 (string) then theLen must be supplied, up to that length of bytes will be returned.
Takes a value v and a Representation Code r and converts this to a bytes() object.
Converts a value to a Rep Code 66 and returns the bytes.
Converts a value to a Rep Code 68 and returns the bytes.
Converts a value to a Rep Code 73 and returns the bytes.
This contains Python implementations.
This module is not designed to imported directly, use RepCode instead. This module can be imported only for test purposes thus:
from TotalDepth.LIS.core import pRepCode
Python module for translating raw LIS to an appropriate internal type for LIS Representation Codes (‘RepCodes’).
Created on 11 Nov 2010
@author: p2ross
Specialisation of exception for Representation codes.
Specialisation of exception for unknown Representation codes.
Returns a double from Rep code 49 0x31, 16bit floating point representation. Value +153 is 0100 1100 1000 1000 or 0x4C88. Value -153 is 1011 0011 1000 1000 or 0xB388.
Returns a double from Rep code 0x32, 32bit floating point representation. Value +153 is 0x00084C80 Value -153 is 0x0008B380
Returns an integer from Rep code 0x38, signed char representation.
Returns a Rep code 0x42, unsigned byte from theWord, expected to be an integer.
Returns a double from a Rep code 68 word (a 32 bit integer).
Returns a double from a Rep code 0x46, 32bit fixed point.
Returns a integer from a Rep code 0x49, 32bit signed integer.
Returns a Rep code 0x4D, 8bit mask from theWord, expected to be an integer.
Returns an integer from Rep code 0x4F, 16bit signed integer.
Returns True if the Rep Code is represented by an integer.
Returns the size in bytes for a single instance of a representation code. Zero means variable length. May raise ExceptionRepCodeUnknown.
Returns the maximum value for various representation codes. May raise ExceptionRepCodeUnknown.
Returns a pair; (minimum value, maximum value) for various representation codes. May raise ExceptionRepCodeUnknown.
Returns the minimum value for various representation codes. May raise ExceptionRepCodeUnknown.
Returns a Representation Code 49 value from a File object.
Returns a Representation Code 50 value from a File object.
Returns a Representation Code 56 value from a File object.
Returns a Representation Code 66 value from a File object.
Returns a Representation Code 68 value from a File object.
Returns a Representation Code 70 value from a File object.
Returns a Representation Code 73 value from a File object.
Returns a Representation Code 77 value from a File object.
Returns a Representation Code 79 value from a File object.
Converts a double to Rep code 49 0x31, 16bit floating point representation. Value +153 is 0100 1100 1000 1000 or 0x4C88. Value -153 is 1011 0011 1000 1000 or 0xB388.
Converts a double to Rep code 0x32, 32bit floating point representation.
Converts a double to Rep code 0x38, signed char representation.
Converts theVal to representation code 66 integer from theWord.
Returns Representation code 68 as a 32 bit integer from a double.
Returns Rep code 0x46, 32bit fixed point from an int or double.
Returns Rep code 0x49, 32bit signed integer from an int or double.
Converts theVal to Rep code 0x4D, 8bit mask from theVal.
Converts a double to Rep code 0x4F, 16bit signed integer.
Returns the word length in bytes used by a representation code. NOTE: This is subtly different from lisSize as it take into account dipmeter sub-channels Zero means variable length. May raise ExceptionRepCodeUnknown.
This contains Cython implementations. By the import mechanism used be RepCode these implementations take precedence over the implementations in pRepCode.
This module is not designed to imported directly, use RepCode instead. This module can be imported only for test purposes thus:
from TotalDepth.LIS.core import cRepCode
Cython module for translating raw LIS to an appropriate internal type for LIS Representation Codes (‘RepCodes’).
Internal types are double, int or string.
The unit tests are in test/TestRepCode.py and test/TestRepCode68.py.