- PS_field(pspace, func)#
Convenience function sampling a power spectrum
- abs(x, *args, **kwargs)#
- absolute(x, *args, **kwargs)#
- arctan(x, *args, **kwargs)#
- calculate_position(operator, output)#
Finds approximate preimage of an operator for a given output.
- clip(x, *args, **kwargs)#
- cos(x, *args, **kwargs)#
- cosh(x, *args, **kwargs)#
- create_harmonic_smoothing_operator(domain, space, sigma)#
Creates an operator which smoothes a subspace of a harmonic domain.
domain (DomainTuple) – The total domain and target of the operator
space (int) – the index of the subspace on which the operator acts. This must be a harmonic space
sigma (float) – The sigma of the Gaussian smoothing kernel
The requested smoothing operator
- Return type:
- create_power_operator(domain, power_spectrum, space=None)#
Creates a diagonal operator with the given power spectrum.
Constructs a diagonal operator that is defined on the specified domain.
An operator that implements the given power spectrum.
- Return type:
- density_estimator(domain, pad=1.0, cf_fluctuations=None, cf_azm_uniform=None, prefix='')#
Computes the union of multiple DomainTuples/MultiDomains.
domains (list of DomainTuple or MultiDomain) –
if DomainTuple, all entries must be equal
if MultiDomain, there must not be any conflicting components
- exec_time(obj, want_metric=True)#
Times the execution time of an operator or an energy.
- exp(x, *args, **kwargs)#
- expm1(x, *args, **kwargs)#
- exponentiate(x, *args, **kwargs)#
- from_random(domain, random_type='normal', dtype=<class 'numpy.float64'>, **kwargs)#
Convenience function creating Fields/MultiFields with random values.
domain (Domainoid) – the intended domain of the output field
random_type ('pm1', 'normal', or 'uniform') – The random distribution to use.
dtype (type) – data type of the output field (e.g. numpy.float64) If the datatype is complex, each real an imaginary part have variance 1.
**kwargs (additional parameters for the random distribution) – (‘mean’ and ‘std’ for ‘normal’, ‘low’ and ‘high’ for ‘uniform’)
The newly created random field
- Return type:
When called with a multi-domain, the individual fields will be drawn in alphabetical order of the multi-domain’s domain keys. As a consequence, renaming these keys may cause the multi-field to be filled with different random numbers, even for the same initial RNG state.
- full(domain, val)#
Convenience function creating Fields/MultiFields with uniform values.
- get_default_codomain(domainoid, space=None)#
For RGSpace, returns the harmonic partner domain. For DomainTuple, returns a copy of the object in which the domain indexed by space is substituted by its harmonic partner domain. In this case, if space is None, it is set to 0 if the DomainTuple contains exactly one domain.
domain (RGSpace or DomainTuple) – Domain for which to constuct the default harmonic partner
space (int) – Optional index of the subdomain to be replaced by its default codomain. domain[space] must be of class RGSpace.
- get_signal_variance(spec, space)#
Computes how much a field with a given power spectrum will vary in space
This is a small helper function that computes the expected variance of a harmonically transformed sample of this power spectrum.
spec (method) – a method that takes one k-value and returns the power spectrum at that location
space (PowerSpace or any harmonic Domain) – If this function is given a harmonic domain, it creates the naturally binned PowerSpace to that domain. The field, for which the signal variance is then computed, is assumed to have this PowerSpace as naturally binned PowerSpace
Checks if object is field-like.
Checks if object behaves like a likelihood energy.
Checks if object is linearization-like.
Checks if object is operator-like.
- log(x, *args, **kwargs)#
- log10(x, *args, **kwargs)#
- log1p(x, *args, **kwargs)#
Convenience function creating DomainTuples/MultiDomains Domainoids.
- makeField(domain, arr)#
Convenience function creating Fields/MultiFields from Numpy arrays or dicts of Numpy arrays.
- makeOp(input, dom=None)#
Converts a Field or MultiField to a diagonal operator.
if None, None is returned.
- if Field on scalar-domain, a ScalingOperator with the coefficient
given by the Field is returned.
- if Field, a DiagonalOperator with the coefficients given by this
Field is returned.
- if MultiField, a BlockDiagonalOperator with entries given by this
MultiField is returned.
No volume factors are applied.
- power(x, *args, **kwargs)#
- power_analyze(field, spaces=None, binbounds=None, keep_phase_information=False)#
Computes the power spectrum for a subspace of field.
Creates a PowerSpace for the space addressed by spaces with the given binning and computes the power spectrum as a
Fieldover this PowerSpace. This can only be done if the subspace to be analyzed is a harmonic space. The resulting field has the same units as the square of the initial field.
field (Field) – The field to be analyzed
spaces (None or int or tuple of int, optional) – The indices of subdomains for which the power spectrum shall be computed. If None, all subdomains will be converted. (default : None).
binbounds (None or array-like, optional) – Inner bounds of the bins (default : None). if binbounds is None : bins are inferred.
keep_phase_information (bool, optional) – If False, return a real-valued result containing the power spectrum of field. If True, return a complex-valued result whose real component contains the power spectrum computed from the real part of field, and whose imaginary component contains the power spectrum computed from the imaginary part of field. The absolute value of this result should be identical to the output of power_analyze with keep_phase_information=False. (default : False).
The output object. Its domain is a PowerSpace and it contains the power spectrum of field.
- Return type:
- reciprocal(x, *args, **kwargs)#
- sigmoid(x, *args, **kwargs)#
- sign(x, *args, **kwargs)#
- sin(x, *args, **kwargs)#
- sinc(x, *args, **kwargs)#
- single_plot(field, **kwargs)#
Creates a single plot using Plot. Keyword arguments are passed to both Plot.add and Plot.output.
- sinh(x, *args, **kwargs)#
- softplus(x, *args, **kwargs)#
- sqrt(x, *args, **kwargs)#
- tan(x, *args, **kwargs)#
- tanh(x, *args, **kwargs)#
- unitstep(x, *args, **kwargs)#