UI¶
-
class
xpolbeamline.ui.
UI
(inpath, statspath, outpath=None)[source]¶ Bases:
object
Simple User Interface to the xpolbeamline package
This class provides a simple user interface to the most important functionality of the xpolbeamline package. If provides a quick way to convert the tif files from the CCD camera and display a quicklook analysis to check that everything went well before taking the next exposure.
An
UI
object is initialized with the path to the raw data, the statsfile, and an output path. After that, the methods work on the files in that directory.Parameters: inpath : string
Path to the raw data (tif and txt files). Can be absolute or relative to the current working directory.
statspath : string
Path to the statfiles. This can include the filename for the statsfile. If the filename is not given, the converter will try to construct the filename using our normal file naming convention. Path can be absolute or relative to the current working directory.
outpath : string or
None
Path where output files are written. Can be absolute or relative to the current working directory. If not given or set to
None
, this defaults to use the same location asinpath
.Attributes Summary
inpath
Path to the raw data (tif and txt files). outpath
Path where output files are written. statspath
Path to the statfiles. Methods Summary
convert
(filename)Convert file from tif and txt to fits image and event list. convert_display
(filename)Convert tif files and display quicklook convert_display_newest
()Convert most recenly modified tif file and display quicklook Attributes Documentation
-
inpath
= '.'¶ Path to the raw data (tif and txt files).
Can be absolute or relative to the current working directory.
-
outpath
= '.'¶ Path where output files are written.
Can be absolute or relative to the current working directory.
-
statspath
= '.'¶ Path to the statfiles.
This can include the filename for the statsfile. If the filename is not given, the converter will try to construct the filename using our normal file naming convention. Path can be absolute or relative to the current working directory.
Methods Documentation
-
convert
(filename)[source]¶ Convert file from tif and txt to fits image and event list.
Parameters: filename : string
Name of file (no path)
Returns: out : string
Filename of fits image
evt :
astropy.table.Table
Events table
-
convert_display
(filename)[source]¶ Convert tif files and display quicklook
Parameters: filename : string
Name of file and path relative to the path where python is running.
Returns: out : string
Filename of fits image
evt :
astropy.table.Table
Events table
fig :
matplotlib.figure.Figure
Figure instance that can be used to save to file or to further modify the figure.
-
convert_display_newest
()[source]¶ Convert most recenly modified tif file and display quicklook
It searches for the newest file in the
inpath
property of theUI
object.Returns: out : string
Filename of fits image
evt :
astropy.table.Table
Events table
-