Legacy lnPi array routines (maskedlnpi_legacy
)#
Classes:
|
Class to store masked version of \(\ln\Pi(N)\). |
- class lnPi.maskedlnpi_legacy.MaskedlnPiLegacy(data=None, lnz=None, state_kws=None, extra_kws=None, **kwargs)[source]#
Bases:
MaskedArray
,AccessorMixin
Class to store masked version of \(\ln\Pi(N)\). shape is (N0,N1,…) where Ni is the span of each dimension)
Constructor
- Parameters:
data (array-like) – data for lnPi
lnz (array-like, optional) – if None, set lnz=np.zeros(data.ndim)
state_kws (
dict
, optional) – dictionary of state values, such asvolume
andbeta
. These parameters will be pushed toself.xge
coordinates.extra_kws (
dict
, optional) – this defines extra parameters to pass along. Note that for potential energy calculations, extra_kws should contain PE (total potential energy for each N vector).zeromax (
bool
, defaultFalse
) – if True, shift lnPi = lnPi - lnPi.max()pad (
bool
, defaultFalse
) – if True, pad masked region by interpolation**kwargs – Extra arguments to
numpy.ma.MaskedArray
e.g., mask=…
Attributes:
All extra properties
State specific parameters
All extra parameters
Matrix of distance from upper bound
Methods:
pad
([axes, ffill, bfill, limit, inplace])Pad nan values in underlying data to values
zeromax
([inplace])Shift so that lnpi.max() == 0
adjust
([zeromax, pad, inplace])Do multiple adjustments in one go
reweight
(lnz[, zeromax, pad])Get lnpi at new lnz
smooth
([sigma, mode, truncate, inplace])Apply gaussian filter smoothing to data
copy_shallow
([mask])Create shallow copy
or_mask
(mask, **kwargs)New object with logical or of self.mask and mask
and_mask
(mask, **kwargs)New object with logical and of self.mask and mask
from_table
(path, lnz[, state_kws, sep, ...])Create lnPi object from text file table with columns [n_0,...,n_ndim, lnpi]
from_dataarray
(da[, state_as_attrs])Create a lnPi object from xarray.DataArray
list_from_masks
(masks[, convention])Create list of lnpis corresponding to masks[i]
list_from_labels
(labels[, features, ...])Create list of lnpis corresponding to labels
- property optinfo#
All extra properties
- property state_kws#
State specific parameters
- property extra_kws#
All extra parameters
- pad(axes=None, ffill=True, bfill=False, limit=None, inplace=False)[source]#
Pad nan values in underlying data to values
- Parameters:
- Returns:
out (
object
) – padded object
- smooth(sigma=4, mode='nearest', truncate=4, inplace=False, **kwargs)[source]#
Apply gaussian filter smoothing to data
- Parameters:
See also
- copy_shallow(mask=None, **kwargs)[source]#
Create shallow copy
- Parameters:
mask (optional) – if specified, new object has this mask otherwise, at least copy old mask
- classmethod from_table(path, lnz, state_kws=None, sep='\\s+', names=None, csv_kws=None, **kwargs)[source]#
Create lnPi object from text file table with columns [n_0,…,n_ndim, lnpi]
- Parameters:
path (path-like) – file object to be read
lnz (array-like) – beta*(chemical potential) for each component
state_kws (
dict
, optional) – define state variables, like volume, betasep (
string
, optional) – separator for file readcsv_kws (
dict
, optional) – optional arguments to pandas.read_csv**kwargs – Passed to lnPi constructor
- classmethod from_dataarray(da, state_as_attrs=None, **kwargs)[source]#
Create a lnPi object from xarray.DataArray