Holds all the information to draw a curve on a plot.
TODO: Split this to:
Created on 20 Mar 2011
Examples of PRES records summaries:
Table record (type 34) type: PRES
MNEM OUTP STAT TRAC CODI DEST MODE FILT LEDG REDG
-----------------------------------------------------------------------------------
SP SP ALLO T1 LLIN 1 SHIF 0.500000 -80.0000 20.0000
CALI CALI ALLO T1 LDAS 1 SHIF 0.500000 5.00000 15.0000
MINV MINV DISA T1 LLIN 1 SHIF 0.500000 30.0000 0.00000
MNOR MNOR DISA T1 LDAS 1 SHIF 0.500000 30.0000 0.00000
LLD LLD ALLO T23 LDAS 1 GRAD 0.500000 0.200000 2000.00
LLDB LLD ALLO T2 HDAS 1 GRAD 0.500000 2000.00 200000.
LLG LLG DISA T23 LDAS 1 GRAD 0.500000 0.200000 2000.00
LLGB LLG DISA T2 HDAS 1 GRAD 0.500000 2000.00 200000.
LLS LLS ALLO T23 LSPO 1 GRAD 0.500000 0.200000 2000.00
LLSB LLS ALLO T2 HSPO 1 GRAD 0.500000 2000.00 200000.
MSFL MSFL ALLO T23 LLIN 1 GRAD 0.500000 0.200000 2000.00
11 DUMM DISA T1 LLIN NEIT NB 0.500000 0.00000 1.00000
12 DUMM DISA T1 LLIN NEIT NB 0.500000 0.00000 1.00000
13 DUMM DISA T1 LLIN NEIT NB 0.500000 0.00000 1.00000
14 DUMM DISA T1 LLIN NEIT NB 0.500000 0.00000 1.00000
15 DUMM DISA T1 LLIN NEIT NB 0.500000 0.00000 1.00000
16 DUMM DISA T1 LLIN NEIT NB 0.500000 0.00000 1.00000
17 DUMM DISA T1 LLIN NEIT NB 0.500000 0.00000 1.00000
18 DUMM DISA T1 LLIN NEIT NB 0.500000 0.00000 1.00000
19 DUMM DISA T1 LLIN NEIT NB 0.500000 0.00000 1.00000
Table record (type 34) type: PRES
MNEM OUTP STAT TRAC CODI DEST MODE FILT LEDG REDG
-----------------------------------------------------------------------------------
NPHI NPHI ALLO T23 LDAS 1 SHIF 0.500000 0.450000 -0.150000
DRHO DRHO ALLO T3 LSPO 1 NB 0.500000 -0.250000 0.250000
PEF PEF ALLO T23 LGAP 1 SHIF 0.500000 0.00000 10.0000
SGR DISA T1 LLIN 1 SHIF 0.500000 0.00000 300.000
CGR DISA T1 LGAP 1 SHIF 0.500000 0.00000 300.000
TENS TENS DISA T3 LGAP 1 SHIF 0.500000 14000.0 4000.00
CAL CALI ALLO T1 LSPO 1 SHIF 0.500000 5.00000 15.0000
BS BS DISA T1 LGAP 1 SHIF 0.500000 5.00000 15.0000
FFLS FFLS DISA T1 LLIN 2 NB 0.500000 -0.150000 0.150000
FFSS FFSS DISA T1 LDAS 2 NB 0.500000 -0.150000 0.150000
LSHV LSHV DISA T3 LLIN 2 WRAP 0.500000 2150.00 2250.00
SSHV SSHV DISA T3 LDAS 2 WRAP 0.500000 1950.00 2050.00
FLS FLS DISA T2 LLIN 2 SHIF 0.500000 0.00000 150.000
FSS FSS DISA T2 LDAS 2 SHIF 0.500000 0.00000 150.000
RHOB RHOB ALLO T23 LLIN 1 SHIF 0.500000 1.95000 2.95000
PHIX PHIX ALLO T1 LLIN 1 NB 0.500000 0.500000 0.00000
TRAC nomenclature:
<LH | RH> T n <m>
Or as a regex: re.compile(r'^(LH|RH)*T(\d)(\d)*\s*$')
But this is handled by FILMCfg.
Example:
$ python3 TableHistogram.py -k --name=PRES -l40 --col=TRAC ../../../pLogicTestData/LIS/
Cmd: TableHistogram.py -k --name=PRES -l40 --col=TRAC ../../../pLogicTestData/LIS/
2011-05-27 09:26:12,324 ERROR Can not create Logical Record, error: can't convert negative value to unsigned int
2011-05-27 09:26:12,335 ERROR Can not create Logical Record, error: can't convert negative value to unsigned int
2011-05-27 09:26:12,346 ERROR Can not create Logical Record, error: can't convert negative value to unsigned int
2011-05-27 09:26:13,086 ERROR Can not read LIS file ../../../pLogicTestData/LIS/13576.S1 with error: Can not fit integer number of frames length 120 into LR length 824, modulo 104 [indirect size 0].
2011-05-27 09:26:13,907 ERROR Can not read LIS file ../../../pLogicTestData/LIS/13610.S1 with error: Can not fit integer number of frames length 7176 into LR length 13354, modulo 6178 [indirect size 0].
======================== Count of all table entries =======================
{"(34, b'PRES', b'TRAC', b'F1 ')": 4,
"(34, b'PRES', b'TRAC', b'F2 ')": 4,
"(34, b'PRES', b'TRAC', b'F3 ')": 4,
"(34, b'PRES', b'TRAC', b'F4 ')": 3,
"(34, b'PRES', b'TRAC', b'FD ')": 4,
"(34, b'PRES', b'TRAC', b'LHT1')": 4,
"(34, b'PRES', b'TRAC', b'LHT2')": 8,
"(34, b'PRES', b'TRAC', b'LHT3')": 59,
"(34, b'PRES', b'TRAC', b'RHT1')": 4,
"(34, b'PRES', b'TRAC', b'RHT2')": 22,
"(34, b'PRES', b'TRAC', b'RHT3')": 63,
"(34, b'PRES', b'TRAC', b'T1 ')": 2363,
"(34, b'PRES', b'TRAC', b'T2 ')": 354,
"(34, b'PRES', b'TRAC', b'T23 ')": 192,
"(34, b'PRES', b'TRAC', b'T3 ')": 178,
"(34, b'PRES', b'TRAC', b'TD ')": 93,
"(34, b'PRES', b'TRAC', b'XXXX')": 18}
====================== Count of all table entries END =====================
DEST:
======================== Count of all table entries =======================
{"(34, b'PRES', b'DEST', b'1 ')": 457,
"(34, b'PRES', b'DEST', b'123 ')": 2,
"(34, b'PRES', b'DEST', b'134 ')": 20,
"(34, b'PRES', b'DEST', b'2 ')": 139,
"(34, b'PRES', b'DEST', b'5 ')": 26,
"(34, b'PRES', b'DEST', b'6 ')": 122,
"(34, b'PRES', b'DEST', b'8 ')": 16,
"(34, b'PRES', b'DEST', b'A ')": 19,
"(34, b'PRES', b'DEST', b'ALL ')": 4,
"(34, b'PRES', b'DEST', b'BOTH')": 774,
"(34, b'PRES', b'DEST', b'D ')": 63,
"(34, b'PRES', b'DEST', b'E ')": 60,
"(34, b'PRES', b'DEST', b'J ')": 52,
"(34, b'PRES', b'DEST', b'K ')": 13,
"(34, b'PRES', b'DEST', b'NEIT')": 1610}
====================== Count of all table entries END =====================
MODE:
$ python3 TableHistogram.py -k --name=PRES -l40 --col=MODE ../../../pLogicTestData/LIS/
Cmd: TableHistogram.py -k --name=PRES -l40 --col=MODE ../../../pLogicTestData/LIS/
2011-06-02 08:22:54,839 ERROR Can not read LIS file ../../../pLogicTestData/LIS/13576.S1 with error: Can not fit integer number of frames length 120 into LR length 824, modulo 104 [indirect size 0].
2011-06-02 08:22:55,671 ERROR Can not read LIS file ../../../pLogicTestData/LIS/13610.S1 with error: Can not fit integer number of frames length 7176 into LR length 13354, modulo 6178 [indirect size 0].
======================== Count of all table entries =======================
{"(34, b'PRES', b'MODE', b'GRAD')": 245,
"(34, b'PRES', b'MODE', b'NB ')": 2329,
"(34, b'PRES', b'MODE', b'SHIF')": 597,
"(34, b'PRES', b'MODE', b'SWF ')": 3,
"(34, b'PRES', b'MODE', b'VDLN')": 3,
"(34, b'PRES', b'MODE', b'WRAP')": 186,
"(34, b'PRES', b'MODE', b'X10 ')": 10}
====================== Count of all table entries END =====================
COLO:
======================== Count of all table entries =======================
{"(34, b'PRES', b'COLO', b'000 ')": 173,
"(34, b'PRES', b'COLO', b'002 ')": 3,
"(34, b'PRES', b'COLO', b'003 ')": 6,
"(34, b'PRES', b'COLO', b'004 ')": 33,
"(34, b'PRES', b'COLO', b'014 ')": 6,
"(34, b'PRES', b'COLO', b'020 ')": 9,
"(34, b'PRES', b'COLO', b'021 ')": 8,
"(34, b'PRES', b'COLO', b'030 ')": 34,
"(34, b'PRES', b'COLO', b'034 ')": 2,
"(34, b'PRES', b'COLO', b'044 ')": 6,
"(34, b'PRES', b'COLO', b'104 ')": 3,
"(34, b'PRES', b'COLO', b'134 ')": 14,
"(34, b'PRES', b'COLO', b'203 ')": 3,
"(34, b'PRES', b'COLO', b'221 ')": 3,
"(34, b'PRES', b'COLO', b'312 ')": 10,
"(34, b'PRES', b'COLO', b'400 ')": 44,
"(34, b'PRES', b'COLO', b'404 ')": 6,
"(34, b'PRES', b'COLO', b'420 ')": 9,
"(34, b'PRES', b'COLO', b'430 ')": 17,
"(34, b'PRES', b'COLO', b'AQUA')": 3,
"(34, b'PRES', b'COLO', b'BLAC')": 1260,
"(34, b'PRES', b'COLO', b'BLUE')": 8,
"(34, b'PRES', b'COLO', b'GREE')": 37,
"(34, b'PRES', b'COLO', b'RED ')": 12}
====================== Count of all table entries END =====================
What are these numbers, RGB Base 5?
Track names F1 to F4 and FD.
This seems to be the nomenclature for four track plots. For example:
Table record (type 34) type: FILM
MNEM GCOD GDEC DEST DSCA
-----------------------------
8 EB0 --- PF8 D200
A LLLL 1111 PFA DM
E E4E -4- PFE D200
K E4E -4- PFK D500
Table record (type 34) type: PRES
MNEM OUTP STAT TRAC CODI DEST MODE FILT LEDG REDG COLO
-----------------------------------------------------------------------------------------
...
AX1A AX ALLO F2 LLIN A SHIF 0.500000 -9.00000 9.00000 400
AY1A AY ALLO F2 LSPO A SHIF 0.500000 -9.00000 9.00000 400
AZ1A AZ ALLO F2 LGAP A NB 0.500000 -9.00000 9.00000 400
AN1A ANOR ALLO F4 HDAS A NB 0.500000 9.00000 11.0000 420
CS1A CS DISA F1 LDAS A NB 0.500000 0.00000 150000. 000
FX1A FX ALLO F3 LLIN A NB 0.500000 -0.700000 0.700000 003
FY1A FY ALLO F3 LGAP A NB 0.500000 -0.700000 0.700000 003
FZ1A FZ ALLO F3 LSPO A NB 0.500000 -0.700000 0.700000 003
FN1A FNOR ALLO F4 LLIN A NB 0.500000 0.200000 0.700000 420
FI1A FINC ALLO F4 LGAP A NB 1.00000 0.00000 90.0000 420
GA1A GADZ DISA F1 LLIN A NB 1.00000 -1.00000 1.00000 020
GP1A GPV DISA F1 LGAP A NB 1.00000 14.0000 16.0000 020
GN1A GNV DISA F1 LDAS A NB 1.00000 -16.0000 -14.0000 020
GM1A GMT DISA F3 HDAS A SHIF 1.00000 80.0000 130.000 020
GA2A GAT DISA F2 HDAS A SHIF 1.00000 80.0000 130.000 020
SI1A SILO DISA FD HLIN A NB 1.00000 0.00000 20.0000 000
ST1A STIT DISA FD LLIN A NB 1.00000 0.00000 20.0000 000
ST2A STIA ALLO FD LLIN A NB 1.00000 0.00000 20.0000 000
TE1A TENS DISA FD LDAS A WRAP 0.500000 2000.00 7000.00 000
...
Specialisation of exception for this module.
Specialisation of exception for LineTransBase and descendants.
For LineTransBase and descendants where math errors occur.
Specialisation of exception for this module.
Specialisation of exception for PresCfg.
Specialisation of exception for CurveCfg.
Construction exception when making a CurveCfg object or descendant.
Specialisation of exception for CurveCfgLISRead and its travails.
Deafult light line width in pixels
Deafult heavy line width in pixels
Maps LIS CODI mnemonics to a Stroke object: If either value is None an SVG attribute is not needed i.e. default SVG behaviour
Maps LIS COLO mnemonics to CSS/SVG style colour specifications.
Returns a SVG colour as a string from a Mnem or None on failure.
Takes a Stroke object and returns a new stroke object with the colour replaced with the Color Mnem looked up, or determined from, the LIS_COLO_MAP.
No backup
Every backup i.e. ‘wrap’ Note: Plot.py has a way of limiting ludicrous backup lines to a sensible number; say 8
Single backup to left or right
Two backups to left or right
Single backup to left only
Single backup to right only
Map of backup mode to internal representation
Base class for line generators.
Ctor with values; leftP, rightP are physical positions as numbers. leftL, rightL are logical scales as numbers. backup is a pair (left, right). Will raise a ExceptionLineTransBase if leftP >= rightP.
The left value of the curve scale as a number.
The right value of the curve scale as a number.
Scale a given value to a dimension.
For a given value returns a pair (wrap, pos). wrap is an integer number of times the curve is wrapped. pos is a float that is the physical plot position of the value. TODO: Benchmark this, it could be slow.
Returns 0 if wrap integer is on scale depending on the backup setting. Returns -1 if off scale low, +1 if off scale high.
True is wrap integer is off-scale low according to the backup setting.
True is wrap integer is off-scale high according to the backup setting.
list of weak references to the object (if defined)
Linear grid.
Ctor with values; leftP, rightP are physical positions as numbers. leftL, rightL are logical scales as numbers. backup is a pair (left, right).
Scale a given value to a dimension.
For a given value returns a pair (wrap, pos). wrap is an integer number of times the curve is wrapped. pos is a float that is the physical plot position of the value. TODO: Benchmark this, it could be slow.
Logrithmic grid.
Ctor with values; leftP, rightP are physical positions as numbers. leftL, rightL are logical scales as numbers. backup is a pair (left, right).
Scale a given value to a dimension.
For a given value returns a pair (wrap, pos). wrap is an integer number of times the curve is wrapped. pos is a float that is the physical plot position of the value. TODO: Benchmark this, it could be slow.
Used to record the physical width data of a track leftP, rightP are Coord.Dim objects. halfTrackStart, halfTracks are integers
Return self as a plain tuple. Used by copy and pickle.
Create new instance of TrackWidthData(leftP, rightP, halfTrackStart, halfTracks)
Return a nicely formatted representation string
Alias for field number 2
Alias for field number 3
Alias for field number 0
Alias for field number 1
Contains the configuration of a single curve.
Populate attribute with reasonable default values. Second stage is to set: self.mnem, self.outp, self.trac, self.dest. Optionally other properties as well.
Returns a long descriptive string of the internal state.
Returns a TrackWidthData object for the film ID.
Given a FILM ID (a Mnem() object) this returns a LineTransBase or derivation that describes how this curve is plotted on that film. In particular the return value will have a function wrapPos() for generating track positions from a value.
list of weak references to the object (if defined)
Contains the configuration equivalent to a complete PRES table.
Adds to the IR. theCurveCfg is a CurvCfg object, theFilmDestS is a list of film destinations expanded from the FILM table e.g. if the destination is b’ALL’ then all FILM destination mnemonics should be in the list.
Returns the curve mnemonics.
Number of curves in this table.
Returns the CurveCfg object corresponding to curve ID, a Mnem.Mnem object.
Returns True if I have an entry for the curve ID, a Mnem.Mnem object.
list of weak references to the object (if defined)
Returns True if there are curves that go to theDest i.e. FILM ID.
Returns a list of output channel IDs for a given film destination, a Mnem.Mnem object.
Returns a list of channel IDs for a given film destination and output that feeds those curves. The curve data is accessible by __getitem__(). Arguments should be Mnem.Mnem objects
Returns True if this PRES table + FILM destination uses theOutp ID. Arguments should be , a Mnem.Mnem objects.
Information from a complete LIS PRES table.
Reads a LogiRec.Table object of type PRES and creates a CurveCfgLISRead for each row. theFILMCfg is expected to be a FILMCfgLISRead object.
Typical PRES table:
MNEM OUTP STAT TRAC CODI DEST MODE FILT LEDG REDG
-----------------------------------------------------------------------------------
NPHI NPHI ALLO T23 LDAS 1 SHIF 0.500000 0.450000 -0.150000
DRHO DRHO ALLO T3 LSPO 1 NB 0.500000 -0.250000 0.250000
PEF PEF ALLO T23 LGAP 1 SHIF 0.500000 0.00000 10.0000