finesse.solutions.array.ArraySolution

Overview

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

Bases: finesse.solutions.base.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]
Parameters

name : str

Name to give to this analysis

parents : BaseSolution

Parent solutions that have preceeded this solution being calculated. Can be None.

model : Model

Model object to get simulation data from

shape : numpy.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.

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.

ArraySolution.shape

Methods

ArraySolution.__init__(*args, **kwargs)

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