Bluefiles are a binary format directly supported by SigPlot. A Bluefile consists of a 512-byte header
followed by binary data.
For more information on BLUEFILES, please visit http://nextmidas.techma.com/nm/htdocs/usersguide/BlueFiles.html
Offset Name Size Type Description
0 version 4 char[4] Header version
4 head_rep 4 char[4] Header representation
8 data_rep 4 char[4] Data representation
12 detached 4 int_4 Detached header
16 protected 4 int_4 Protected from overwrite
20 pipe 4 int_4 Pipe mode (N/A)
24 ext_start 4 int_4 Extended header start, in 512-byte blocks
28 ext_size 4 int_4 Extended header size in bytes
32 data_start 8 real_8 Data start in bytes
40 data_size 8 real_8 Data size in bytes
48 type 4 int_4 File type code
52 format 2 char[2] Data format code
54 flagmask 2 int_2 16-bit flagmask (1=flagbit)
56 timecode 8 real_8 Time code field
64 inlet 2 int_2 Inlet owner
66 outlets 2 int_2 Number of outlets
68 outmask 4 int_4 Outlet async mask
72 pipeloc 4 int_4 Pipe location
76 pipesize 4 int_4 Pipe size in bytes
80 in_byte 8 real_8 Next input byte
88 out_byte 8 real_8 Next out byte (cumulative)
96 outbytes 64 real_8[8] Next out byte (each outlet)
160 keylength 4 int_4 Length of keyword string
164 keywords 92 char[92] User defined keyword string
256 Adjunct 256 char[256] Type-specific adjunct union (See below for 1000 and 2000 type bluefiles)
Type-1000 Adjunct
0 xstart 8 real_8 Abscissa value for first sample
8 xdelta 8 real_8 Abscissa interval between samples
16 xunits 4 int_4 Units for abscissa values
Type-2000 Adjunct
0 xstart 8 real_8 Frame (column) starting value
8 xdelta 8 real_8 Increment between samples in frame
16 xunits 4 int_4 Frame (column) units
20 subsize 4 int_4 Number of data points per frame (row)
24 ystart 8 real_8 Abscissa (row) start
32 ydelta 8 real_8 Increment between frames
36 yunits 4 int_4 Abscissa (row) unit code
Methods
-
<static> BlueFileReader(options, "dict")
-
Bluefile Reader constructor.
Parameters:
Name Type Argument Description optionsObject - options that affect how the bluefile is read
"dict"string <optional>
options.ext_header_type
- if the BlueFile contains extended header keywords, extract them either as a dictionary ("dict", "json", {}, "XMTable", "JSON", "DICT") or as a list of key value pairs. The extended header keywords will be accessible on the hdr.ext_header property after the file has been read. -
<static> BlueHeader(buf, options, "dict")
-
Constructor for a BlueHeader that extracts paramters from the 512-byte
Bluefile binary header. If the data segment of the bluefile is also
included in the provided buffer it will be accessible as well
via the dview property.Parameters:
Name Type Argument Description bufarray - An existing ArrayBuffer of Bluefile data.
optionsObject - options that affect how the bluefile is read
"dict"string <optional>
options.ext_header_type
- if the BlueFile contains extended header keywords, extract them either as a dictionary ("dict", "json", {}, "XMTable", "JSON", "DICT") or as a list of key value pairs. The extended header keywords will be accessible on the hdr.ext_header property after the file has been read.See http://nextmidas.techma.com/nm/nxm/sys/docs/MidasBlueFileFormat.pdf for
more details on header properties.Properties:
Name Type Description bufArrayBuffer versionString the header version extracted from the file, always 'BLUE'
headrepString endianness of header 'IEEE' or 'EEEI'
datarepString endianness of data 'IEEE' or 'EEEI'
ext_startNumber byte offset for extended header binary data
ext_sizeNumber byte size for extended header data
typeNumber the BLUEFILE type (1000 = 1-D data, 2000 = 2-D data)
classNumber the BLUEFILE class (i.e. type/1000)
formatString the BLUEFILE format, the format is a two character diagraph, such as SF.
timecodeNumber absolute time reference for the file (in seconds since Jan 1st 1950)
xstartNumber relative offset for the first sample on the x-axis
xdeltaNumber delta between points on the x-axis
xunitsNumber the unitcode for the x-axis (see m.UNITS)
ystartNumber relative offset for the first sample on the y-axis
ydeltaNumber delta between points on the y-axis
yunitsNumber the unitcode for the y-axis (see m.UNITS)
subsizeNumber the number of columns for a 2-D data file
data_startNumber byte offset for data
data_sizeNumber byte size for data
ext_headerObject extracted extended header keywords
spaNumber scalars per atom
bpsNumber bytes per scalar
bpaNumber bytes per atom
apeNumber atoms per element
bpeNumber bytes per element
sizeNumber number of elements in dview
dviewDataView a Data
-
<static> read(theFile, onload)
-
Read a local Bluefile on disk.
Parameters:
Name Type Description theFileFile - a File object for the bluefile
onloadreadCallback - callback when the header has been read
-
<static> read_http(href, onload)
-
Read a Bluefile from a URL
Parameters:
Name Type Description hrefstring - the URL for the bluefile
onloadreadCallback - callback when the header has been read
-
<static> readheader(theFile, onload)
-
Read only the header from a local Bluefile.
Parameters:
Name Type Description theFileFile - a File object for the bluefile
onloadreadCallback - callback when the header has been read
-
<static> setData(buf, dvhdr, data_end, littleEndian)
-
Parameters:
Name Type Description bufdvhdrdata_endlittleEndian