flatspin.data#

Data management.

flatspin.data.col_group(x)#
flatspin.data.match_column(pattern, columns)#

match column pattern from available columns m -> (mx, my, mz) m.region*x

flatspin.data.match_columns(patterns, columns)#

match column patterns

flatspin.data.csv_columns(file)#

Parse column names at the top of a CSV file

flatspin.data.save_csv(df, file)#
flatspin.data.read_csv(file, index_col=None)#
flatspin.data.save_hdf(df, filename)#
flatspin.data.read_hdf(filename)#
flatspin.data.hdf_columns(filename)#
flatspin.data.read_npy(filename)#
flatspin.data.save_npy(df, filename)#
flatspin.data.npy_columns(filename)#
flatspin.data.read_npz(filename)#
flatspin.data.save_npz(df, filename)#
flatspin.data.npz_columns(filename)#
flatspin.data.archive_key(filename)#
flatspin.data.get_format(filename)#
flatspin.data.is_archive_format(fmt)#
flatspin.data.is_archive(filename)#
flatspin.data.is_tablefile(filename)#
flatspin.data.list_dir(filename)#
flatspin.data.list_npz(filename)#
flatspin.data.list_hdf(filename)#
flatspin.data.listfiles(filename)#
flatspin.data.to_table(data)#
flatspin.data.match_any(name, patterns)#
flatspin.data.read_table(filename, index_col=None, **kwargs)#
flatspin.data.save_table(data, filename)#
flatspin.data.table_columns(filename)#
flatspin.data.read_tables(filenames, index_col=None)#
flatspin.data.read_geometry(filename='geometry.csv')#
flatspin.data.read_vectors(filenames, quantity='mag', t=None)#
flatspin.data.crop(X, crop, axis=-1)#

Crop array X along one or more axes crop is a tuple (before, after) for each axis to crop axis specifies which axis to start cropping from

flatspin.data.rolling_window(X, win_shape, step=1, method='sum')#

Apply a function over a rolling window of X

flatspin.data.filter_df(df, **kwargs)#

Filter dataframe by key=value or range key=slice(start, stop, step) or list key=[key1, key2, key3]

class flatspin.data.Dataset(index=None, params={}, info={}, basepath=None)#
property name#
keys()#
items()#
iterrows()#
subset(i)#
filter(**kwargs)#
drop_duplicates(**kwargs)#
groupby(key)#
sort_values(column)#
row(row=0)#
id(row=0)#
static read(basepath)#
save(basepath=None)#
file(filename)#
files(patterns=None, squash=True)#
tablefile(tablename, squash=True)#
tablefiles(patterns=None, squash=True)#
flatspin.data.digitize(X, threshold=0)#
flatspin.data.bit_array(x, n_bits)#

Convert number x to array of bits

flatspin.data.array_bit(a)#

Convert bit array a to number

flatspin.data.vector_grid(pos, vectors, grid_size=None, crop_width=None, win_shape=None, win_step=None, normalize=True, return_grid=False)#

Process vectors on a grid

flatspin.data.load_output(dataset, quantity, t=None, grid_size=None, crop_width=None, win_shape=None, win_step=None, flatten=True)#

Load output vectors from dataset, with optional post-processing

flatspin.data.load_input(dataset, t=None, input_column='input')#

Load input data from dataset