Commit 783ab218 authored by Unknown's avatar Unknown
Browse files

Combine the load dataset example with the interacting with h5 tutorial

parent 89ac9e7e
......@@ -3,24 +3,6 @@
Examples using ``pycroscopy.hdf_utils.getDataSet``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
<div class="sphx-glr-thumbcontainer" tooltip="Conventionally, the h5py package is used to create, read, write, and modify h5 files.">
.. only:: html
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_load_dataset_example_thumb.png
:ref:`sphx_glr_auto_examples_plot_load_dataset_example.py`
.. raw:: html
</div>
.. only:: not html
* :ref:`sphx_glr_auto_examples_plot_load_dataset_example.py`
.. raw:: html
<div class="sphx-glr-thumbcontainer" tooltip="11/11/2017">
......
......@@ -3,24 +3,6 @@
Examples using ``pycroscopy.hdf_utils.print_tree``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
<div class="sphx-glr-thumbcontainer" tooltip="Conventionally, the h5py package is used to create, read, write, and modify h5 files.">
.. only:: html
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_load_dataset_example_thumb.png
:ref:`sphx_glr_auto_examples_plot_load_dataset_example.py`
.. raw:: html
</div>
.. only:: not html
* :ref:`sphx_glr_auto_examples_plot_load_dataset_example.py`
.. raw:: html
<div class="sphx-glr-thumbcontainer" tooltip="S. Somnath\ :sup:`1,2`, R. K. Vasudevan\ :sup:`1,3` * :sup:`1` Institute for Functional Imagin...">
......
......@@ -5,13 +5,13 @@ Examples using ``pycroscopy.ioHDF5``
.. raw:: html
<div class="sphx-glr-thumbcontainer" tooltip="Conventionally, the h5py package is used to create, read, write, and modify h5 files.">
<div class="sphx-glr-thumbcontainer" tooltip="S. Somnath\ :sup:`1,2`, R. K. Vasudevan\ :sup:`1,3` * :sup:`1` Institute for Functional Imagin...">
.. only:: html
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_load_dataset_example_thumb.png
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_spectral_unmixing_thumb.png
:ref:`sphx_glr_auto_examples_plot_load_dataset_example.py`
:ref:`sphx_glr_auto_examples_plot_spectral_unmixing.py`
.. raw:: html
......@@ -19,17 +19,17 @@ Examples using ``pycroscopy.ioHDF5``
.. only:: not html
* :ref:`sphx_glr_auto_examples_plot_load_dataset_example.py`
* :ref:`sphx_glr_auto_examples_plot_spectral_unmixing.py`
.. raw:: html
<div class="sphx-glr-thumbcontainer" tooltip="S. Somnath\ :sup:`1,2`, R. K. Vasudevan\ :sup:`1,3` * :sup:`1` Institute for Functional Imagin...">
<div class="sphx-glr-thumbcontainer" tooltip="">
.. only:: html
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_spectral_unmixing_thumb.png
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_microdata_example_thumb.png
:ref:`sphx_glr_auto_examples_plot_spectral_unmixing.py`
:ref:`sphx_glr_auto_examples_plot_microdata_example.py`
.. raw:: html
......@@ -37,17 +37,17 @@ Examples using ``pycroscopy.ioHDF5``
.. only:: not html
* :ref:`sphx_glr_auto_examples_plot_spectral_unmixing.py`
* :ref:`sphx_glr_auto_examples_plot_microdata_example.py`
.. raw:: html
<div class="sphx-glr-thumbcontainer" tooltip="">
<div class="sphx-glr-thumbcontainer" tooltip="**Suhas Somnath** 8/8/2017">
.. only:: html
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_microdata_example_thumb.png
.. figure:: /auto_examples/dev_tutorials/images/thumb/sphx_glr_plot_tutorial_02_writing_to_h5_thumb.png
:ref:`sphx_glr_auto_examples_plot_microdata_example.py`
:ref:`sphx_glr_auto_examples_dev_tutorials_plot_tutorial_02_writing_to_h5.py`
.. raw:: html
......@@ -55,17 +55,17 @@ Examples using ``pycroscopy.ioHDF5``
.. only:: not html
* :ref:`sphx_glr_auto_examples_plot_microdata_example.py`
* :ref:`sphx_glr_auto_examples_dev_tutorials_plot_tutorial_02_writing_to_h5.py`
.. raw:: html
<div class="sphx-glr-thumbcontainer" tooltip="**Suhas Somnath** 8/8/2017">
<div class="sphx-glr-thumbcontainer" tooltip="11/11/2017">
.. only:: html
.. figure:: /auto_examples/dev_tutorials/images/thumb/sphx_glr_plot_tutorial_02_writing_to_h5_thumb.png
.. figure:: /auto_examples/user_tutorials/images/thumb/sphx_glr_plot_tutorial_01_interacting_w_h5_files_thumb.png
:ref:`sphx_glr_auto_examples_dev_tutorials_plot_tutorial_02_writing_to_h5.py`
:ref:`sphx_glr_auto_examples_user_tutorials_plot_tutorial_01_interacting_w_h5_files.py`
.. raw:: html
......@@ -73,7 +73,7 @@ Examples using ``pycroscopy.ioHDF5``
.. only:: not html
* :ref:`sphx_glr_auto_examples_dev_tutorials_plot_tutorial_02_writing_to_h5.py`
* :ref:`sphx_glr_auto_examples_user_tutorials_plot_tutorial_01_interacting_w_h5_files.py`
.. raw:: html
......
......@@ -76,16 +76,25 @@
``` python
# Ensure python 3 compatibility:
from __future__ import division, print_function, absolute_import, unicode_literals
# In case some of these packages are not installed, install them
#!pip install -U os wget numpy h5py matplotlib pycroscopy
# The package for accessing files in directories, etc.:
import os
import wget
# Warning package in case something goes wrong
from warnings import warn
# Package for downloading online files:
try:
# This package is not part of anaconda and may need to be installed.
import wget
except ImportError:
warn('wget not found. Will install with pip.')
import pip
pip.main(['install', 'wget'])
import wget
# The mathematical computation package:
import numpy as np
# The package used for creating and manipulating HDF5 files:
......@@ -93,11 +102,17 @@
# Packages for plotting:
import matplotlib.pyplot as plt
# Finally import pycroscopy for certain scientific analysis:
import pycroscopy as px
try:
import pycroscopy as px
except ImportError:
warn('pycroscopy not found. Will install with pip.')
import pip
pip.main(['install', 'pycroscopy'])
import pycroscopy as px
```
%% Cell type:markdown id: tags:
0. Select the Raw Data file
......
......@@ -66,12 +66,21 @@ few python packages that will be necessary in the later steps.
# Ensure python 3 compatibility:
from __future__ import division, print_function, absolute_import, unicode_literals
# In case some of these packages are not installed, install them
#!pip install -U os wget numpy h5py matplotlib pycroscopy
# The package for accessing files in directories, etc.:
import os
import wget
# Warning package in case something goes wrong
from warnings import warn
# Package for downloading online files:
try:
# This package is not part of anaconda and may need to be installed.
import wget
except ImportError:
warn('wget not found. Will install with pip.')
import pip
pip.main(['install', 'wget'])
import wget
# The mathematical computation package:
import numpy as np
......@@ -83,7 +92,13 @@ import h5py
import matplotlib.pyplot as plt
# Finally import pycroscopy for certain scientific analysis:
import pycroscopy as px
try:
import pycroscopy as px
except ImportError:
warn('pycroscopy not found. Will install with pip.')
import pip
pip.main(['install', 'pycroscopy'])
import pycroscopy as px
####################################################################################
# 0. Select the Raw Data file
......
cb56813ad1c279b344400a6b79314e21
\ No newline at end of file
431362ec4dbb3d9e362646182c626de6
\ No newline at end of file
......@@ -74,12 +74,21 @@ few python packages that will be necessary in the later steps.
# Ensure python 3 compatibility:
from __future__ import division, print_function, absolute_import, unicode_literals
# In case some of these packages are not installed, install them
#!pip install -U os wget numpy h5py matplotlib pycroscopy
# The package for accessing files in directories, etc.:
import os
import wget
# Warning package in case something goes wrong
from warnings import warn
# Package for downloading online files:
try:
# This package is not part of anaconda and may need to be installed.
import wget
except ImportError:
warn('wget not found. Will install with pip.')
import pip
pip.main(['install', 'wget'])
import wget
# The mathematical computation package:
import numpy as np
......@@ -91,7 +100,13 @@ few python packages that will be necessary in the later steps.
import matplotlib.pyplot as plt
# Finally import pycroscopy for certain scientific analysis:
import pycroscopy as px
try:
import pycroscopy as px
except ImportError:
warn('pycroscopy not found. Will install with pip.')
import pip
pip.main(['install', 'pycroscopy'])
import pycroscopy as px
......@@ -234,20 +249,20 @@ The parameters in these files are present in the first few lines of the file
Out::
value-unit : nA
y-pixels : 100
z-section : 491
x-pixels : 100
z-range : 2000000000
y-offset : -781.441
scanspeed : 59519000000
z-offset : 1116.49
z-points : 500
y-length : 29.7595
x-length : 29.7595
x-pixels : 100
voidpixels : 0
y-pixels : 100
z-unit : nV
z-section : 491
x-offset : -967.807
voidpixels : 0
value-unit : nA
y-length : 29.7595
3.a Prepare to read the data
......@@ -403,7 +418,7 @@ Verifying the newly written H5 file:
Measurement_000/Channel_000/Spectroscopic_Values
**Total running time of the script:** ( 0 minutes 19.106 seconds)
**Total running time of the script:** ( 1 minutes 14.025 seconds)
......
......@@ -80,7 +80,19 @@ from __future__ import division, print_function, absolute_import, unicode_litera
# The package for accessing files in directories, etc.:
import os
import wget
# Warning package in case something goes wrong
from warnings import warn
# Package for downloading online files:
try:
# This package is not part of anaconda and may need to be installed.
import wget
except ImportError:
warn('wget not found. Will install with pip.')
import pip
pip.main(['install', 'wget'])
import wget
# The mathematical computation package:
import numpy as np
......@@ -95,7 +107,13 @@ import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
# Finally import pycroscopy for certain scientific analysis:
import pycroscopy as px
try:
import pycroscopy as px
except ImportError:
warn('pycroscopy not found. Will install with pip.')
import pip
pip.main(['install', 'pycroscopy'])
import pycroscopy as px
from pycroscopy.io.translators.omicron_asc import AscTranslator
###############################################################################
......
3d85f19527b5b894bf1bd444d1f65228
\ No newline at end of file
f118f7b68c6a8fc606b47cb585533630
\ No newline at end of file
......@@ -88,7 +88,19 @@ Translation can be challenging in many cases:
# The package for accessing files in directories, etc.:
import os
import wget
# Warning package in case something goes wrong
from warnings import warn
# Package for downloading online files:
try:
# This package is not part of anaconda and may need to be installed.
import wget
except ImportError:
warn('wget not found. Will install with pip.')
import pip
pip.main(['install', 'wget'])
import wget
# The mathematical computation package:
import numpy as np
......@@ -103,7 +115,13 @@ Translation can be challenging in many cases:
from sklearn.cluster import KMeans
# Finally import pycroscopy for certain scientific analysis:
import pycroscopy as px
try:
import pycroscopy as px
except ImportError:
warn('pycroscopy not found. Will install with pip.')
import pip
pip.main(['install', 'pycroscopy'])
import pycroscopy as px
from pycroscopy.io.translators.omicron_asc import AscTranslator
......@@ -483,21 +501,21 @@ operation being performed on the same dataset. The index will then be updated ac
Writing the following attrbutes to the group:
num_clusters : 9
max_iter : 300
cluster_algorithm : KMeans
copy_x : True
tol : 0.0001
verbose : 0
n_jobs : 1
max_iter : 300
timestamp : 2017_11_16-14_33_52
precompute_distances : auto
random_state : None
verbose : 0
algorithm : auto
n_clusters : 9
init : k-means++
timestamp : 2017_11_16-08_16_32
machine_id : challtdow-ThinkPad-T530
n_init : 10
copy_x : True
n_clusters : 9
tol : 0.0001
num_samples : 10000
machine_id : challtdow-ThinkPad-T530
precompute_distances : auto
random_state : None
init : k-means++
Write to H5 and access the written objects
......@@ -529,20 +547,20 @@ Once the tree is prepared (previous cell), ioHDF5 will handle all the file writi
Created group /Measurement_000/Channel_000/Raw_Data-Cluster_000
Writing attribute: num_clusters with value: 9
Writing attribute: max_iter with value: 300
Writing attribute: cluster_algorithm with value: KMeans
Writing attribute: copy_x with value: True
Writing attribute: tol with value: 0.0001
Writing attribute: verbose with value: 0
Writing attribute: n_jobs with value: 1
Writing attribute: max_iter with value: 300
Writing attribute: timestamp with value: 2017_11_16-14_33_52
Writing attribute: precompute_distances with value: auto
Writing attribute: verbose with value: 0
Writing attribute: algorithm with value: auto
Writing attribute: n_clusters with value: 9
Writing attribute: init with value: k-means++
Writing attribute: timestamp with value: 2017_11_16-08_16_32
Writing attribute: machine_id with value: challtdow-ThinkPad-T530
Writing attribute: n_init with value: 10
Writing attribute: copy_x with value: True
Writing attribute: n_clusters with value: 9
Writing attribute: tol with value: 0.0001
Writing attribute: num_samples with value: 10000
Writing attribute: machine_id with value: challtdow-ThinkPad-T530
Writing attribute: precompute_distances with value: auto
Writing attribute: init with value: k-means++
Wrote attributes to group: Raw_Data-Cluster_000
Created Dataset /Measurement_000/Channel_000/Raw_Data-Cluster_000/Labels
......@@ -706,7 +724,7 @@ Deletes the temporary files created in the example
**Total running time of the script:** ( 0 minutes 29.496 seconds)
**Total running time of the script:** ( 1 minutes 56.335 seconds)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment