QUIPOpFile

class wss_tools.quip.qio.QUIPOpFile(op_type, outdir, correction_id='R2017061401', create_outdir=True)[source]

Bases: object

Class to handle generation of QUIP Operation File.

Parameters
op_type{‘MIMF’, ‘SEGMENT_ID’, ‘THUMBNAIL’}

Operation type.

outdirstr

Output directory for the QUIP operation. This is used only for the population of the OUTPUT fields in the QUIP Operation File.

correction_idstr

Correction ID. Default value is arbitrary.

create_outdirbool

Create the given outdir directory tree if it does not exist.

Raises
ValueError

Invalid operation type.

Examples

Create a QUIP Operation File from scratch:

>>> import glob
>>> import os
>>> from wss_tools.quip.qio import QUIPOpFile
>>> opfile = QUIPOpFile('THUMBNAIL', '/my/path/quip')
>>> opfile.input_files = list(map(os.path.abspath, glob.iglob('*.fits')))
>>> opfile.write_xml('/my/path/opsfile/operation_file_001.xml')

Attributes Summary

input_files

List of input data filenames, with absolute paths.

Methods Summary

write_xml(filename)

Write the QUIP Operation File XML file.

xml_dict()

Create a dictionary that can be converted to QUIP Operation File XML.

Attributes Documentation

input_files

List of input data filenames, with absolute paths.

Methods Documentation

write_xml(filename)[source]

Write the QUIP Operation File XML file. This is really just a convenience method that calls output_xml().

Parameters
filenamestr

Output XML file.

Raises
OSError

Output file exists.

xml_dict()[source]

Create a dictionary that can be converted to QUIP Operation File XML.

Returns
out_dictdict

Dictionary to be converted to XML by write_xml().