viperleed.calc.files.beams

Functions for reading and writing beams files.

This includes: BEAMLIST, IVBEAMS, EXPBEAMS and AUXEXPBEAMS.

Functions

averageBeams(beams[, weights])

Takes a list of percentages and a list of lists of Beam objects.

checkEXPBEAMS(sl, rp[, domains])

readAUXEXPBEAMS([filename, interactive])

Reads beams from an AUXEXPBEAMS file, which already has the formatting required by TensErLEED.

readBEAMLIST([filename])

Reads the BEAMLIST file and returns the contents as a list of the lines as strings.

readIVBEAMS([filename])

Reads an IVBEAMS file and returns a list of beams (using Beam class)

readOUTBEAMS([filename, sep, enrange])

Reads beams from an EXPBEAMS.csv or THEOBEAMS.csv file.

sortIVBEAMS(sl, rp)

Sorts the beams in IVBEAMS such that they appear in the same order as in the BEAMLIST.

writeAUXBEAMS([ivbeams, beamlist, ...])

"Reads from a BEAMLIST file (full list of beams for calculation), finds the beams listed in IVBEAMS (if not passed as a list 'beams', will attempt to call readIVBEAMS directly) and copies the corresponding lines to AUXBEAMS.

writeAUXEXPBEAMS(beams[, filename, header, ...])

Takes a list of Beam objects and writes them in the format required by TensErLEED for experimental beam data.

writeFdOut(beams[, beamlist, filename, header])

Writes an fd.out file for the given beams.

writeIVBEAMS(sl, rp[, filename, domains])

Writes an IVBEAMS file based on rp.exbeams.

writeOUTBEAMS(beams[, filename, sep, which])

Takes a list of Beam objects and writes them to a comma-separated file.