sas.sasgui.perspectives.file_converter package
Submodules
sas.sasgui.perspectives.file_converter.converter_panel module
This module provides a GUI for the file converter
-
class
sas.sasgui.perspectives.file_converter.converter_panel.
ConverterPanel
(parent, base=None, *args, **kwargs)[source] Bases:
wx.lib.scrolledpanel.ScrolledPanel
,sas.sasgui.guiframe.panel_base.PanelBase
This class provides the File Converter GUI
-
ask_frame_range
(n_frames)[source] Display a dialog asking the user to input the range of frames they would like to export
Parameters: n_frames – How many frames the loaded data file has Returns: A dictionary containing the parameters input by the user
-
convert_1d_data
(qdata, iqdata)[source] Formats a 1D array of q_axis data and a 2D array of I axis data (where each row of iqdata is a separate row), into an array of Data1D objects
-
convert_to_cansas
(frame_data, filepath, single_file)[source] Saves an array of Data1D objects to a single CanSAS file with multiple <SasData> elements, or to multiple CanSAS files, each with one <SasData> element.
Parameters: frame_data – If single_file is true, an array of Data1D objects. If single_file is false, a dictionary of the form frame_number: Data1D. :param filepath: Where to save the CanSAS file :param single_file: If true, array is saved as a single file, if false, each item in the array is saved to it’s own file
-
datatype_changed
(event)[source] Update the UI and self.data_type when a data type radio button is pressed
-
extract_ascii_data
(filename)[source] Extracts data from a single-column ASCII file
Parameters: filename – The file to load data from Returns: A numpy array containing the extracted data
-
extract_bsl_data
(filename)[source] Extracts data from a 2D BSL file
Parameters: filename – The header file to extract the data from Return x_data: A 1D array containing all the x coordinates of the data Return y_data: A 1D array containing all the y coordinates of the data Return frame_data: A dictionary of the form frame_number: data, where data is a 2D numpy array containing the intensity data
-
extract_otoko_data
(filename)[source] Extracts data from a 1D OTOKO file
Parameters: filename – The OTOKO file to load the data from Returns: A numpy array containing the extracted data
-
get_metadata
()[source]
-
metadata_changed
(event)[source]
-
on_collapsible_pane
(event)[source] Resize the scrollable area to fit the metadata pane when it’s collapsed or expanded
-
on_convert
(event)[source] Called when the Convert button is clicked
-
on_help
(event)[source] Show the File Converter documentation
-
radiationtype_changed
(event)[source]
-
show_detector_window
(event)[source] Show the window for inputting Detector metadata
-
show_sample_window
(event)[source] Show the window for inputting Sample metadata
-
show_source_window
(event)[source] Show the window for inputting Source metadata
-
validate_inputs
()[source]
-
sas.sasgui.perspectives.file_converter.converter_widgets module
This module provides some custom wx widgets for the file converter perspective
-
class
sas.sasgui.perspectives.file_converter.converter_widgets.
FileInput
(parent, wildcard='')[source] Bases:
object
-
GetCtrl
()[source]
-
GetPath
()[source]
-
SetWildcard
(wildcard)[source]
-
-
class
sas.sasgui.perspectives.file_converter.converter_widgets.
VectorInput
(parent, control_name, callback=None, labels=['x: ', 'y: ', 'z: '], z_enabled=False)[source] Bases:
object
An input field for inputting 2 (or 3) components of a vector.
-
GetName
()[source]
-
GetSizer
()[source] Get the control’s sizer
Return sizer: a wx.BoxSizer object
-
GetValue
()[source] Get the value of the vector input
Return v: A Vector object
-
SetValue
(vector)[source] Set the value of the vector input
Parameters: vector – A Vector object
-
Validate
()[source] Validate the contents of the inputs
Return all_valid: Whether or not the inputs are valid Return invalid_ctrl: A control that is not valid (or None if all are valid)
-
sas.sasgui.perspectives.file_converter.file_converter module
File Converter Plugin
-
class
sas.sasgui.perspectives.file_converter.file_converter.
Plugin
[source] Bases:
sas.sasgui.guiframe.plugin_base.PluginBase
This class defines the interface for a Plugin class for File Converter perspective
-
get_tools
()[source] Returns a set of menu entries
-
on_file_converter
(event)[source]
-
put_icon
(frame)[source] Put icon in the frame title bar
-
sas.sasgui.perspectives.file_converter.frame_select_dialog module
-
class
sas.sasgui.perspectives.file_converter.frame_select_dialog.
FrameSelectDialog
(n_frames, is_bsl=False)[source] Bases:
wx._windows.Dialog
This class provides a wx.Dialog subclass for selecting which frames of a multi-frame file to export
sas.sasgui.perspectives.file_converter.meta_panels module
-
class
sas.sasgui.perspectives.file_converter.meta_panels.
DetectorPanel
(parent, detector, base=None, *args, **kwargs)[source] Bases:
sas.sasgui.perspectives.file_converter.meta_panels.MetadataPanel
-
on_close
(event=None)[source]
-
-
class
sas.sasgui.perspectives.file_converter.meta_panels.
MetadataPanel
(parent, metadata, base=None, *args, **kwargs)[source] Bases:
wx.lib.scrolledpanel.ScrolledPanel
,sas.sasgui.guiframe.panel_base.PanelBase
A common base class to be extended by panels that deal with metadata input. Handles input validation and passing inputted data back to ConverterPanel.
-
get_property_string
(name, is_float=False)[source]
-
on_change
(event)[source]
-
on_close
(event=None)[source]
-
-
class
sas.sasgui.perspectives.file_converter.meta_panels.
MetadataWindow
(PanelClass, parent=None, title='', base=None, manager=None, size=(440, 352.0), metadata=None, *args, **kwargs)[source] Bases:
wx._windows.MDIChildFrame
-
on_close
(event)[source]
-
-
class
sas.sasgui.perspectives.file_converter.meta_panels.
SamplePanel
(parent, sample, base=None, *args, **kwargs)[source] Bases:
sas.sasgui.perspectives.file_converter.meta_panels.MetadataPanel
-
on_close
(event=None)[source]
-
-
class
sas.sasgui.perspectives.file_converter.meta_panels.
SourcePanel
(parent, source, base=None, *args, **kwargs)[source] Bases:
sas.sasgui.perspectives.file_converter.meta_panels.MetadataPanel
-
on_close
(event=None)[source]
-