|
PEARL Procedures rev-distro-3.1.0-0-gea838b3-dirty
Igor procedures for the analysis of PEARL data
|
#include <HierarchicalListWidget>#include "pearl-area-import"#include "pearl-area-profiles"#include "pearl-area-display"#include "pearl-compat"#include "pearl-pshell-import"Go to the source code of this file.
Functions | |
| variable | pearl_data_explorer () |
| show the pearl data explorer window | |
| static variable | init_package () |
| static variable | save_prefs () |
| save persistent package data to the preferences file. | |
| static variable | load_prefs () |
| static variable | pearl_file_type (string filename) |
| check whether a file can be imported by this module. | |
| static variable | update_filepath () |
| update the file path after path change | |
| static variable | update_filelist () |
| read a list of PEARL files from the file system | |
| static variable | get_file_info (string filename) |
| load the internal structure of a file | |
| static variable | attributes_notebook (string filename) |
| load attributes | |
| static variable | extract_attributes (dfref attr_df, dfref dest_df=defaultValue, wave attr_filter=defaultValue, variable include_datawaves=defaultValue, variable include_infowaves=defaultValue) |
| extract summary from attribute waves | |
| variable | test_attributes_notebook () |
| static variable | create_attributes_notebook (wave attr_names, wave attr_values, string title) |
| static variable | notebook_add_attributes (string notebook_name, wave attr_filter, wave attr_names, wave attr_values) |
| static variable | preview_file (string filename) |
| static wave | preview_pshell_file (string filename) |
| load the preview of a PShell HDF5 file. | |
| static wave | preview_hdf_file (string filename) |
| load the preview of a PEARL HDF5 file. | |
| static wave | preview_itx_file (string filename) |
| load the preview of a general ITX file. | |
| static variable | extract_preview_image (wave data, wave preview) |
| extract a preview image from a wave of arbitrary dimension | |
| static variable | preview_datafolder () |
| preview data in the current data folder | |
| static variable | preview_setscale_x (wave data, wave preview) |
| static variable | display_dataset (dfref file_df, string dataset) |
| displays the graph of a loaded dataset in its own window | |
| static string | show_preview_graph (wave data, wave xdata=defaultValue) |
| static string | display_preview_trace (wave xtrace, wave ytrace) |
| static variable | load_selected_files (string options=defaultValue) |
| load the selected files | |
| static variable | load_file (string filename, string options=defaultValue, dfref dest_df=defaultValue, variable quiet=defaultValue) |
| load one file | |
| static variable | prompt_hdf_options (string *options) |
| variable | prompt_default_process (string *param) |
| prototype for prompting for processing function parameters. | |
| variable | prompt_func_params (string func_name, string *func_param) |
| static dfr | load_pshell_file (string filename, string options=defaultValue, dfref dest_df=defaultValue, variable quiet=defaultValue) |
| load a pshell file | |
| static dfr | load_hdf_file (string filename, string options=defaultValue, dfref dest_df=defaultValue, variable quiet=defaultValue) |
| static dfr | load_itx_file (string filename, string options=defaultValue, dfref dest_df=defaultValue, variable quiet=defaultValue) |
| string | itx_suggest_foldername (string filename, variable ignoredate=defaultValue, string sourcename=defaultValue, variable unique=defaultValue) |
| suggest the name of a data folder based on an igor-text file name | |
| void | PearlDataExplorer () |
| macro to create the data explorer panel | |
| static variable | bp_load_prefs (WMButtonAction *ba) |
| static variable | bp_save_prefs (WMButtonAction *ba) |
| static string | shorten_filepath (string long_path, variable max_len) |
| shorten a file path for display | |
| static variable | bp_browse_filepath (WMButtonAction *ba) |
| static variable | bp_update_filelist (WMButtonAction *ba) |
| static string | pm_reduction_values () |
| items for data reduction popup | |
| static variable | pmp_reduction_func (WMPopupAction *pa) |
| static variable | bp_reduction_params (WMButtonAction *ba) |
| static variable | bp_load_options (WMButtonAction *ba) |
| static variable | selected_file (string file, variable do_preview, variable do_elog) |
| actions after a file has been selected | |
| static variable | bp_file_next (WMButtonAction *ba) |
| static variable | bp_file_prev (WMButtonAction *ba) |
| static variable | lbp_filelist (WMListboxAction *lba) |
| static variable | bp_attr_notebook (WMButtonAction *ba) |
| static variable | hlp_setup () |
| static variable | hl_contents_clear () |
| static variable | hl_contents_update (dfref file_df) |
| populate the contents list box with the internal directory of a HDF5 file | |
| static dfr | get_pshell_info (string path_name, string file_name, dfref dest_df=defaultValue) |
| static variable | hl_add_objects (string parent_path, string objects) |
| populate the contents list box with the given hierarchical paths | |
| static variable | hl_expand_scans () |
| static variable | hl_default_selection () |
| static variable | hlp_contents_open (string HostWindow, string ListControlName, string ContainerPath) |
| static variable | hlp_contents_selection (string HostWindow, string ListControlName, string SelectedItem, variable EventCode) |
| static variable | goto_dataset_folder (string filename, string datapath) |
| open data folder corresponding to a file and data path | |
| static variable | bp_goto_dataset (WMButtonAction *ba) |
| "goto DF" button | |
| static variable | bp_display_dataset (WMButtonAction *ba) |
| "display dataset" button | |
| static string | get_default_elog_module () |
| static variable | send_to_elog () |
| send file metadata to the ELOG panel | |
| string | PearlDataExplorer_proto_get_panel_name () |
| string | PearlDataExplorer_proto_set_panel_attributes (string windowname, string attributes, variable clear=defaultValue) |
| string | PearlDataExplorer_proto_set_panel_graphs (string windowname, string graphs) |
| static variable | set_elog_attributes (string elog_module, string panel_name, dfref file_df, string filename=defaultValue, string graphname=defaultValue) |
| send general metadata to ELOG panel - if available | |
Variables | |
| version | |
| static const string | package_path = "root:packages:pearl_explorer:" |
| static const string | ks_filematch_adh5 = "*.h5" |
| static const string | ks_filematch_pshell = "psh*.h5" |
| static const string | ks_filematch_itx = "*.itx" |
|
static |
load attributes
Definition at line 301 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1860 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1600 of file pearl-data-explorer.ipf.
|
static |
"display dataset" button
Definition at line 2209 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1746 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1780 of file pearl-data-explorer.ipf.
|
static |
"goto DF" button
the button selects the data folder of the selected file and dataset. an error message is shown if the data folder doesn't exist.
Definition at line 2177 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1684 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1545 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1662 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1560 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1623 of file pearl-data-explorer.ipf.
|
static |
Definition at line 480 of file pearl-data-explorer.ipf.
|
static |
displays the graph of a loaded dataset in its own window
Definition at line 816 of file pearl-data-explorer.ipf.
|
static |
Definition at line 897 of file pearl-data-explorer.ipf.
|
static |
extract summary from attribute waves
by default, all existing attributes are copied. if a text wave attr_filter exists in the pear_explorer folder, only the attributes referenced therein are copied. to set up a filter, duplicate the attr_names wave of a template dataset, and remove unwanted items.
| attr_df | data folder which contains the original data, e.g. the attr, diags or snaps folder in pshell files. |
| dest_df | destination folder. the output is written to the attr_names and attr_values waves. default = package folder. |
| attr_filter | (text wave) list of attributes allowed in the output. default = use attr_filter of package folder. |
| include_datawaves |
|
| include_infowaves |
|
Definition at line 347 of file pearl-data-explorer.ipf.
|
static |
extract a preview image from a wave of arbitrary dimension
Definition at line 703 of file pearl-data-explorer.ipf.
|
static |
Definition at line 2236 of file pearl-data-explorer.ipf.
|
static |
load the internal structure of a file
this loads metadata for updating the panels.
for a pshell file, metadata includes:
Definition at line 273 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1947 of file pearl-data-explorer.ipf.
|
static |
open data folder corresponding to a file and data path
the function tries to find where a given dataset has been loaded and selects the corresponding data folder. the data folder must exist (after previous import from the file), else an error code is returned and the folder selection will be the closest accessible parent folder of the target.
| filename | file name (without path). h5 and otf.itx files are supported. |
| datapath | dataset or group path inside the hdf5 file. |
Definition at line 2121 of file pearl-data-explorer.ipf.
|
static |
populate the contents list box with the given hierarchical paths
Definition at line 1975 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1898 of file pearl-data-explorer.ipf.
|
static |
populate the contents list box with the internal directory of a HDF5 file
Definition at line 1912 of file pearl-data-explorer.ipf.
|
static |
Definition at line 2064 of file pearl-data-explorer.ipf.
|
static |
Definition at line 2035 of file pearl-data-explorer.ipf.
|
static |
Definition at line 2075 of file pearl-data-explorer.ipf.
|
static |
Definition at line 2085 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1888 of file pearl-data-explorer.ipf.
|
static |
Definition at line 61 of file pearl-data-explorer.ipf.
| string itx_suggest_foldername | ( | string | filename, |
| variable | ignoredate = defaultValue, |
||
| string | sourcename = defaultValue, |
||
| variable | unique = defaultValue |
||
| ) |
suggest the name of a data folder based on an igor-text file name
if the file name follows the naming convention source-date-index.extension, the function tries to generate the nick name as source_date_index. otherwise it's just a cleaned up version of the file name.
igor text is used by the on-the-fly scan tool.
| filename | file name, including extension. can also include a folder path (which is ignored). the extension is currently ignored, but may be used in a later version. |
| ignoredate | if non-zero, the nick name will not include the date part. defaults to zero |
| sourcename | nick name of the data source. the function tries to detect the source from the file name. this option can be used to override auto-detection. allowed values: sscan, otf |
| unique | if non-zero, the resulting name is made a unique data folder name in the current data folder. defaults to zero |
Definition at line 1346 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1814 of file pearl-data-explorer.ipf.
|
static |
load one file
this can be a PShell, HDF5, or ITX file.
| options | key:value; list of load options. the recognized keys are: mode, reduction_func and reduction_params. see main text for a description of possible values. by default (options not specified), options are read from `s_hdf_options. if the option string is empty, the user is prompted for options. |
| dest_df | destination data folder. default: a new folder derived from file name under root. |
| quiet |
|
Definition at line 983 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1217 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1277 of file pearl-data-explorer.ipf.
|
static |
Definition at line 155 of file pearl-data-explorer.ipf.
|
static |
load a pshell file
if options is not specified, the complete file is loaded. if options is an empty string, the package default options are used.
data selection is extracted from the datasets list box.
the file can be loaded in one of the following modes (mode key of the options argument):
load_complete load all datasets regardless of selection. load_scan load default datasets of selected scans. load_region load default datasets of selected regions. load_dataset load selected datasets. load_diags load diagnostic datasets of selected scans.3-dimensional datasets can be loaded with dimension reduction. in this case, the name of the reduction function must be given under the reduction_func key. the reduction parameters are prompted for if a prompt function for the reduction function is found. the default reduction parameters are the most recent parameters s_reduction_params stored in the package data folder.
reduction_func:... name of the reduction function.if a reduction function is specified, default reduction parameters are read from s_reduction_params in the package data folder, and the user is prompted to review/update the parameters.
| options | key:value; list of load options. the recognized keys are: mode, reduction_func and reduction_params. see main text for a description of possible values. by default (options not specified), options are read from `s_hdf_options. if the option string is empty, the user is prompted for options. |
| dest_df | destination data folder. default: a new folder derived from file name under root. |
| quiet |
|
Definition at line 1107 of file pearl-data-explorer.ipf.
|
static |
load the selected files
load the files that are selected in the data explorer panel. the files are loaded using the load_file() function.
Definition at line 944 of file pearl-data-explorer.ipf.
|
static |
Definition at line 519 of file pearl-data-explorer.ipf.
| variable pearl_data_explorer | ( | ) |
show the pearl data explorer window
create a pearl data explorer window or bring the existing one to the front. if a new window is created, also initialize all package variables and load package preferences.
Definition at line 47 of file pearl-data-explorer.ipf.
|
static |
check whether a file can be imported by this module.
the file type is determined by the extension of the file name.
Definition at line 199 of file pearl-data-explorer.ipf.
| void PearlDataExplorer | ( | ) |
macro to create the data explorer panel
note: after editing the panel using the graphical editor, remove all automatically generated assignments from the lb_contents listbox. only the pos, size and keySelectCol properties should remain.
update controls state
Definition at line 1403 of file pearl-data-explorer.ipf.
| string PearlDataExplorer_proto_get_panel_name | ( | ) |
Definition at line 2319 of file pearl-data-explorer.ipf.
| string PearlDataExplorer_proto_set_panel_attributes | ( | string | windowname, |
| string | attributes, | ||
| variable | clear = defaultValue |
||
| ) |
Definition at line 2323 of file pearl-data-explorer.ipf.
| string PearlDataExplorer_proto_set_panel_graphs | ( | string | windowname, |
| string | graphs | ||
| ) |
Definition at line 2330 of file pearl-data-explorer.ipf.
|
static |
items for data reduction popup
Definition at line 1639 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1646 of file pearl-data-explorer.ipf.
|
static |
preview data in the current data folder
used by preview_itx_file
Definition at line 745 of file pearl-data-explorer.ipf.
|
static |
Definition at line 548 of file pearl-data-explorer.ipf.
|
static |
load the preview of a PEARL HDF5 file.
the preview is an arbitrary detector image extracted from the file, see adh5_load_preview(). the preview is loaded to the preview_image wave in the pear_explorer data folder.
the s_file_info string is updated with information about the scan dimensions.
| filename | name of a file in the directory specified by the pearl_explorer_filepath path object. |
Definition at line 636 of file pearl-data-explorer.ipf.
|
static |
load the preview of a general ITX file.
the function is designed for PEARL OTF and EPICS scan data converted from MDA files. the function picks the first wave whose PV note matches one from the global string s_preview_pvs (see preview_datafolder and init_package).
the preview is loaded to the preview_image wave in the pearl_explorer data folder. the s_file_info string is updated with information about the scan dimensions.
| filename | name of a file in the directory specified by the pearl_explorer_filepath path object. |
Definition at line 681 of file pearl-data-explorer.ipf.
|
static |
load the preview of a PShell HDF5 file.
the preview is an arbitrary detector image extracted from the file, see adh5_load_preview(). the preview is loaded to the preview_image wave in the pear_explorer data folder.
the s_file_info string is updated with information about the scan dimensions.
| filename | name of a file in the directory specified by the pearl_explorer_filepath path object. |
Definition at line 590 of file pearl-data-explorer.ipf.
|
static |
Definition at line 785 of file pearl-data-explorer.ipf.
| variable prompt_default_process | ( | string * | param | ) |
prototype for prompting for processing function parameters.
the function should prompt the user for function parameters, and update the param argument if the user clicked OK. returns 0 if the user clicked OK, 1 if the user cancelled.
prompt functions must have the same name as the corresponding reduction function with the prefix "prompt_". be aware of the limited length of function names in Igor.
this function is a prototype. it does nothing but returns OK.
Definition at line 1049 of file pearl-data-explorer.ipf.
| variable prompt_func_params | ( | string | func_name, |
| string * | func_param | ||
| ) |
Definition at line 1055 of file pearl-data-explorer.ipf.
|
static |
Definition at line 1009 of file pearl-data-explorer.ipf.
|
static |
save persistent package data to the preferences file.
this function is called when the user clicks the corresponding button. the data saved in the file are: data file path, attributes filter
Definition at line 139 of file pearl-data-explorer.ipf.
|
static |
actions after a file has been selected
| file | name of selected file |
| do_preview | enable/disable loading of preview data non-zero: load preview, zero: don't load preview |
| do_elog | enable/disable sending metadata to elog panel non-zero: send, zero: don't send |
Definition at line 1724 of file pearl-data-explorer.ipf.
|
static |
send file metadata to the ELOG panel
metadate is looked up in the following locations:
the data is sent to the first ElogPanel in the window list. call open_pearl_elog() to ensure a new default panel.
Definition at line 2262 of file pearl-data-explorer.ipf.
|
static |
send general metadata to ELOG panel - if available
the function works with any electronic logbook that has the same interfaces as pearl-elog.ipf. the set_panel_attributes and set_panel_graphs functions are required.
the following metatdata are sent. they must be present as strings in the specified data folder:
| ELOG parameter | global string | function argument |
|---|---|---|
| file | s_filepath | filename |
| graph attachment | graphname | |
| author | authors | |
| p-group | pgroup | |
| project | proposal | |
| sample | sample |
| elog_module | Igor module name of the electronic logbook, PearlElog or PearlSciLog. |
| panel_name | Window name of the logbook panel |
| file_df | data folder that contains the metadata. |
| filename | override file path read from s_filepath global string variable. if neither is declared, the file name is reset to empty field. |
| graphname | select this graph window for attaching. default: do not change the selection. |
Definition at line 2365 of file pearl-data-explorer.ipf.
|
static |
shorten a file path for display
Definition at line 1578 of file pearl-data-explorer.ipf.
|
static |
Definition at line 844 of file pearl-data-explorer.ipf.
| variable test_attributes_notebook | ( | ) |
Definition at line 473 of file pearl-data-explorer.ipf.
|
static |
read a list of PEARL files from the file system
wtFiles and wSelectedFiles in the package data folder are updated. only files for which pearl_file_type() returns non-zero are listed.
Definition at line 231 of file pearl-data-explorer.ipf.
|
static |
update the file path after path change
read the path info from pearl_explorer_filepath and update the path control
Definition at line 218 of file pearl-data-explorer.ipf.
|
static |
Definition at line 38 of file pearl-data-explorer.ipf.
|
static |
Definition at line 40 of file pearl-data-explorer.ipf.
|
static |
Definition at line 39 of file pearl-data-explorer.ipf.
|
static |
Definition at line 36 of file pearl-data-explorer.ipf.
| version |
Definition at line 6 of file pearl-data-explorer.ipf.