/igorutils

Utility modules for Igor Pro

Primary LanguageIGOR Pro

igorutils

Utility modules for WaveMetrics' Igor Pro

igorutils provides a set of reusable modules that provide a more consistent API for writing code in Igor Pro.

Project Goals

Igor Pro is a popular scientifc graphing and data analysis program. Igor provides a powerful set of built-in functions and operations, but the API is somewhat inconsistent.

igorutils makes programming in Igor easier by providing:

  • more consistent conventions and clearer names for common tasks
  • data structures like lists, dictionaries/maps, and sets
  • general purpose utilities (see below)

For example, to append a row to an Igor wave using the built-in API, you would write:

InsertPoints/M=0 numpnts(<wave>), 1, <wave>

With the igorutils wave module, the code is clearer:

#include "waveutils"
Wave_appendRow(<wave>)

Some particularly useful features

rangespec module

a flexible format for specifying number ranges (e.g. 1-3 --> 1;2;3). particularly useful for specifying a subset of items in a list.

unit module

SI units/prefixes and common derived units. (e.g. Unit_scaleWave(<wave>, 'pA') will correctly rescale wave values and units to picoamperes, and yell at you if you provide incompatible units)

refpath module

easy object references. very useful for working across data folders

color utilities

nice color palettes from D3 and ColorBrewer. apply a palette to all the lines in a graph with Graph_colorTraces(<palette>, [<graph>]).

List_compact and List_expand

simple compression/decompression of a list by prefix (e.g. "wave1;wave2;wave3" --> "wave{1;2;3}"). originally designed to fit long lists into wave notes.

Wave_store

save a wave to a given location. This is harder to get right than it seems. Particularly useful for saving free waves and in conjuction with refpath utilities

wavelist module

convenient creation and handling of lists of wave (e.g. WaveList_average(<list>, <output_path>) stores a wave at output_path containing the average across waves in the list)

See the documentation in the code and the tests for more information.

A note on lists and dictionaries: these data structures are implemented as strings in Igor and so have the performance characteristics of strings. This is the representation the built-in Igor API encourages and igorutils therefore adopts it. An igorutils "list" is the same as an Igor "list", just with added semantics and conveniences. Likewise for dictionaries.