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

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

check_and_link_ancillary

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

check_for_matching_attrs

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

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

check_if_main

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

copy_main_attributes

Copies the units and quantity name from one dataset to another

create_empty_dataset

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

create_indexed_group

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

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

find_dataset

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

find_results_groups

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

get_all_main

Simple function to recursively print the contents of an hdf5 group

get_source_dataset

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

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

validate_anc_dset_attrs

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

validate_anc_h5_dsets

Checks ancillary HDF5 datasets against shape of a main dataset.

validate_dims_against_main

Checks Dimension objects against a given shape for main datasets.

validate_main_dset

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

write_ind_val_dsets

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

write_reduced_anc_dsets

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