pyUSID.io.hdf_utils.simple

Lower-level and simpler USID-specific HDF5 utilities that facilitate higher-level data operations

Created on Tue Nov 3 21:14:25 2015

@author: Suhas Somnath, Chris Smith

Functions

assign_group_index(h5_parent_group, base_name)

Searches the parent h5 group to find the next available index for the group

check_and_link_ancillary(h5_dset, anc_names)

This function will add references to auxilliary datasets as attributes of an input dataset.

check_for_matching_attrs(h5_obj[, …])

Compares attributes in the given H5 object against those in the provided dictionary and returns True if the parameters match, and False otherwise

check_for_old(h5_base, tool_name[, …])

Check to see if the results of a tool already exist and if they were performed with the same parameters.

check_if_main(h5_main[, verbose])

Checks the input dataset to see if it has all the necessary features to be considered a Main dataset.

copy_attributes(source, dest[, skip_refs, …])

Copy attributes from one h5object to another

copy_dataset(h5_orig_dset, h5_dest_grp[, …])

Copies the provided HDF5 dataset to the provided destination.

copy_linked_objects(h5_source, h5_dest[, …])

Recursively copies datasets linked to the source h5 object to the destination h5 object that are be in different HDF5 files.

copy_main_attributes(h5_main, h5_new)

Copies the units and quantity name from one dataset to another

copy_region_refs(h5_source, h5_target)

Check the input dataset for plot groups, copy them if they exist Also make references in the Spectroscopic Values and Indices tables

create_empty_dataset(source_dset, dtype, …)

Creates an empty dataset in the h5 file based on the provided dataset in the same or specified group

create_indexed_group(h5_parent_group, base_name)

Creates a group with an indexed name (eg - ‘Measurement_012’) under h5_parent_group using the provided base_name as a prefix for the group’s name

create_results_group(h5_main, tool_name[, …])

Creates a h5py.Group object autoindexed and named as ‘DatasetName-ToolName_00x’

find_dataset(h5_group, dset_name)

Uses visit() to find all datasets with the desired name

find_results_groups(h5_main, tool_name[, …])

Finds a list of all groups containing results of the process of name tool_name being applied to the dataset

get_all_main(parent[, verbose])

Simple function to recursively print the contents of an hdf5 group

get_source_dataset(h5_group)

Find the name of the source dataset used to create the input h5_group, so long as the source dataset is in the same HDF5 file

link_as_main(h5_main, h5_pos_inds, …)

Links the object references to the four position and spectroscopic datasets as attributes of h5_main

validate_anc_dset_attrs(h5_inds, h5_vals[, …])

Validates the attributes of a pair of indices and values datasets.

validate_anc_h5_dsets(h5_inds, h5_vals, …)

Checks ancillary HDF5 datasets against shape of a main dataset.

validate_dims_against_main(main_shape, dims)

Checks Dimension objects against a given shape for main datasets.

validate_main_dset(h5_main, must_be_h5)

Checks to make sure that the provided object is a USID main dataset Errors in parameters will result in Exceptions

write_ind_val_dsets(h5_parent_group, dimensions)

Creates h5py.Datasets for the position OR spectroscopic indices and values of the data.

write_reduced_anc_dsets(h5_parent_group, …)

Creates new Ancillary Indices and Values datasets from the input datasets by dropping the specified dimensions