Commit d4bb3f05 authored by Unknown's avatar Unknown
Browse files

Categorize publication list by instrument

parent a6cc60df
'C:\\Users\\cq6\\git\\Pycroscopy\\pycroscopy\\docs\\_build\\html\\index.html', (0, 22143)
'C:\\Users\\cq6\\git\\Pycroscopy\\pycroscopy\\docs\\_build\\html\\searchindex.js', (22528, 89168)
'https://matplotlib.org/', (112128, 17340)
'https://matplotlib.org/searchindex.js', (129536, 1281616)
'https://docs.scipy.org/doc/numpy/', (1411584, 6184)
'https://docs.scipy.org/doc/numpy/searchindex.js', (1418240, 1074090)
'https://docs.scipy.org/doc/scipy/reference/', (2492416, 12851)
'https://docs.scipy.org/doc/scipy/reference/searchindex.js', (2505728, 1386974)
'http://docs.h5py.org/en/latest//', (3892736, 12946)
'http://docs.h5py.org/en/latest//searchindex.js', (3906048, 34985)
'C:\\Users\\cq6\\git\\Pycroscopy\\pycroscopy\\docs\\_build\\html\\index.html', (0, 22143)
'C:\\Users\\cq6\\git\\Pycroscopy\\pycroscopy\\docs\\_build\\html\\searchindex.js', (22528, 89168)
'https://matplotlib.org/', (112128, 17340)
'https://matplotlib.org/searchindex.js', (129536, 1281616)
'https://docs.scipy.org/doc/numpy/', (1411584, 6184)
'https://docs.scipy.org/doc/numpy/searchindex.js', (1418240, 1074090)
'https://docs.scipy.org/doc/scipy/reference/', (2492416, 12851)
'https://docs.scipy.org/doc/scipy/reference/searchindex.js', (2505728, 1386974)
'http://docs.h5py.org/en/latest//', (3892736, 12946)
'http://docs.h5py.org/en/latest//searchindex.js', (3906048, 34985)
{
"cells": [
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib inline"
]
......@@ -19,23 +19,23 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import os\n# Warning package in case something goes wrong\nfrom warnings import warn\n# Package for downloading online files:\ntry:\n # This package is not part of anaconda and may need to be installed.\n import wget\nexcept ImportError:\n warn('wget not found. Will install with pip.')\n import pip\n pip.main(['install', 'wget'])\n import wget\nimport h5py\nimport numpy as np\nimport matplotlib.pyplot as plt\ntry:\n import pycroscopy as px\nexcept ImportError:\n warn('pycroscopy not found. Will install with pip.')\n import pip\n pip.main(['install', 'pycroscopy'])\n import pycroscopy as px"
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Downloading the example file from the pycroscopy Github project\nurl = 'https://raw.githubusercontent.com/pycroscopy/pycroscopy/master/data/BEPS_small.h5'\nh5_path = 'temp.h5'\n_ = wget.download(url, h5_path)\n\nprint('Working on:\\n' + h5_path)"
]
......@@ -48,12 +48,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Open the file in read-only mode\nh5_f = h5py.File(h5_path, mode='r')\n\n# We can also use the ioHDF5 class from Pycroscopy to open the file. Note that you do need to close the\n# file in h5py before opening it again.\nh5_f.close()\nhdf = px.ioHDF5(h5_path)\nh5_f = hdf.file\n\n# Here, h5_f is an active handle to the open file"
]
......@@ -66,12 +66,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"print('Contents of the H5 file:')\npx.hdf_utils.print_tree(h5_f)"
]
......@@ -84,12 +84,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Selecting a datagroup by specifying the absolute path:\nh5_meas_group = h5_f['Measurement_000']\nprint('h5_meas_group:', h5_meas_group)\nprint('h5_chan_group:', h5_f['Measurement_000/Channel_000'])\n\n# Selecting a dataset by specifying the absolute path:\nh5_fft = h5_f['Measurement_000/Channel_000/Bin_FFT']\nprint('h5_fft:', h5_fft)\n\n# Selecting the same dataset using the relative path.\n# First we get \"Channel_000\" from h5_meas_group:\nh5_group = h5_meas_group['Channel_000']\n\n# Now we access Bin_FFT from within h5_group:\nh5_fft = h5_group['Bin_FFT']\nprint('h5_fft:', h5_fft)"
]
......@@ -102,12 +102,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Specific match of dataset name:\nudvs_dsets_1 = px.hdf_utils.getDataSet(h5_f, 'UDVS')\nfor item in udvs_dsets_1:\n print(item)\n\n# This function returns all datasets that match even a portion of the name\nudvs_dsets_2 = px.hdf_utils.findDataset(h5_f, 'UDVS')\nfor item in udvs_dsets_2:\n print(item)"
]
......@@ -120,12 +120,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"for dset_name in h5_group:\n print(px.hdf_utils.checkIfMain(h5_group[dset_name]), ':\\t', dset_name)"
]
......@@ -138,12 +138,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"main_dsets = px.hdf_utils.get_all_main(h5_f)\nfor dset in main_dsets:\n print(dset.name, dset.shape)"
]
......@@ -156,12 +156,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# First get the dataset corresponding to Raw_Data\nh5_raw = h5_f['/Measurement_000/Channel_000/Raw_Data']\n\nprint('Instances of operation \"{}\" applied to dataset named \"{}\":'.format('SHO_Fit', h5_raw.name))\nh5_sho_group_list = px.hdf_utils.findH5group(h5_raw, 'SHO_Fit')\nprint(h5_sho_group_list)"
]
......@@ -174,12 +174,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"print('Parameters already used for computing SHO_Fit on Raw_Data in the file:')\nprint(px.hdf_utils.get_attributes(h5_f['/Measurement_000/Channel_000/Raw_Data-SHO_Fit_000']))\nprint('\\nChecking to see if SHO Fits have been computed on the raw dataset:')\nprint('Using pycroscopy')\nprint(px.hdf_utils.check_for_old(h5_raw, 'SHO_Fit',\n new_parms={'SHO_fit_method': 'pycroscopy BESHO'}))\nprint('Using BEAM')\nprint(px.hdf_utils.check_for_old(h5_raw, 'SHO_Fit',\n new_parms={'SHO_fit_method': 'BEAM BESHO'}))"
]
......@@ -192,12 +192,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"h5_sho_group = h5_sho_group_list[0]\nprint('Datagroup containing the SHO fits:')\nprint(h5_sho_group)\nprint('\\nDataset on which the SHO Fit was computed:')\nh5_source_dset = px.hdf_utils.get_source_dataset(h5_sho_group)\nprint(h5_source_dset)"
]
......@@ -210,23 +210,23 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Listing all attributes using get_attributes:\nattr_dict = px.hdf_utils.get_attributes(h5_meas_group, attr_names=None)\nfor att_name in attr_dict:\n print('{} : {}'.format(att_name, attr_dict[att_name]))"
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# accessing specific attributes only:\nprint(px.hdf_utils.get_attributes(h5_meas_group, attr_names=['VS_mode', 'BE_phase_content']))"
]
......@@ -239,12 +239,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# via the standard h5py library:\nprint(h5_meas_group.attrs['VS_amplitude_[V]'])\nprint(h5_meas_group.attrs['VS_amplitude_[V]'] == 8)"
]
......@@ -257,12 +257,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"print(h5_meas_group.attrs['VS_measure_in_field_loops'])\n\n# comparing the (byte)string value of attributes is a problem with python 3:\nh5_meas_group.attrs['VS_measure_in_field_loops'] == 'in and out-of-field'"
]
......@@ -275,12 +275,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"str_val = px.hdf_utils.get_attr(h5_meas_group, 'VS_measure_in_field_loops')\nprint(str_val == 'in and out-of-field')"
]
......@@ -293,12 +293,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Accessing the raw data\npycro_main = main_dsets[0]\nprint('Dataset as observed via h5py:')\nprint()\nprint('\\nDataset as seen via a PycroDataset object:')\nprint(pycro_main)\n# Showing that the PycroDataset is still just a h5py.Dataset object underneath:\nprint()\nprint(isinstance(pycro_main, h5py.Dataset))\nprint(pycro_main == h5_raw)"
]
......@@ -311,12 +311,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"for att_name in pycro_main.attrs:\n print(att_name, pycro_main.attrs[att_name])"
]
......@@ -329,12 +329,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"print(px.hdf_utils.getAuxData(pycro_main, auxDataName='Bin_FFT'))"
]
......@@ -347,12 +347,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# A function to describe the nature of the contents within a dataset\nprint(px.hdf_utils.get_data_descriptor(h5_raw))\n\n# this functionality can be accessed in PycroDatasets via:\nprint(pycro_main.data_descriptor)"
]
......@@ -365,12 +365,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# We can use the getAuxData function again to get the ancillary datasets linked with the main dataset:\n# The [0] slicing is to take the one and only position indices and spectroscopic indices linked with the dataset\nh5_pos_inds = px.hdf_utils.getAuxData(h5_raw, auxDataName='Position_Indices')[0]\nh5_spec_inds = px.hdf_utils.getAuxData(h5_raw, auxDataName='Spectroscopic_Indices')[0]\n\n# Need to state that the array needs to be of the spectral shape.\nprint('Spectroscopic dimensions:')\nprint(px.hdf_utils.get_formatted_labels(h5_spec_inds))\nprint('Size of each dimension:')\nprint(px.hdf_utils.get_dimensionality(h5_spec_inds))\nprint('Position dimensions:')\nprint(px.hdf_utils.get_formatted_labels(h5_pos_inds))\nprint('Size of each dimension:')\nprint(px.hdf_utils.get_dimensionality(h5_pos_inds[()].T))"
]
......@@ -383,12 +383,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# an alternate way to get the spectroscopic indices is simply via:\nprint(pycro_main.h5_spec_inds)\n\n# We can get the spectral / position labels and dimensions easily via:\nprint('Spectroscopic dimensions:')\nprint(pycro_main.spec_dim_descriptors)\nprint('Size of each dimension:')\nprint(pycro_main.spec_dim_sizes)\nprint('Position dimensions:')\nprint(pycro_main.pos_dim_descriptors)\nprint('Size of each dimension:')\nprint(pycro_main.pos_dim_sizes)"
]
......@@ -401,12 +401,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"spec_sort_order = px.hdf_utils.get_sort_order(h5_spec_inds)\nprint('Spectroscopic dimensions arranged as is:')\nunsorted_spec_labels = px.hdf_utils.get_formatted_labels(h5_spec_inds)\nprint(unsorted_spec_labels)\nsorted_spec_labels = np.array(unsorted_spec_labels)[np.array(spec_sort_order)]\nprint('Spectroscopic dimensions arranged from fastest to slowest')\nprint(sorted_spec_labels)"
]
......@@ -419,12 +419,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"h5_spec_inds = px.hdf_utils.getAuxData(pycro_main, auxDataName='Spectroscopic_Indices')[0]\nh5_spec_vals = px.hdf_utils.getAuxData(pycro_main, auxDataName='Spectroscopic_Values')[0]\ndimension_name = 'DC_Offset'\ndc_dict = px.hdf_utils.get_unit_values(h5_spec_inds, h5_spec_vals, dim_names=dimension_name)\nprint(dc_dict)\ndc_val = dc_dict[dimension_name]\n\nfig, axis = plt.subplots()\naxis.plot(dc_val)\naxis.set_title(dimension_name)\naxis.set_xlabel('Points in dimension')"
]
......@@ -437,12 +437,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"dv_val = pycro_main.get_spec_values(dim_name=dimension_name)\n\nfig, axis = plt.subplots()\naxis.plot(dc_val)\naxis.set_title(dimension_name)\naxis.set_xlabel('Points in dimension')"
]
......@@ -455,12 +455,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"ndim_form, success, labels = px.hdf_utils.reshape_to_Ndims(h5_raw, get_labels=True)\nif success:\n print('Succeeded in reshaping flattened 2D dataset to N dimensions')\n print('Shape of the data in its original 2D form')\n print(h5_raw.shape)\n print('Shape of the N dimensional form of the dataset:')\n print(ndim_form.shape)\n print('And these are the dimensions')\n print(labels)\nelse:\n print('Failed in reshaping the dataset')"
]
......@@ -473,58 +473,58 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"ndim_form = pycro_main.get_n_dim_form()\nprint('Shape of the N dimensional form of the dataset:')\nprint(ndim_form.shape)\nprint('And these are the dimensions')\nprint(pycro_main.n_dim_labels)"
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"two_dim_form, success = px.hdf_utils.reshape_from_Ndims(ndim_form,\n h5_pos=h5_pos_inds,\n h5_spec=h5_spec_inds)\nif success:\n print('Shape of flattened two dimensional form')\n print(two_dim_form.shape)\nelse:\n print('Failed in flattening the N dimensional dataset')"
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Close and delete the h5_file\nh5_f.close()\nos.remove(h5_path)"
]
}
],
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"version": 3,
"name": "ipython"
"name": "ipython",
"version": 3
},
"nbconvert_exporter": "python",
"file_extension": ".py",
"version": "3.5.2",
"pygments_lexer": "ipython3",
"mimetype": "text/x-python",
"name": "python",
"mimetype": "text/x-python"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
}
}
},
"nbformat": 4,
"nbformat_minor": 0
}
\ No newline at end of file
f112c96a2c64bb40e364addaff734ebe
\ No newline at end of file
9beb90fd77bd40685d2f96ae37dc2687
\ No newline at end of file
......@@ -37,13 +37,13 @@ User Tutorials
.. container:: sphx-glr-download
:download:`Download all examples in Python source code: auto_publications_python.zip <//home/challtdow/workspace/pycroscopy/docs/auto_publications/auto_publications_python.zip>`
:download:`Download all examples in Python source code: auto_publications_python.zip </C:/Users/cq6/git/Pycroscopy/pycroscopy/docs/auto_publications/auto_publications_python.zip>`
.. container:: sphx-glr-download
:download:`Download all examples in Jupyter notebooks: auto_publications_jupyter.zip <//home/challtdow/workspace/pycroscopy/docs/auto_publications/auto_publications_jupyter.zip>`
:download:`Download all examples in Jupyter notebooks: auto_publications_jupyter.zip </C:/Users/cq6/git/Pycroscopy/pycroscopy/docs/auto_publications/auto_publications_jupyter.zip>`
.. only:: html
......
{
"cells": [
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib inline"
]
......@@ -19,23 +19,23 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import os\n# Warning package in case something goes wrong\nfrom warnings import warn\n# Package for downloading online files:\ntry:\n # This package is not part of anaconda and may need to be installed.\n import wget\nexcept ImportError:\n warn('wget not found. Will install with pip.')\n import pip\n pip.main(['install', 'wget'])\n import wget\nimport h5py\nimport numpy as np\nimport matplotlib.pyplot as plt\ntry:\n import pycroscopy as px\nexcept ImportError:\n warn('pycroscopy not found. Will install with pip.')\n import pip\n pip.main(['install', 'pycroscopy'])\n import pycroscopy as px"
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Downloading the example file from the pycroscopy Github project\nurl = 'https://raw.githubusercontent.com/pycroscopy/pycroscopy/master/data/BEPS_small.h5'\nh5_path = 'temp.h5'\n_ = wget.download(url, h5_path)\n\nprint('Working on:\\n' + h5_path)"
]
......@@ -48,12 +48,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",
"outputs": [],
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Open the file in read-only mode\nh5_f = h5py.File(h5_path, mode='r')\n\n# We can also use the ioHDF5 class from Pycroscopy to open the file. Note that you do need to close the\n# file in h5py before opening it again.\nh5_f.close()\nhdf = px.ioHDF5(h5_path)\nh5_f = hdf.file\n\n# Here, h5_f is an active handle to the open file"
]
......@@ -66,12 +66,12 @@
]
},
{
"execution_count": null,
"cell_type": "code",