binoculars.backends package
Submodules
binoculars.backends.bm25 module
binoculars.backends.example module
-
class
binoculars.backends.example.
Input
(config)[source]
Bases: binoculars.backend.InputBase
-
generate_jobs
(command)[source]
Command is supplied when the program is started in the terminal. This can used to differentiate between separate datasets
that will be processed independently.
-
get_destination_options
(command)[source]
Creates the arguments that you can use to construct an output filename. This method returns
a dict object with keys that will can be used in the configfile. In the configfile the output
filename can now be described as ‘destination = demo_{first}-{last}.hdf5’.
This helps to organise the output automatically.
-
parse_config
(config)[source]
To collect and process data you need the values provided in the configuration file.
These you can access locally through the provided config object. This is a dict with
as keys the labels given in the configfile. To use them outside the parse_config method you attribute them
to the self.config object which can be used throughout the input class. A warning will be
generated afterwards for config values not popped out of the dict.
-
process_job
(job)[source]
This methods is a generator that returns the intensity, the weights and a tuple of coordinates that
will be used for projection. The input is a backend.job object. This objects contains attributes that are supplied
as keyword arguments in the generate_jobs method when backend.Job is instantiated. You can wet here the weights according
the behaviour of your detector. To select normal averaging give the weights the value of ones. This array should be the same shape as
the intensity array.
This example backend simulates a random path through angular space starting at the origin.
an example image will be generated using a three dimensional 10-slit interference function.
The angles are with respect to the sample where af and delta are the angular coordinates
of the pixels and ai and omega are the in plane and out of plane angles of the incoming beam.
-
class
binoculars.backends.example.
QProjection
(config)[source]
Bases: binoculars.backend.ProjectionBase
-
get_axis_labels
()[source]
Specify the names of the axes. The number of labels should be equal to the number
of arrays returned in the project method.
-
project
(wavelength, af, delta, omega, ai)[source]
This class takes as input the tuple of coordinates returned by the process_job
method in the backend.InputBase class. Here you specify how to project the coordinates
that belong to every datapoint. The number of input arguments should match the
second tuple returned by process_job. The shape of each returned array should match
the shape of the first argument returned by process_job
binoculars.backends.id03 module
-
class
binoculars.backends.id03.
CylindricalQProjection
(config)[source]
Bases: binoculars.backends.id03.QProjection
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
class
binoculars.backends.id03.
EH1
(config)[source]
Bases: binoculars.backends.id03.ID03Input
-
get_point_params
(scan, first, last)[source]
-
monitor_counter
= 'mon'
-
parse_config
(config)[source]
-
process_image
(scanparams, pointparams, image)[source]
-
class
binoculars.backends.id03.
EH2
(config)[source]
Bases: binoculars.backends.id03.ID03Input
-
get_point_params
(scan, first, last)[source]
-
monitor_counter
= 'Monitor'
-
parse_config
(config)[source]
-
process_image
(scanparams, pointparams, image)[source]
-
class
binoculars.backends.id03.
GammaDelta
(config)[source]
Bases: binoculars.backends.id03.HKLProjection
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
class
binoculars.backends.id03.
GammaDeltaMu
(config)[source]
Bases: binoculars.backends.id03.HKLProjection
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
class
binoculars.backends.id03.
GammaDeltaTheta
(config)[source]
Bases: binoculars.backends.id03.HKLProjection
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
class
binoculars.backends.id03.
GisaxsDetector
(config)[source]
Bases: binoculars.backends.id03.ID03Input
-
find_edfs
(pattern, scanno)[source]
-
get_point_params
(scan, first, last)[source]
-
monitor_counter
= 'mon'
-
parse_config
(config)[source]
-
process_image
(scanparams, pointparams, image)[source]
-
class
binoculars.backends.id03.
HKLProjection
(config)[source]
Bases: binoculars.backend.ProjectionBase
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
class
binoculars.backends.id03.
HKProjection
(config)[source]
Bases: binoculars.backends.id03.HKLProjection
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
class
binoculars.backends.id03.
ID03Input
(config)[source]
Bases: binoculars.backend.InputBase
-
static
apply_mask
(data, xmask, ymask)[source]
-
dbg_pointno
= None
-
dbg_scanno
= None
-
find_edfs
(pattern, scanno)[source]
-
generate_jobs
(command)[source]
Receives command from user, yields Job() instances
-
get_delayed_jobs
(scanno)[source]
-
get_delayed_scan
(scannumber, timeout=None)[source]
-
get_destination_options
(command)[source]
Receives the same command as generate_jobs(), but returns
dictionary that will be used to .format() the dispatcher:destination
configuration value.
-
get_images
(scan, first, last, dry_run=False)[source]
-
get_scan
(scannumber)[source]
-
get_scan_params
(scan)[source]
-
get_wavelength
(G)[source]
-
static
is_aborted
(scan)[source]
-
static
is_zap
(scan)[source]
-
parse_config
(config)[source]
-
process_job
(job)[source]
Receives a Job() instance, yields (intensity, args_to_be_sent_to_a_Projection_instance)
Job()s could have been pickle’d and distributed over a cluster
-
target
(scan)[source]
-
wait_for_points
(scannumber, stop, timeout=None)[source]
-
class
binoculars.backends.id03.
QProjection
(config)[source]
Bases: binoculars.backend.ProjectionBase
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
class
binoculars.backends.id03.
QTransformation
(config)[source]
Bases: binoculars.backends.id03.QProjection
-
get_axis_labels
()[source]
-
parse_config
(config)[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
class
binoculars.backends.id03.
Qpp
(config)[source]
Bases: binoculars.backends.id03.nrQProjection
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
class
binoculars.backends.id03.
SphericalQProjection
(config)[source]
Bases: binoculars.backends.id03.QProjection
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
class
binoculars.backends.id03.
ThetaLProjection
(config)[source]
Bases: binoculars.backend.ProjectionBase
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
class
binoculars.backends.id03.
TwoThetaProjection
(config)[source]
Bases: binoculars.backends.id03.SphericalQProjection
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
binoculars.backends.id03.
load_matrix
(filename)[source]
-
class
binoculars.backends.id03.
nrQProjection
(config)[source]
Bases: binoculars.backends.id03.QProjection
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
class
binoculars.backends.id03.
pixels
(config)[source]
Bases: binoculars.backend.ProjectionBase
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
-
class
binoculars.backends.id03.
specularangles
(config)[source]
Bases: binoculars.backend.ProjectionBase
-
get_axis_labels
()[source]
-
project
(wavelength, UB, gamma, delta, theta, mu, chi, phi)[source]
binoculars.backends.id03_xu module
binoculars.backends.sixs module
Module contents