Potku  1.0.0
Class Documentation
 All Classes Namespaces Functions
Modules.Measurement.Measurement Class Reference

Public Member Functions

def __init__
 
def load_data
 
def set_loggers
 
def remove_and_close_log
 
def set_axes
 
def add_point
 
def undo_point
 
def purge_selection
 
def remove_all
 
def draw_selection
 
def end_open_selection
 
def selection_select
 
def selection_count
 
def reset_select
 
def remove_selected
 
def save_cuts
 
def get_cut_files
 
def fill_cuts_treewidget
 
def load_selection
 
def generate_tof_in
 

Public Attributes

 measurement_file
 
 measurement_name
 
 directory
 
 directory_cuts
 
 directory_elemloss
 
 project
 
 data
 
 tab_id
 
 measurement_settings
 
 statusbar
 
 selector
 
 color_scheme
 
 defaultlog
 
 errorlog
 

Detailed Description

Measurement class to handle one measurement data.

Constructor & Destructor Documentation

def Modules.Measurement.Measurement.__init__ (   self,
  measurement_file,
  project,
  tab_id 
)
Inits measurement.

Args:
    measurement_file: String representing path to measurement file.
    project: Project class object.
    tab_id: Integer representing tab identifier for measurement.

Member Function Documentation

def Modules.Measurement.Measurement.add_point (   self,
  point,
  canvas 
)
Add point into selection or create new selection if first or all closed.

Args:
    point: Point (x, y) to be added to selection.
    canvas: matplotlib's FigureCanvas where selections are drawn.
    
Return:
    1: When point closes open selection and allows new selection to 
be made.
    0: When point was added to open selection.
    -1: When new selection is not allowed and there are no selections.
def Modules.Measurement.Measurement.draw_selection (   self)
Draw all selections in measurement.
def Modules.Measurement.Measurement.end_open_selection (   self,
  canvas 
)
End last open selection.

Ends last open selection. If selection is open, it will show dialog to 
select element information and draws into canvas before opening the dialog.

Args:
    canvas: Matplotlib's FigureCanvas

Return:
    1: If selection closed
    0: Otherwise
def Modules.Measurement.Measurement.fill_cuts_treewidget (   self,
  treewidget,
  use_elemloss = False 
)
Fill QTreeWidget with cut files.

Args:
    treewidget: QtGui.QTreeWidget, where cut files are added to.
    elemloss: Boolean representing whether to add elemental losses or not.
def Modules.Measurement.Measurement.generate_tof_in (   self)
Generate tof.in file for external programs.

Generates tof.in file for measurement to be used in external programs 
(tof_list, erd_depth).
def Modules.Measurement.Measurement.get_cut_files (   self)
Get cut files from a measurement.

Return:
    Returns a list of cut files in measurement.
def Modules.Measurement.Measurement.load_data (   self)
Loads measurement data from filepath
def Modules.Measurement.Measurement.load_selection (   self,
  filename 
)
Load selections from a file_path.

Removes all current selections and loads selections from given filename.

Args:
    filename: String representing (full) directory to selection file_path.
def Modules.Measurement.Measurement.purge_selection (   self)
Purges (removes) all open selections and allows new selection to be made.
def Modules.Measurement.Measurement.remove_all (   self)
Remove all selections in selector.
def Modules.Measurement.Measurement.remove_and_close_log (   self,
  log_filehandler 
)
Closes the log file and removes it from the logger.

Args:
    log_filehandler: Log's filehandler.
def Modules.Measurement.Measurement.remove_selected (   self)
Remove selection

Removes currently selected selection.
def Modules.Measurement.Measurement.reset_select (   self)
Reset selection to None.

Resets current selection to None and resets colors of all selections
to their default values. 
def Modules.Measurement.Measurement.save_cuts (   self)
Save cut files

Saves data points within selections into cut files.
def Modules.Measurement.Measurement.selection_count (   self)
Get count of selections.

Return:
    Returns the count of selections in selector object.
def Modules.Measurement.Measurement.selection_select (   self,
  cursorpoint,
  highlight = True 
)
Select a selection based on point.

Args:
    point: Point (x, y) which is clicked on the graph to select selection.
    highlight: Boolean to determine whether to highlight just this 
       selection.
    
Return:
    1: If point is within selection.
    0: If point is not within selection.
def Modules.Measurement.Measurement.set_axes (   self,
  axes 
)
Set axes information to selector within measurement.

Sets axes information to selector to add selection points. Since 
previously when creating measurement old selection could not be checked. 
Now is time to check for it, while data is still "loading".

Args:
    axes: Matplotlib FigureCanvas's subplot
def Modules.Measurement.Measurement.set_loggers (   self)
Sets the loggers for this specified measurement. 

The logs will be displayed in the measurements folder.
After this, the measurement logger can be called from anywhere of the 
program, using logging.getLogger([measurement_name]).
def Modules.Measurement.Measurement.undo_point (   self)
Undo last point in open selection.
     
Undo last point in open (last) selection. If there are no selections, 
do nothing.

The documentation for this class was generated from the following file: