Namespace: bluefile

bluefile

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
options Object
  • 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
buf array
  • An existing ArrayBuffer of Bluefile data.
options Object
  • 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
buf ArrayBuffer
version String

the header version extracted from the file, always 'BLUE'

headrep String

endianness of header 'IEEE' or 'EEEI'

datarep String

endianness of data 'IEEE' or 'EEEI'

ext_start Number

byte offset for extended header binary data

ext_size Number

byte size for extended header data

type Number

the BLUEFILE type (1000 = 1-D data, 2000 = 2-D data)

class Number

the BLUEFILE class (i.e. type/1000)

format String

the BLUEFILE format, the format is a two character diagraph, such as SF.

timecode Number

absolute time reference for the file (in seconds since Jan 1st 1950)

xstart Number

relative offset for the first sample on the x-axis

xdelta Number

delta between points on the x-axis

xunits Number

the unitcode for the x-axis (see m.UNITS)

ystart Number

relative offset for the first sample on the y-axis

ydelta Number

delta between points on the y-axis

yunits Number

the unitcode for the y-axis (see m.UNITS)

subsize Number

the number of columns for a 2-D data file

data_start Number

byte offset for data

data_size Number

byte size for data

ext_header Object

extracted extended header keywords

spa Number

scalars per atom

bps Number

bytes per scalar

bpa Number

bytes per atom

ape Number

atoms per element

bpe Number

bytes per element

size Number

number of elements in dview

dview DataView

a Data

<static> read(theFile, onload)

Read a local Bluefile on disk.

Parameters:
Name Type Description
theFile File
  • a File object for the bluefile
onload readCallback
  • callback when the header has been read

<static> read_http(href, onload)

Read a Bluefile from a URL

Parameters:
Name Type Description
href string
  • the URL for the bluefile
onload readCallback
  • callback when the header has been read

<static> readheader(theFile, onload)

Read only the header from a local Bluefile.

Parameters:
Name Type Description
theFile File
  • a File object for the bluefile
onload readCallback
  • callback when the header has been read

<static> setData(buf, dvhdr, data_end, littleEndian)

Parameters:
Name Type Description
buf
dvhdr
data_end
littleEndian
DocStrap Copyright © 2012-2013 The contributors to the JSDoc3 and DocStrap projects.
Documentation generated by JSDoc 3.5.5 on 2018-05-19T11:32:34-04:00 using the DocStrap template.