finesse.solutions.array.ArraySolution

Overview

class finesse.solutions.array.ArraySolution(name, parent, shape, xs, params)

Bases: BaseSolution

Holds outputs from running a simulation.

This is essentially a wrapped up Numpy structured array whose named elements are the names of outputs in a model.

Detectors are stored in the array by their name. So you can use:

output['detector_name']

or, if the key has an attribute called name (as all Finesse.detectors do) it will use that, so using:

output[ifo.detector]

will return the same values.

The underlying storage format is a Numpy structured array. You can select runs by:

output[ifo.detector][a:b:c]

where a:b:c is your slice. Or you can select multiple outputs with:

output[['det1', 'det2']][a:b:c]
Attributes:
namestr

Name to give to this analysis

parentBaseSolution

parent: finesse.tree.TreeNode

xtuple(ndarray)

Array of axes that have been scanned over

shapenumpy.ndarray

The shape of the underlying data array. use a single integer for 1D outputs, N-dimensional outputs can be specified by using tuples, i.e. (10,5,100) for a 3D array with the requested sizes.

params[array_like(objects)|array_like(str)]

Parameters associtated with each dimension of the data

Properties

ArraySolution.axes

ArraySolution.data

ArraySolution.entries

The number of outputs that have been stored in here so far

ArraySolution.outputs

Returns all the outputs that have been stored.

Methods

ArraySolution.__init__(*args, **kwargs)

ArraySolution.enable_update(self, ...)

This method will setup this solution to allow for fast C access for updating the solution in simulations.

ArraySolution.expand(self, shape)

Expands the output buffer by shape elements.

ArraySolution.get_legacy_data(self, model)

Get legacy style data

ArraySolution.plot(self, *detectors[, log, ...])

See finesse.plotting.plot.

ArraySolution.update(self, int index, bool mask)

Calling this will compute all detector outputs and add an entry to the outputs stored.

ArraySolution.write_legacy_data(self, model)

Write Finesse 2 style ASCII output file