read_genx[source] [edit on github]

solarsoft genx file reader.

genx files have been used to store calibration data for multiple instruments and distributed within solarsoft. They are stored in XDR format; The External Data Representation Standard file format (XDR) is described in RFC 1014, written by Sun Microsystems, Inc. June 1987.

SolarSoft genx writer creates structures to store the values together with the variable names. It use the size IDL function to include the data type, dimension and number of elements that each variable contains.


filename (str) – The genx file to be read


output (OrderedDict) – A dictionary with possibly nested dictionaries with the data in the genx file.


The reader aims to maintain the shape and type of the arrays, but take care with the difference in indexing between Python and IDL (row mayor vs column mayor).

Regarding the type notice that single numbers are converted to python precision, therefore a single integer is converted from 16 to 32/64 bits, and a float from 32 to 64.

Strings read from genx files are assumed to be UTF-8.