EMaligner¶
-
class
EMaligner.EMaligner.
EMaligner
(input_data=None, schema_type=None, output_schema_type=None, args=None, logger_name='argschema.argschema_parser')¶ Bases:
argschema.argschema_parser.ArgSchemaParser
Note
This class takes a ArgSchema as an input to parse inputs , with a default schema of type
EMA_Schema
-
assemble_and_solve
(zvals)¶ retrieves a ResolvedTiles object from some source and then assembles/solves, outputs to hdf5 and/or outputs to an output_stack object.
Parameters: zvals ( numpy.ndarray
) – int or float, z ofrenderapi.tilespec.TileSpec
-
assemble_from_db
(zvals)¶ assembles a matrix from a pointmatch source given the already-retrieved ResolvedTiles object. Then solves or outputs to hdf5.
Parameters: zvals – int or float, z of renderapi.tilespec.TileSpec
-
assemble_from_hdf5
(filename, zvals, read_data=True)¶ assembles and solves from an hdf5 matrix assembly previously created with output_mode = “hdf5”.
Parameters: zvals ( numpy.ndarray
) – int or float, z ofrenderapi.tilespec.TileSpec
-
create_CSR_A
(resolved)¶ - distributes the work of reading pointmatches and
- assembling results
Parameters: resolved ( renderapi.resolvedtiles.ResolvedTiles
) – resolved tiles object from which to create A matrix
-
default_schema
¶ alias of
EMaligner.schemas.EMA_Schema
-
run
()¶ main function call for EM_aligner_python solver
-
solve_or_not
(A, weights, reg, x0, rhs)¶ solves or outputs assembly to hdf5 files
Parameters: - A (
scipy.sparse.csr
) – the matrix, N (equations) x M (degrees of freedom) - weights (
scipy.sparse.csr_matrix
) – N x N diagonal matrix containing weights - reg (
scipy.sparse.csr_matrix
) – M x M diagonal matrix containing regularizations - x0 (
numpy.ndarray
) – M x nsolve float constraint values for the DOFs - rhs (
numpy.ndarray
:) – rhs vector(s) N x nsolve float right-hand-side(s)
Returns: - message (str) – solver or hdf5 output message for logging
- results (dict) – keys are “x” (the results), “precision”, “error” “err”, “mag”, and “time”
- A (
-
-
EMaligner.EMaligner.
calculate_processing_chunk
(fargs)¶ job to parallelize for creating a sparse matrix block and associated vectors from a pair of sections
Parameters: fargs (List) – serialized inputs for multiprocessing job Returns: chunk – keys are ‘zlist’, ‘block’, ‘weights’, and ‘rhs’ Return type: dict
-
EMaligner.EMaligner.
tilepair_weight
(z1, z2, matrix_assembly)¶ get weight factor between two tilepairs
Parameters: Returns: tp_weight – weight factor
Return type: