ptypy.experiment.DiProI_FERMI.DiProIFERMIScan#
- class ptypy.experiment.DiProI_FERMI.DiProIFERMIScan(pars=None, **kwargs)#
Bases:
PtyScanDiProI (FERMI) data preparation class.
- __init__(pars=None, **kwargs)#
DiProI (FERMI) data preparation class.
Methods
__init__([pars])DiProI (FERMI) data preparation class.
auto(frames)Repeated calls to this function will process the data.
check([frames, start])Override in subclass for custom implementation
correct(raw, weights, common)Apply (eventual) corrections to the raw frames.
get_data_chunk(chunksize[, start])This function prepares a container that is compatible to data package.
Begins the Data preparation and intended as the first method that does read-write access on (large) data.
load(indices)Load data frames.
loading dark and flat
Load the positions and return as an (N, 2) array.
Function description see parent class.
Placeholder.
report([what, shout])Make a report on internal structure.
Attributes
CODESDEFAULTEOSKeys to store in meta param
WAITabortend_of_scanframes_accessibleTotal number of frames to prepare / load.
Minimum number of frames to prepare / load with call of
auto()Paramcontainer that stores all input parameters.- METAKEYS = ['version', 'num_frames', 'label', 'shape', 'psize', 'energy', 'center', 'distance']#
Keys to store in meta param
- auto(frames)#
Repeated calls to this function will process the data.
- Parameters:
frames (int) – Number of frames to process.
- Returns:
- one of the following
WAIT, if scan’s end is not reached, but no data could be prepared yet
EOS, if scan’s end is reached
a data package otherwise
- Return type:
variable
- check(frames=None, start=None)#
Override in subclass for custom implementation
This method checks how many frames the preparation routine may process, starting from frame start at a request of frames.
This method is supposed to return the number of accessible frames for preparation and should determine if data acquisition for this scan is finished. Its main purpose is to allow for a data acquisition scheme, where the number of frames is not known when
PtyScanis constructed, i.e. a data stream or an on-the-fly reconstructions.Note
If
num_framesis set on__init__()of the subclass, this method can be left as it is.- Parameters:
frames (int or None) – Number of frames requested.
start (int or None) – Scanpoint index to start checking from.
- Returns:
frames_accessible (int) – Number of frames readable.
end_of_scan (int or None) – is one of the following, - 0, end of the scan is not reached - 1, end of scan will be reached or is - None, can’t say
- correct(raw, weights, common)#
Apply (eventual) corrections to the raw frames. Convert from “raw” frames to usable data. :param raw: :param weights: :param common: :return:
- get_data_chunk(chunksize, start=None)#
This function prepares a container that is compatible to data package.
This function is called from the auto() function.
- info#
Paramcontainer that stores all input parameters.
- initialize()#
Begins the Data preparation and intended as the first method that does read-write access on (large) data. Does the following:
Creates a *.ptyd data file at location specified by
dfile(master node only)Calls
load_weight(),load_positions()load_common()(master node only forload_parallel==Noneorload_parallel=='data')Sets
num_framesif neededCalls
post_initialize()
- load(indices)#
Load data frames.
- Parameters:
indices
- Returns:
- load_common()#
loading dark and flat
- load_positions()#
Load the positions and return as an (N, 2) array.
- load_weight()#
Function description see parent class. For now, this function will be used to load the mask.
- num_frames#
Total number of frames to prepare / load. Set by
num_frames
- post_initialize()#
Placeholder. Called at the end of
initialize()by all processes.Use this method to benefit from ‘hard-to-retrieve but now available’ information after initialize.
- report(what=None, shout=True)#
Make a report on internal structure.