Cases: ENS_CASE

Object API ››
Parent Previous Next

Cases: ENS_CASE

ENS_CASE Methods:

The valid operations are:

0=read 'len' bytes from "filename" starting at offset 'pos' in the file.  The return value is a list with two items:

    [the actual data read (as a string)   , the final file offset after the read].

1=write the data in 'd' to "filename" at the offset 'pos' in the file.  

    append may be set to avoid rewriting the file.  

    append=1 sets pos to the end of the file, while 

    append=2 uses the position specified by 'pos' . 

    The return value is the final file offset after the write. 

2=query the length of the "filename" in bytes.

'name': the name of the format

'ext1': a list of the allowed extensions for the first filename

'ext2': a list of the allowed extensions for the second filename

'elemrep': the default element representation

‘directory’: directory name of the path

‘filename’: the basename of the path

‘reader’: the name of the reader selected

‘secondname’: an optional key if a second (results) name was generated

‘playbefore’: the name of a command file to be played before the dataset is loaded

‘playafter’: the name of a command file to be played after a dataset is loaded

‘element_rep’: the desired element representation (integer)

‘name’: name of the reader

‘desc’: the reader supplied description of itself

‘active’: a boolean, true if this reader has been enabled by preferences

‘filebuttonlabels’: a list of labels for the 4 file buttons: File, Result, Bound, Measured. If an entry is None, the button should not be enabled

‘ID’: the internal reader ID number

‘builtin’: A boolean, returning False if this is a user-defined reader

‘autodistrib’: an integer describing the default SOS auto-distribute setting

‘GUI‘: This optional key contains a list of the user defined toggles, pulldowns and fields. This is presented as three lists (one each for toggles, pulldowns and fields, in that order). The toggle list contains three items: the string label, the default toggle status and the current user selection value. The pulldown list contains four items: the string label, a list of strings for the menu, the default menu selection and the current selection value. The field list contains two items: a label for the field and the current string in the field.

core.CASES[0].update_lookup_table(1,[0,10,20,30,40,50],[0,100,100,100,100,200],0,50)

Now create a new variable using LOOKUP(1,temperature) and it will map the data using this piecewise linear function (and even linear interpolate between the values).

Note: the ENS_CASE object supports Python iteration (see ENS_GROUP for examples).

ENS_CASE Attributes: