pyopia.io

pyopia.io#

Module containing tools for datafile and metadata handling

Functions

StatsH5(**kwargs)

Deprecated since version 2.4.8.

add_cf_attributes(xstats)

Adds CF-compliant attributes and units to the xarray Dataset.

combine_stats_netcdf_files(path_to_data[, ...])

Deprecated since version 2.4.11.

concat_stats_netcdf_files(sorted_filelist)

Concatenate specified list of STATS.nc files into one 'xstats' xarray dataset created by :func:`pyopia.io.write_stats when using 'append = false'.

get_cf_metadata_spec()

load_image_stats(datafilename)

Load the summary stats and time information for each image

load_stats(datafilename)

Load -STATS.nc file as xarray Dataset

load_stats_as_dataframe(stats_file)

A loading function for stats files that forces stats into a pandas DataFrame

load_toml(toml_file)

Load a TOML settings file from file

make_xstats(stats, toml_steps[, ...])

Converts a stats dataframe into xarray DataSet, with metadata

merge_and_save_mfdataset(path_to_data[, ...])

Combine a multi-file directory of STATS.nc files into a single '-STATS.nc' file that can then be loaded with pyopia.io.load_stats()

setup_xstats_encoding(xstats[, string_vars])

Setup encoding for writing to NetCDF, where string variables are explicitly defined as string types

show_h5_meta(h5file)

prints metadata from an exported hdf5 file created from pyopia.process

steps_from_xstats(xstats)

Get the steps attribute from xarray version of the particle stats into a dictionary

write_stats(stats, datafilename[, settings, ...])

Writes particle stats into the ouput file.

Classes

StatsToDisc([output_datafile, dataformat, ...])

PyOpia pipline-compatible class for calling write_stats() that created NetCDF files.