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": [ "cells": [
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "source": [
"%matplotlib inline" "%matplotlib inline"
] ]
...@@ -19,23 +19,23 @@ ...@@ -19,23 +19,23 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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" "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", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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)" "# 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 @@ ...@@ -48,12 +48,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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" "# 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 @@ ...@@ -66,12 +66,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "source": [
"print('Contents of the H5 file:')\npx.hdf_utils.print_tree(h5_f)" "print('Contents of the H5 file:')\npx.hdf_utils.print_tree(h5_f)"
] ]
...@@ -84,12 +84,12 @@ ...@@ -84,12 +84,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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)" "# 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 @@ ...@@ -102,12 +102,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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)" "# 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 @@ ...@@ -120,12 +120,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "source": [
"for dset_name in h5_group:\n print(px.hdf_utils.checkIfMain(h5_group[dset_name]), ':\\t', dset_name)" "for dset_name in h5_group:\n print(px.hdf_utils.checkIfMain(h5_group[dset_name]), ':\\t', dset_name)"
] ]
...@@ -138,12 +138,12 @@ ...@@ -138,12 +138,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "source": [
"main_dsets = px.hdf_utils.get_all_main(h5_f)\nfor dset in main_dsets:\n print(dset.name, dset.shape)" "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 @@ ...@@ -156,12 +156,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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)" "# 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 @@ ...@@ -174,12 +174,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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'}))" "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 @@ ...@@ -192,12 +192,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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)" "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 @@ ...@@ -210,23 +210,23 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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]))" "# 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", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "source": [
"# accessing specific attributes only:\nprint(px.hdf_utils.get_attributes(h5_meas_group, attr_names=['VS_mode', 'BE_phase_content']))" "# accessing specific attributes only:\nprint(px.hdf_utils.get_attributes(h5_meas_group, attr_names=['VS_mode', 'BE_phase_content']))"
] ]
...@@ -239,12 +239,12 @@ ...@@ -239,12 +239,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "source": [
"# via the standard h5py library:\nprint(h5_meas_group.attrs['VS_amplitude_[V]'])\nprint(h5_meas_group.attrs['VS_amplitude_[V]'] == 8)" "# 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 @@ ...@@ -257,12 +257,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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'" "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 @@ ...@@ -275,12 +275,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "source": [
"str_val = px.hdf_utils.get_attr(h5_meas_group, 'VS_measure_in_field_loops')\nprint(str_val == 'in and out-of-field')" "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 @@ ...@@ -293,12 +293,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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)" "# 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 @@ ...@@ -311,12 +311,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "source": [
"for att_name in pycro_main.attrs:\n print(att_name, pycro_main.attrs[att_name])" "for att_name in pycro_main.attrs:\n print(att_name, pycro_main.attrs[att_name])"
] ]
...@@ -329,12 +329,12 @@ ...@@ -329,12 +329,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "source": [
"print(px.hdf_utils.getAuxData(pycro_main, auxDataName='Bin_FFT'))" "print(px.hdf_utils.getAuxData(pycro_main, auxDataName='Bin_FFT'))"
] ]
...@@ -347,12 +347,12 @@ ...@@ -347,12 +347,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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)" "# 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 @@ ...@@ -365,12 +365,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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))" "# 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 @@ ...@@ -383,12 +383,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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)" "# 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 @@ ...@@ -401,12 +401,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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)" "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 @@ ...@@ -419,12 +419,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",
"outputs": [], "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [],
"source": [ "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')" "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 @@ ...@@ -437,12 +437,12 @@
] ]
}, },
{ {
"execution_count": null,
"cell_type": "code", "cell_type": "code",