Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vasudevan, Rama K
pycroscopy
Commits
9e068b40
Commit
9e068b40
authored
Jan 19, 2018
by
Somnath, Suhas
Browse files
moved core components of package to new subpackage core. updated inputs
parent
d2ffb76d
Changes
88
Hide whitespace changes
Inline
Side-by-side
docs/_autosummary/_autosummary/pycroscopy.io.hdf_utils.rst
View file @
9e068b40
...
...
@@ -9,24 +9,24 @@ pycroscopy\.io\.hdf\_utils
.. autosummary::
build
R
educed
S
pec
build
_r
educed
_s
pec
_dsets
calc_chunks
check
AndL
ink
A
ncillary
check
IfM
ain
check
_and_l
ink
_a
ncillary
check
_if_m
ain
check_for_old
copy
A
ttributes
copy
R
egion
R
efs
copy
_a
ttributes
copy
_r
egion
_r
efs
copy_main_attributes
create
RefFromIndi
ce
s
create
_region_referen
ce
create_empty_dataset
create_spec_inds_from_vals
find
D
ataset
find
H5
group
get
AuxData
get
D
ata
S
et
get
H5DsetR
efs
get
H5G
roup
R
efs
get
H5RegRefIndices
find
_d
ataset
find
_results_
group
s
get
_auxillary_datasets
get
_d
ata
s
et
s
get
_h5_obj_r
efs
get
_g
roup
_r
efs
get
_indices_for_region_ref
get_all_main
get_attr
get_attributes
...
...
@@ -36,14 +36,14 @@ pycroscopy\.io\.hdf\_utils
get_sort_order
get_source_dataset
get_unit_values
link
RefAsA
lias
link
Ref
s
link
_h5_obj_as_a
lias
link
_h5_objects_as_attr
s
link_as_main
print_tree
reducingRefCopy
reshape_from_
N
dims
reshape_to_
N
dims
simple
RefC
opy
copy_reg_ref_reduced_dim
reshape_from_
n_
dims
reshape_to_
n_
dims
simple
_region_ref_c
opy
...
...
docs/_autosummary/backreferences/pycroscopy.hdf_utils.buildReducedSpec.examples
View file @
9e068b40
Examples using ``pycroscopy.hdf_utils.build
R
educed
S
pec``
Examples using ``pycroscopy.hdf_utils.build
_r
educed
_s
pec
_dsets
``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
...
...
docs/_autosummary/backreferences/pycroscopy.hdf_utils.checkAndLinkAncillary.examples
View file @
9e068b40
Examples using ``pycroscopy.hdf_utils.check
AndL
ink
A
ncillary``
Examples using ``pycroscopy.hdf_utils.check
_and_l
ink
_a
ncillary``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
...
...
docs/_autosummary/backreferences/pycroscopy.hdf_utils.checkIfMain.examples
View file @
9e068b40
Examples using ``pycroscopy.hdf_utils.check
IfM
ain``
Examples using ``pycroscopy.hdf_utils.check
_if_m
ain``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
...
...
docs/_autosummary/backreferences/pycroscopy.hdf_utils.findDataset.examples
View file @
9e068b40
Examples using ``pycroscopy.hdf_utils.find
D
ataset``
Examples using ``pycroscopy.hdf_utils.find
_d
ataset``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
...
...
docs/_autosummary/backreferences/pycroscopy.hdf_utils.findH5group.examples
View file @
9e068b40
Examples using ``pycroscopy.hdf_utils.find
H5
group``
Examples using ``pycroscopy.hdf_utils.find
_results_
group
s
``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
...
...
docs/_autosummary/backreferences/pycroscopy.hdf_utils.getAuxData.examples
View file @
9e068b40
Examples using ``pycroscopy.hdf_utils.get
AuxData
``
Examples using ``pycroscopy.hdf_utils.get
_auxillary_datasets
``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
...
...
docs/_autosummary/backreferences/pycroscopy.hdf_utils.getDataSet.examples
View file @
9e068b40
Examples using ``pycroscopy.hdf_utils.get
D
ata
S
et``
Examples using ``pycroscopy.hdf_utils.get
_d
ata
s
et
s
``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
...
...
docs/_autosummary/backreferences/pycroscopy.hdf_utils.getH5DsetRefs.examples
View file @
9e068b40
Examples using ``pycroscopy.hdf_utils.get
H5DsetR
efs``
Examples using ``pycroscopy.hdf_utils.get
_h5_obj_r
efs``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
...
...
docs/_autosummary/backreferences/pycroscopy.hdf_utils.linkRefs.examples
View file @
9e068b40
Examples using ``pycroscopy.hdf_utils.link
Ref
s``
Examples using ``pycroscopy.hdf_utils.link
_h5_objects_as_attr
s``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
...
...
docs/_autosummary/backreferences/pycroscopy.hdf_utils.reshape_from_Ndims.examples
View file @
9e068b40
Examples using ``pycroscopy.hdf_utils.reshape_from_
N
dims``
Examples using ``pycroscopy.hdf_utils.reshape_from_
n_
dims``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
...
...
docs/_autosummary/backreferences/pycroscopy.hdf_utils.reshape_to_Ndims.examples
View file @
9e068b40
Examples using ``pycroscopy.hdf_utils.reshape_to_
N
dims``
Examples using ``pycroscopy.hdf_utils.reshape_to_
n_
dims``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
...
...
docs/_autosummary/backreferences/pycroscopy.io.hdf_utils.getH5DsetRefs.examples
View file @
9e068b40
Examples using ``pycroscopy.io.hdf_utils.get
H5DsetR
efs``
Examples using ``pycroscopy.io.hdf_utils.get
_h5_obj_r
efs``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
...
...
docs/auto_examples/data_analysis/plot_spectral_unmixing.rst
View file @
9e068b40
...
...
@@ -111,7 +111,7 @@ We will begin by downloading the BE-PFM dataset from Github
h5_main = h5_meas_grp['
Channel_000
/
Raw_Data
']
# Extracting the X axis - vector of frequencies
h5_spec_vals = px.hdf_utils.get
AuxData
(h5_main,'
Spectroscopic_Values
')[-1]
h5_spec_vals = px.hdf_utils.get
_auxillary_datasets
(h5_main,'
Spectroscopic_Values
')[-1]
freq_vec = np.squeeze(h5_spec_vals.value) * 1E-3
print('
Data
currently
of
shape
:
', h5_main.shape)
...
...
docs/auto_examples/dev_tutorials/plot_tutorial_01_5_microdata.rst
View file @
9e068b40
...
...
@@ -193,8 +193,8 @@ new file.
h5_refs = hdf.writeData(root_group, print_log=True)
# We can use these references to get the h5py dataset and group objects
h5_main = px.io.hdf_utils.get
H5DsetR
efs(['Main_Data'], h5_refs)[0]
h5_empty = px.io.hdf_utils.get
H5DsetR
efs(['Empty_Data'], h5_refs)[0]
h5_main = px.io.hdf_utils.get
_h5_obj_r
efs(['Main_Data'], h5_refs)[0]
h5_empty = px.io.hdf_utils.get
_h5_obj_r
efs(['Empty_Data'], h5_refs)[0]
...
...
docs/auto_examples/dev_tutorials/plot_tutorial_02_writing_to_h5.py
View file @
9e068b40
...
...
@@ -85,6 +85,8 @@ import os
from
warnings
import
warn
# Package for downloading online files:
import
pycroscopy.core.io.translator
try
:
# This package is not part of anaconda and may need to be installed.
import
wget
...
...
@@ -277,9 +279,9 @@ px.plot_utils.plot_cluster_results_together(np.reshape(labels, (num_rows, num_co
#
# In this case, `centroids` has `k` positions all in one dimension. Thus the matrix needs to be reshaped to `k x 1`
ds_labels_spec_inds
,
ds_labels_spec_vals
=
p
x
.
io
.
translator
s
.
utils
.
build_ind_val_dsets
([
1
],
labels
=
[
'Label'
])
ds_cluster_inds
,
ds_cluster_vals
=
p
x
.
io
.
translator
s
.
utils
.
build_ind_val_dsets
([
centroids
.
shape
[
0
]],
is_spectral
=
False
,
labels
=
[
'Cluster'
])
ds_labels_spec_inds
,
ds_labels_spec_vals
=
p
ycroscopy
.
core
.
io
.
translator
.
build_ind_val_dsets
([
1
],
labels
=
[
'Label'
])
ds_cluster_inds
,
ds_cluster_vals
=
p
ycroscopy
.
core
.
io
.
translator
.
build_ind_val_dsets
([
centroids
.
shape
[
0
]],
is_spectral
=
False
,
labels
=
[
'Cluster'
])
labels_mat
=
np
.
uint32
(
labels
.
reshape
([
-
1
,
1
]))
# Rename the datasets
...
...
docs/auto_examples/dev_tutorials/plot_tutorial_02_writing_to_h5.rst
View file @
9e068b40
...
...
@@ -192,7 +192,7 @@ instead.
y_label = px.hdf_utils.get_attr(h5_main, 'quantity') + ' [' + px.hdf_utils.get_attr(h5_main, 'units') + ']'
# Get the voltage vector that this data was acquired as a function of:
h5_spec_vals = px.hdf_utils.get
AuxData
(h5_main, 'Spectroscopic_Values')[0]
h5_spec_vals = px.hdf_utils.get
_auxillary_datasets
(h5_main, 'Spectroscopic_Values')[0]
volt_vec = np.squeeze(h5_spec_vals[()])
# Get the descriptor for this
...
...
@@ -530,12 +530,12 @@ Once the tree is prepared (previous cell), ioHDF5 will handle all the file writi
h5_clust_refs = hdf.writeData(cluster_grp, print_log=True)
h5_labels = px.hdf_utils.get
H5DsetR
efs(['Labels'], h5_clust_refs)[0]
h5_centroids = px.hdf_utils.get
H5DsetR
efs(['Mean_Response'], h5_clust_refs)[0]
h5_clust_inds = px.hdf_utils.get
H5DsetR
efs(['Cluster_Indices'], h5_clust_refs)[0]
h5_clust_vals = px.hdf_utils.get
H5DsetR
efs(['Cluster_Values'], h5_clust_refs)[0]
h5_label_inds = px.hdf_utils.get
H5DsetR
efs(['Label_Spectroscopic_Indices'], h5_clust_refs)[0]
h5_label_vals = px.hdf_utils.get
H5DsetR
efs(['Label_Spectroscopic_Values'], h5_clust_refs)[0]
h5_labels = px.hdf_utils.get
_h5_obj_r
efs(['Labels'], h5_clust_refs)[0]
h5_centroids = px.hdf_utils.get
_h5_obj_r
efs(['Mean_Response'], h5_clust_refs)[0]
h5_clust_inds = px.hdf_utils.get
_h5_obj_r
efs(['Cluster_Indices'], h5_clust_refs)[0]
h5_clust_vals = px.hdf_utils.get
_h5_obj_r
efs(['Cluster_Values'], h5_clust_refs)[0]
h5_label_inds = px.hdf_utils.get
_h5_obj_r
efs(['Label_Spectroscopic_Indices'], h5_clust_refs)[0]
h5_label_vals = px.hdf_utils.get
_h5_obj_r
efs(['Label_Spectroscopic_Values'], h5_clust_refs)[0]
...
...
@@ -653,20 +653,20 @@ rather easy by a few pycroscopy functions.
# we already got the reference to the spectroscopic values in the first few cells
h5_spec_inds = px.hdf_utils.get
AuxData
(h5_main, 'Spectroscopic_Indices')[0]
h5_spec_inds = px.hdf_utils.get
_auxillary_datasets
(h5_main, 'Spectroscopic_Indices')[0]
px.hdf_utils.check
AndL
ink
A
ncillary(h5_labels,
px.hdf_utils.check
_and_l
ink
_a
ncillary(h5_labels,
['Position_Indices', 'Position_Values'],
h5_main=h5_main)
px.hdf_utils.check
AndL
ink
A
ncillary(h5_labels,
px.hdf_utils.check
_and_l
ink
_a
ncillary(h5_labels,
['Spectroscopic_Indices', 'Spectroscopic_Values'],
anc_refs=[h5_label_inds, h5_label_vals])
px.hdf_utils.check
AndL
ink
A
ncillary(h5_centroids,
px.hdf_utils.check
_and_l
ink
_a
ncillary(h5_centroids,
['Spectroscopic_Indices', 'Spectroscopic_Values'],
anc_refs=[h5_spec_inds, h5_spec_vals])
px.hdf_utils.check
AndL
ink
A
ncillary(h5_centroids,
px.hdf_utils.check
_and_l
ink
_a
ncillary(h5_centroids,
['Position_Indices', 'Position_Values'],
anc_refs=[h5_clust_inds, h5_clust_vals])
...
...
docs/auto_examples/dev_tutorials/plot_tutorial_03_multidimensional_data.rst
View file @
9e068b40
...
...
@@ -191,10 +191,10 @@ slice the data. For that we need the ancillary datasets that support this main d
# pycroscopy has a convenient function to access datasets linked to a given dataset:
h5_spec_ind = px.hdf_utils.get
AuxData
(h5_main, 'Spectroscopic_Indices')[0]
h5_spec_val = px.hdf_utils.get
AuxData
(h5_main, 'Spectroscopic_Values')[0]
h5_pos_ind = px.hdf_utils.get
AuxData
(h5_main, 'Position_Indices')[0]
h5_pos_val = px.hdf_utils.get
AuxData
(h5_main, 'Position_Values')[0]
h5_spec_ind = px.hdf_utils.get
_auxillary_datasets
(h5_main, 'Spectroscopic_Indices')[0]
h5_spec_val = px.hdf_utils.get
_auxillary_datasets
(h5_main, 'Spectroscopic_Values')[0]
h5_pos_ind = px.hdf_utils.get
_auxillary_datasets
(h5_main, 'Position_Indices')[0]
h5_pos_val = px.hdf_utils.get
_auxillary_datasets
(h5_main, 'Position_Values')[0]
...
...
@@ -536,7 +536,7 @@ make up this function.
.. code-block:: python
ds_nd, success, labels = px.hdf_utils.reshape_to_
N
dims(h5_main, get_labels=True)
ds_nd, success, labels = px.hdf_utils.reshape_to_
n_
dims(h5_main, get_labels=True)
print('Shape of the N-dimensional dataset:', ds_nd.shape)
print(labels)
...
...
docs/auto_examples/dev_tutorials/plot_tutorial_04_parallel_computing.rst
View file @
9e068b40
This source diff could not be displayed because it is too large. You can
view the blob
instead.
docs/auto_examples/dev_tutorials/plot_tutorial_05_data_processing.rst
View file @
9e068b40
...
...
@@ -131,7 +131,7 @@ Note that:
super(ShoGuess, self).__init__(h5_main, cores=cores)
# find the frequency vector
h5_spec_vals = px.hdf_utils.get
AuxData
(h5_main, 'Spectroscopic_Values')[-1]
h5_spec_vals = px.hdf_utils.get
_auxillary_datasets
(h5_main, 'Spectroscopic_Values')[-1]
self.freq_vec = np.squeeze(h5_spec_vals.value) * 1E-3
def _create_results_datasets(self):
...
...
@@ -140,8 +140,8 @@ Note that:
Just as the raw data is stored in the pycroscopy format, the results also need to conform to the same
standards. Hence, the create_datasets function can appear to be a little longer than one might expect.
"""
h5_spec_inds = px.hdf_utils.get
AuxData
(self.h5_main, auxDataName=['Spectroscopic_Indices'])[0]
h5_spec_vals = px.hdf_utils.get
AuxData
(self.h5_main, auxDataName=['Spectroscopic_Values'])[0]
h5_spec_inds = px.hdf_utils.get
_auxillary_datasets
(self.h5_main, auxDataName=['Spectroscopic_Indices'])[0]
h5_spec_vals = px.hdf_utils.get
_auxillary_datasets
(self.h5_main, auxDataName=['Spectroscopic_Values'])[0]
self.step_start_inds = np.where(h5_spec_inds[0] == 0)[0]
self.num_udvs_steps = len(self.step_start_inds)
...
...
@@ -152,7 +152,7 @@ Note that:
not_freq = px.hdf_utils.get_attr(h5_spec_inds, 'labels') != 'Frequency'
ds_sho_inds, ds_sho_vals = px.hdf_utils.build
R
educed
S
pec(h5_spec_inds, h5_spec_vals, not_freq,
ds_sho_inds, ds_sho_vals = px.hdf_utils.build
_r
educed
_s
pec
_dsets
(h5_spec_inds, h5_spec_vals, not_freq,
self.step_start_inds)
dset_name = self.h5_main.name.split('/')[-1]
...
...
@@ -162,18 +162,18 @@ Note that:
h5_sho_grp_refs = self.hdf.writeData(sho_grp)
self.h5_guess = px.hdf_utils.get
H5DsetR
efs(['Guess'], h5_sho_grp_refs)[0]
self.h5_guess = px.hdf_utils.get
_h5_obj_r
efs(['Guess'], h5_sho_grp_refs)[0]
self.h5_results_grp = self.h5_guess.parent
h5_sho_inds = px.hdf_utils.get
H5DsetR
efs(['Spectroscopic_Indices'],
h5_sho_inds = px.hdf_utils.get
_h5_obj_r
efs(['Spectroscopic_Indices'],
h5_sho_grp_refs)[0]
h5_sho_vals = px.hdf_utils.get
H5DsetR
efs(['Spectroscopic_Values'],
h5_sho_vals = px.hdf_utils.get
_h5_obj_r
efs(['Spectroscopic_Values'],
h5_sho_grp_refs)[0]
# Reference linking before actual fitting
px.hdf_utils.link
Ref
s(self.h5_guess, [h5_sho_inds, h5_sho_vals])
px.hdf_utils.link
_h5_objects_as_attr
s(self.h5_guess, [h5_sho_inds, h5_sho_vals])
# Linking ancillary position datasets:
aux_dsets = px.hdf_utils.get
AuxData
(self.h5_main, auxDataName=['Position_Indices', 'Position_Values'])
px.hdf_utils.link
Ref
s(self.h5_guess, aux_dsets)
aux_dsets = px.hdf_utils.get
_auxillary_datasets
(self.h5_main, auxDataName=['Position_Indices', 'Position_Values'])
px.hdf_utils.link
_h5_objects_as_attr
s(self.h5_guess, aux_dsets)
print('Finshed creating datasets')
def compute(self, *args, **kwargs):
...
...
@@ -258,7 +258,7 @@ dimensional matrix in accordance with the pycroscopy data format.
h5_main = h5_meas_grp['Channel_000/Raw_Data']
# Extracting the X axis - vector of frequencies
h5_spec_vals = px.hdf_utils.get
AuxData
(h5_main, 'Spectroscopic_Values')[-1]
h5_spec_vals = px.hdf_utils.get
_auxillary_datasets
(h5_main, 'Spectroscopic_Values')[-1]
freq_vec = np.squeeze(h5_spec_vals.value) * 1E-3
...
...
Prev
1
2
3
4
5
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment