Index: trunk/www/areas/kst-plot/docbook/html/apcs02.html =================================================================== --- trunk/www/areas/kst-plot/docbook/html/apcs02.html (nonexistent) +++ trunk/www/areas/kst-plot/docbook/html/apcs02.html (revision 1513035) @@ -0,0 +1,6 @@ +
The Debug Dialog |
Prev | Troubleshooting | + |
+ The , selected from the is useful to check your installation, and find out if Kst thinks something has gone wrong. The Data Sources tab lists all of the data sources that Kst has successfully loaded. If you are using a data file that depends on a data source plugin that is not listed, then there is probably something wrong with your build or installation. +
+ The Log tab provides a log the loading of all data sources and data plugins, as well as logging some errors, such as out of memory errors. This log tab can be a useful place to look if things are not working out well. +
Prev | Contents | |
Troubleshooting | Up |
Creating plots from the Command-line |
Prev | The Kst Tutorial | Next |
A common use of Kst is to quickly produce plots of data from the command-line. This method of producing plots requires almost no knowledge of Kst's graphical user interface, yet produces immediate, useful results.
-The following instructions assume you are working in a broadly bash-compatible shell, such as you would in linux or osX. +The following instructions assume you are working in a broadly bash-compatible shell, such as you would in linux or MacOS.
To obtain an overview of all available Kst command-line options, type:
kst2 --help
A syntax description and list of commands similar to the following will be displayed:
KST Command Line Usage ************************ *** Load a kst file: *** kst [OPTIONS] kstfile [OPTIONS] will override the datasource parameters for all data sources in the kst file: -F <datasource> -f <startframe> -n <numframes> -s <frames per sample> -a (apply averaging filter: requires -s) ************************ *** Read a data file *** kst datasource OPTIONS [datasource OPTIONS []] OPTIONS are read and interpreted in order. Except for data object options, all are applied to all future data objects, unless later overridden. Output Options: --print <filename> Print to file and exit. --landscape Print in landscape mode. --portrait Print in portrait mode. --Letter Print to Letter sized paper. --A4 Print to A4 sized paper. --png <filename> Render to a png image, and exit. --pngHeight <height> Height of png image (pixels) --pngWidth <width> Width of png image (pixels) File Options: -f <startframe> default: 'end' counts from end. -n <numframes> default: 'end' reads to end of file -s <frames per sample> default: 0 (read every sample) -a apply averaging filter: requires -s Ascii File Options - for ascii files only: these are all sticky --asciiDataStart <Line> Data starts here. Files start at line 1. --asciiFieldNames <Line> Field names are in this row. --asciiNoFieldNames Fields are named for their data column --asciiReadUnits <Line> Read units from line <Line> --asciiNoUnits Do not read units --asciiSpaceDelim Columns are Space/tab delimited - --asciiDelim <char> Columns are dlimited with <char> + --asciiDelim <char> Columns are delimited with <char> --asciiFixedWidth <w> Columns have width <w> --asciiNoFixedWidth Columns are delimited, not fixed width --asciiDecimalDot Use a . as a decimal separator (ie, 10.1) --asciiDecimalComma Use a , as a decimal separator (ie, 10,1) Position: -P <plot name>: Place curves in one plot. -A Place future curves in individual plots. -m <columns> Layout plots in columns -T <tab name> Place future curves a new tab. Appearance -d: use points for the next curve -l: use lines for the next curve -b: use bargraph for the next curve --xlabel <X Label> Set X label of all future plots. --ylabel <Y Label> Set Y label of all future plots. --xlabelauto AutoSet X label of all future plots. --ylabelauto AutoSet Y label of all future plots. Data Object Modifiers -x <field>: Create vector and use as X vector for curves. -e <field>: Create vector and use as Y-error vector for next -y. -r <rate>: sample rate (spectra and spectograms). Data Objects: -y <field> plot an XY curve of field. -p <field> plot the spectrum of field. -h <field> plot a histogram of field. -z <field> plot an image of matrix field. **************** *** Examples *** Data sources and fields: Plot all data in column 2 from data.dat. kst data.dat -y 2 Same as above, except only read 20 lines, starting at line 10. kst data.dat -f 10 -n 20 -y 2 ... also read col 1. One plot per curve. kst data.dat -f 10 -n 20 -y 1 -y 2 Read col 1 from data2.dat and col 1 from data.dat kst data.dat -f 10 -n 20 -y 2 data2.dat -y 1 Same as above, except read 40 lines starting at 30 in data2.dat kst data.dat -f 10 -n 20 -y 2 data2.dat -f 30 -n 40 -y 1 Specify the X vector and error bars: Plot x = col 1 and Y = col 2 and error flags = col 3 from data.dat kst data.dat -x 1 -e 3 -y 2 Get the X vector from data1.dat, and the Y vector from data2.dat. kst data1.dat -x 1 data2.dat -y 1 Placement: Plot column 2 and column 3 in plot P1 and column 4 in plot P2 kst data.dat -P P1 -y 2 -y 3 -P P2 -y 4
This tutorial uses a demo ascii data file which is available at gyrodata.dat.gz. Download the file with your browser, and gunzip it.
gunzip gyrodata.dat.gz
We will first take a look at reading the ASCII file
gyrodata.dat
that we just downloaded.
ASCII files are one of the many file types Kst is capable of
reading. In ASCII files, data is arranged in columns, with each
column corresponding to a field, and the column numbers (beginning
with 1 from left to right) corresponding to field names. This
particular ASCII file contains 3 columns, and thus has field names 1,
2, and 3. To produce a plot of the first column, simply type:
kst2 gyrodata.dat -y 1
All the data in the first column will be plotted:
Note that no field was specified for the X axis of the plot, so Kst used the default INDEX vector. The INDEX vector is a special vector in Kst that contains integers from 0 to N-1, where N is the number of frames read in the corresponding Y axis vector. Close Kst by selecting from the menu, or by typing Ctrl+Q.
gyrodata.dat
contains 20000 frames, so you may
wish to only look at a portion of the data. To only plot 10000 frames
starting from frame 7000, type:
kst2 gyrodata.dat -f 7000 -n 10000 -y 1
One of Kst's strengths is its ability to plot real-time data.
Imagine that new data was being continually added to the end of
gyrodata.dat
. In such a scenario, it would be
useful to only plot the most recent portion of the data. To plot only
the last 1000 frames of gyrodata.dat
, enter the
following:
kst2 gyrodata.dat -n 1000 -y 1
If gyrodata.dat
was being updated, the plot would
continuously scroll to display only the last 1000 frames.
Note that the description of the y
option states that
Multiple instances of the y
option are allowed. This allows quick
plotting of more than one curve. To plot
all three fields in gyrodata.dat
in separate
plots, arranged in one column, enter the following:
kst2 gyrodata.dat -m 1 -y 1 -y 2 -y 3
The m
option specifies that the plots should be in a single column.
To plot column 1 in one plot, and columns 2 and three in a second plot, displayed side by side enter:
kst2 gyrodata.dat -m 2 -P 1 -y 1 -P 2 -y 2 -y 3
Prev | Contents | Next |
The Kst Tutorial | Up | Creating plots with the Data Wizard |
Creating Additional Plugins |
Prev | - Next |
Table of Contents
+ Next
Table of Contents
WARNING: This section was written for Kst version 1 and may be somewhat, or even totally obsolete. WARNING
Kst has a simple and standardized interface that facilitates easy creation of additional plugins. In addition to detailing basic requirements for plugins, the following sections describe how to make use of pre-written header files to create certain types of plugins.
A Kst plugin consists of two files—a KDE desktop service file and a shared object file.
The KDE desktop service file provides information about the plugin to the Kst plugin loading infrastructure. The following is an example of a KDE desktop service file for a Kst plugin:
[Desktop Entry] Encoding=UTF-8 Type=Service ServiceTypes=Kst Data Object X-KDE-ModuleType=Plugin X-KDE-Library=kst_FOO_plugin X-Kst-Plugin-Author=FOO Name=FOO Plugin Comment=The FOO algorithm for Kst.
Generally, you can use the example above as a template and modify the FOO entries to fit your plugin.
As can be seen from the example, the desktop service file consists of a series of key value pairs. The
ServiceTypes
entry should be left as seen above. This key indicates that the plugin inherits
the KstDataObject class. See the API documentation for the interfaces this class exposes. The
X-KDE-Library
key points to the shared object file that implements your plugin. Do not
include the shared object's file extension.
Once you have completed the desktop file, save it as [X-KDE-LIBRARY].desktop
, where
[X-KDE-LIBRARY]
is the value of the key in the desktop file.
The shared object file contains the actual functionality of the plugin. The following are the requirements for the shared object file:
The object must inherit the KstDataObject class:
#ifndef FOOPLUGIN_H #define FOOPLUGIN_H #include <kstdataobject.h> class FooPlugin : public KstDataObject { Q_OBJECT public: FooPlugin(QObject *parent, const char *name, const QStringList &args); virtual ~FooPlugin(); virtual KstObject::UpdateType update(int); virtual QString propertyString() const; virtual KstDataObjectPtr makeDuplicate(KstDataObjectDataObjectMap&); protected slots: virtual void _showDialog(); }; #endif
The following is an example of the shared object file source code for a simple plugin:
If you are using gcc to compile your plugin, simply compile the object file:
cc -Wall -c -o myplugin.o myplugin.c -fPIC -DPIC
and then create the shared library:
ld -o myplugin.so -shared myplugin.o
The resulting *.so
file and *.xml
file must be put in the same
directory. When you use Kst's Plugin Manager to load the XML file, it will automatically look for the
shared object file in the same directory.
Prev | Contents | Next |
Licensing | Up | Creating Linear Fit Plugins |
The Data Manager |
Prev | Working With Data | Next |
The Data Manager provides a central location for deleting and modifying all the data objects used in Kst. It can be accessed by selecting from the menu or by clicking the icon in the tool bar.
The window lists all data objects currently loaded in kst, as well as their type and basic properties. To edit an object, double click on it, or select it and click the button. It will bring up the appropriate edit dialog. Items that have child-vectors can be expanded to list them. Items also have right button context menus with common tasks for the items, such as making curves or power spectra from vectors, or adding curves to plots.
- Items can also be deleted from this dialog by selecting them and clicking . This will delete the selected item and all items which depend on it. So if you delete a vector, all curves, spectra, historgrams, or equations that depend on it will also be deleted. Be careful, because this can not be undone. + Items can also be deleted from this dialog by selecting them and clicking . This will delete the selected item and all items which depend on it. So if you delete a vector, all curves, spectra, histograms, or equations that depend on it will also be deleted. Be careful, because this can not be undone.
- Clicking will remove all undisplayed data objects. If deleting an object (and everthing that depends on it) will not change any plots or labels, then it is deleted. Nothing that is displayed is deleted. This can not be undone. + Clicking will remove all undisplayed data objects. If deleting an object (and everything that depends on it) will not change any plots or labels, then it is deleted. Nothing that is displayed is deleted. This can not be undone.
Prev | Contents | Next |
Working With Data | Up | Data Types |
Data Types |
Prev | Working With Data | Next |
Plots in Kst are created by building up objects into the displayed curves. In Kst, there are 5 major classes:
Data Sources: data files which are recognized by Kst.
Primitives: These are basic data types, including Strings, Scalars (which are single numbers), Vectors (which are ordered lists of numbers) and Matrices (which are 2D arrays of numbers).
Relations: these objects describe how vectors or matrices are displayed in a plot. They include Curves (which display an XY pair of vectors) and Images (which display matrices).
Data Objects: these classes take Primitives as inputs, process them, and output Primitives. These include Spectra, Histograms, Equations, Fits, Filters, and other Plugins.
View Items: these are objects that can be drawn, and include plots, labels, lines, etc. Plots can display Relations (curves and images). Labels can display Scalars and Strings.
As an example of how these various classes work together, consider the example session in the chapter on Filters. In this session, a curve from a data file was plotted, along with a low pass filtered version of the curve. The resulting data structures are as follows:
- The plot displays two curves. One curve takes two data vectors (INDEX and Column 2) as inputs. The other takes INDEX as its X vector, and the ouput vector of the Low Pass Filter as its Y vector. The low pass filter takes the Column 2 vector, and two Scalars as its inputs. The two data vectors get their data from the Data Source. + The plot displays two curves. One curve takes two data vectors (INDEX and Column 2) as inputs. The other takes INDEX as its X vector, and the output vector of the Low Pass Filter as its Y vector. The low pass filter takes the Column 2 vector, and two Scalars as its inputs. The two data vectors get their data from the Data Source.
The data manager for this sessions is shown below. Note that the literal scalars [4 (X30)] and [0.05 (X29)] are not listed. To keep things clean, and because '4' is not editable, literal scalars like this are not presented in the UI.
This structure could have been chained together further. For example, the output of the Filter could have been used as the input to a Histogram, and the Histogram of the output of the filtered data could have been plotted instead.
Descriptions of each data type are provided below.
Vectors are ordered lists of numbers. They are used as the inputs to Data Objects. They are also used to define the X or Y axis for curves. While different types of vectors are created in different ways, they can all be used in Data Objects or curves in the same way.
- Data Vectors aquire their data from Data Sources (ie, data files). They can be created from the option in the menu, or by selecting the + Data Vectors acquire their data from Data Sources (ie, data files). They can be created from the option in the menu, or by selecting the icon in any vector selector.
Generated Vectors are lists of equally spaced numbers whose range and spacing is defined in the GUI. They can be created from the option in the menu, or by selecting the icon in any vector selector.
Editable Vectors have their data defined through the Python interface. They can not be created or edited in the GUI.
Output Vectors are the output of data objects, such as histograms or filters.
Curves are used to create plottable objects from vectors. Curves are created from two vectors - an “X axis vector” and a “Y axis vector”. These two vectors are interpreted as a set of (X,Y) pairs to be plotted. When the X and Y vectors have the same length, the interpretation is obvious.
If, however, the X vector is of a different length than the Y vector, then the first and last points of each are assumed to represent the first and last (X,Y) pair, and the shorter vector is resampled using linear interpolation to have the same number of samples as the longer vector.
Curves are created by the data wizard, from the creation dialog from Data Objects (such as histograms) or by using the option in the menu. The latter produces the following:
Here, in the Curve Contents box, the curve has been set up to use INDEX (V1) as the X axis vector and Column 2 (V3) as the Y axis vector. Note that vectors holding X and Y axis error bars can also be selected. The icon in any of the vector selectors will bring up a new vector dialog. The icon will edit the selected vector.
- The appearance of curves is adjusted in the Appearance box. Some of the flexability of curves in kst is shown in the next figure. + The appearance of curves is adjusted in the Appearance box. Some of the flexibility of curves in kst is shown in the next figure. Note that the options are not exclusive - for example, Lines and Points can both be selected. The Size field specifies the dimensions of display elements such as points and error flags in points (the same way as font sizes are defined.) The Weight field specifies the width of lines, bar graph borders, and the strokes for points. The color selector to the right of the example line sets the color of lines, points, and bargraph borders. The color selector to the right of the Bargraph checkbox sets the fill color for bargraphs. The last (most recent) point of a - curve can be indicated by slecting Head and specifying + curve can be indicated by selecting Head and specifying a point type and color. The color selector to the right of the Head sets the color for this point.
The Placement box specifies what plot the curve will be displayed in. Both the Placement and Appearance boxes appear in data object creation dialogs as well, and work the same way.
Equations are data objects whose outputs are:
A vector (...:y
) which is the function of one or more data vectors.
A vector (...:x
) which passes through the X input vector.
The inputs are:
A vector which is used as the x
variable in equations.
Any vectors or scalars specified by name in the equation text.
Equations are used to produce vectors which are the point-by-point function of one or more input vectors and scalars. They are created by selecting from the menu. An example of creating an equation, and the resulting plot is shown below. In this example, a Generated Vector consisting of 1000 points from -10 to 10 was selected for the x vector. Recall that a Generated vector can be created by selecting the new vector icon,
which appears to the right of the X Vector field. The equation, sin(x)/x
, was entered into the Equation field.
Equations support the following operators:
Arithmetic operators: +
, -
, *
, /
, %
(modulus operator) and ^
(power operator).
Bitwise operators: &
, |
. These operators assume the vector is comprised of integers.
Logical operators: !
, &&
, ||
, <
, <=
, ==
, >=
, >
, and !=
. These functions output 1 for True and 0 for False.
Functions supported by kst are:
Trig functions working in Radians: SIN()
, COS()
, TAN()
, ASIN()
, ACOS()
, ATAN()
, ATAN2()
, SEC()
, CSC()
and COT()
.
Trig functions working in Degrees: SIND()
, COSD()
, TAND()
, ASIND()
, ACOSD()
, ATAND()
, SECD()
, CSCD()
and COTD()
.
Other functions: ABS()
(absolute value), SQRT()
(square root), CBRT()
(cube root), SINH()
, COSH()
, TANH()
, EXP()
, LN()
(natural logarithm), LOG()
(base 10 logarithm) and STEP()
(returns 1 if the argument is greater than 0, and 0 otherwise).
Equations also support the constants PI
and e
.
Equations can use any vector or scalar as their input vectors, not just the X vector. In the next example, the bottom right plot shows the signal in Column 2 with the signal in Column 1 regressed out of it. This has been done by subtracting Column 1, scaled by the slope of a fit to Column 2 vs Column 1, from Column 2. The fit had been created previously using the option in the right mouse button menu of the top right plot.
- The New Equation dialog which created this plot is shown below. Note that vectors are identified by enclosing their names in [ ]
. So Column 2 is indicated by [Column 2 (V2)]
. The Equation line widget has a fairly powerful autocomplete mechanism with a scrollable list of all possible scalars (in its first colum) or vectors (in its second column) as you enter the name of the object. Similarly, the auto complete lists all valid functions and operators as relevant while you type. The Esc
key hides the autocomplete widget.
+ The New Equation dialog which created this plot is shown below. Note that vectors are identified by enclosing their names in [ ]
. So Column 2 is indicated by [Column 2 (V2)]
. The Equation line widget has a fairly powerful autocomplete mechanism with a scrollable list of all possible scalars (in its first column) or vectors (in its second column) as you enter the name of the object. Similarly, the auto complete lists all valid functions and operators as relevant while you type. The Esc
key hides the autocomplete widget.
If the vectors were set to Read to end mode, all elements would be updated real time as new data came in.
Histograms are data objects whose outputs are:
A vector (...:num
) which contains the (optionally normalized) count of samples from the input vector which lie within each interval.
A vector (...:bin
) which contains the center of each interval for which the counts have been calculated.
The input is:
A vector for which the histogram is calculated.
In the New Histogram dialog, the bins can be set manually, can be preset once by selecting Auto Bin or can be set to be automatically reset with each data update by selecting Real-time auto bin.
By selecting Bargraph in the dialog, the histogram can be shown in the standard bar-graph form, below.
Power Spectra are data objects whose outputs are:
A vector (...:psd
) which contains the fft-based spectrum of the input
vector.
A vector (...:f
) which contains the centers of the corresponding
frequency bins.
The input is:
A vector for which the power spectrum is calculated. Uniform sampling is assumed.
- The following plot shows an example spectrum. The plot has been converted to log-log mode (hit 'l' and 'g' in the plot window to toggle Y and X log axes respectvely). + The following plot shows an example spectrum. The plot has been converted to log-log mode (hit 'l' and 'g' in the plot window to toggle Y and X log axes respectively).
The spectrum dialog (select from the menu) used to create this plot is shown below:
The dialog entries are as follows:
The data vector to create a power spectrum from.
Remove a constant from the input vector to make it mean zero before calculating the spectrum.
Apodize the data with the selected function before calculating the power spectrum to reduce -bin to bin leackage. The default is a Hanning Window. +bin to bin leakage. The default is a Hanning Window.
When Interleaved average is not set, the spectrum is based on an FFT - whose lengh is power of two larger or equal to the length of the unput vector. The remaining points are zero padded. For cases like this, apodization and mean removal is quite important. + whose length is power of two larger or equal to the length of the input vector. The remaining points are zero padded. For cases like this, apodization and mean removal is quite important.
When Interleaved average is set, the spectrum is based on the average of FFTs of length 2^x
where x
is specified by the FFT Length entry, interleaved such that no zero padding is required. Choosing this option reduces the noise of the spectrum, at the cost of reduced resolution.
The frequency bin output vector (...:f
) will be calculated assuming the input vector was uniformly sampled at this sample rate.
Auto-generating axes labels for plots will be based on these units.
Fits are data objects whose outputs are:
A vector (...:Fit
) which is the fit to the data, evaluated at the X value corresponding to each input Y point.
A vector (...:Residuals
) which is the difference between the input Y vector and the fit.
One or more named scalars which correspond to the fit parameters. For example, for linear fits, the scalars are ...:Intercept
and ...:Gradient
.
A scalar (...:chi^2/nu
which holds the reduced chi squared of the fit.
A vector (...:Covariance
) which holds the Covariance matrix of the fit in an arbitrary order. Because the parameters are listed in an arbitrary order, this vector is not currently particularly useful.
A vector (...:Parameters
) which is a list of the fit parameters in some arbitrary order. This vector is rarely useful and may be removed in the future. The named parameter scalars are a much more useful interface to the fit parameters.
The inputs are:
A vector which is to be fit to. (The Y axis vector)
A vector which is used to generate the X values corresponding to the Y vector. Note that if the X vector is not the same length as the Y vector, then the X vector will be resampled to have the same number of points as the Y vector in order to generate a series of (X, Y) pairs.
If a weighted fit is chosen: A vector which describes the error bars for the Y vector.
A number of fits are available in kst, including weighted (in which the error bar for each Y value is specified) and unweighted fits to lines, polynomials, Gaussians, Lorentians, and exponentials.
The easiest way to create a fit is by selecting from the plot context menu (right click in the plot, and then selecting the curve you would like to fit. The following dialog will appear.
A linear fit has been selected in the Plugin Selection combo box. The X and Y vectors have been automatically selected from the curve which was selected and can not be changed. The curve properties and placement of the automatically generated curve can be selected as usual.
- When has been selected, the curve is placed in the selected plot, and a label with the fit parameters is automatically created. Click the mouse whereever you want the label to go. + When has been selected, the curve is placed in the selected plot, and a label with the fit parameters is automatically created. Click the mouse wherever you want the label to go.
You can also create a fit plugin by selecting the appropriate fit from the submenu in the menu. With this dialog you can select the input vectors, but it does not automatically create a curve. You will have to create a curve by hand by selecting in the menu.
Filters are data objects whose output is:
A vector (...:Filtered
) which is the same size as the input vector.
The inputs are:
A vector which is to be filtered.
A number of numbers or scalars which are parameters for the filter.
- A number of filters are available in kst. The band pass, band stop, high pass and low pass filters are conventional zero phase shift fourier domain filters whose band edges follow the shape of a Butterworth filter. A higher order filter is a steeper cutoff. + A number of filters are available in kst. The band pass, band stop, high pass and low pass filters are conventional zero phase shift Fourier domain filters whose band edges follow the shape of a Butterworth filter. A higher order filter is a steeper cutoff.
Numerical Integrals can be created with the Cumulative Sum filter, and Numerical Derivatives with the Fixed Step Differentiation filter. In both of these dX takes the size of the step between samples.
- For fields such as angles which have (for example) a discontinuity at 360 degrees, the Unwind Fliter can be used to make the signal continuous. So if the unfiltered signal goes from 359.5 degrees to 0.5 degrees in consecutive samples, the filtered signal will go from 359.5 degrees to 360.5 degrees. + For fields such as angles which have (for example) a discontinuity at 360 degrees, the Unwind Filter can be used to make the signal continuous. So if the unfiltered signal goes from 359.5 degrees to 0.5 degrees in consecutive samples, the filtered signal will go from 359.5 degrees to 360.5 degrees.
The Flag filter can be used to mask a vector with NaNs whenever certain bit patters in the flag field are true.
The easiest way to create a filter is by selecting from the plot context menu (right click in the plot, and then selecting the curve you would like to fit.
You can also create a filter plugin by selecting the appropriate filter from the submenu in the menu. With this dialog you can select the input vectors, but it does not automatically create a curve. You will have to create a curve by hand by selecting in the menu.
Plugins that do not fit the requirements of being either fits are filters can be created from the submenu in the menu. They are not well documented.
Matrices are two dimensional tables of numbers. They can be used as the inputs to Data Objects. They are also used to define the values for Images. While different types of Matrices are created in different ways, they can all be used in Data Objects or Images in the same way.
- Data Matrices aquire their data from Data Sources (ie, data files). They can be created from the option in the menu, or by selecting the + Data Matrices acquire their data from Data Sources (ie, data files). They can be created from the option in the menu, or by selecting the icon in any matrix selector (for example, in the Image dialog).
Editable Matrices have their data defined through the Python interface. They can not be created or edited in the GUI.
Output Matrices are the output of data objects, such as Spectrograms.
Matrices can be read from:
Any data file compatible with QImage - (jpg, png, tiff, bmp, gif, etc). For color images, four matrices can be read: RED, GREEN, BLUE, and GRAY.
conventional 2D FITS images (if built with cfitsio).
- BIT Image Streams (BIS) fiiles. + BIT Image Streams (BIS) files.
The BIS data source can provide matrices from an image stream. In these cases, the frame number can be selected when the Matrix is created.
Images are used to create plottable objects from Matrices. The pixels are directly mapped from the matrix. ie, rows in the matrix are rows in the image. Columns in the matrix are columns in the image. The value of the Matrix sets the color of the pixel.
Images are typically created from selecting from the menu. The Image dialog is shown below:
A matrix has been read from a png file, and selected in the Matrix selector (GRAY (M1)
). A color map rather than a contour map has been selected, and a grey scale color pallet has been selected. With Real-time auto threshold selected, the maximum value in the matrix will be set to the maximum value of the color pallet, and the minimum value in the matrix will be set to the minimum value of the color pallet. All other values will be linearly interpolated. Alternatively, the maximum and minimum values can be set once, either using Smart/Percentile tool, or by manually setting the thresholds.
The resulting image is shown below. Note that, by default, the image will automatically fill the plot window, and will not preserve aspect ratio.
The aspect ratio can be normalized by selecting in the submenu of the plot context menu, or by pressing the "n" key in a plot window. The image will now have square pixels.
The range of the color pallet can be adjusted from the curve edit dialog, or by pressing 'i' in an image. This will cycle the color limits, allowing an increasing fraction of the pixels to be saturated at either end of the color scale before returning to full range.
Prev | Contents | Next |
The Data Manager | Up | Saving and Printing |
Troubleshooting |
Prev | - |
-Unfortunately, things can sometimes go wrong with Kst. This section lists somee things that can be useful to unbreak things. -
- For convenience reasons, Kst makes agressive use of sticky defaults - that is to say, Kst will generally remember what you did last time, and make that the new default behaviour. Unfortunately, this can sometimes leave the program in an odd state where the assumptions it is making make no sense. This most often happens with files and file defaults. +
Troubleshooting |
Prev | + Next |
Table of Contents
+Unfortunately, things can sometimes go wrong with Kst. This section lists some things that can be useful to unbreak things. +
+ For convenience reasons, Kst makes aggressive use of sticky defaults - that is to say, Kst will generally remember what you did last time, and make that the new default behaviour. Unfortunately, this can sometimes leave the program in an odd state where the assumptions it is making make no sense. This most often happens with files and file defaults.
- If you find that Kst has broken for you (that is, something that used to work no longer does), bad defaults is a pretty plausable explaination (though we do keep trying to track these situations down and remove them). You can completely restore Kst to it's default, just-installed configuration by selecting and from the menu. Unfortunately, this will erase all of your settings and defaults, but it may be necessary in some cases. If the problem seems to have something to do with data files, try first because it is generally less destructive and more likely to help. -
- The , selected from the is useful to check your installation, and find out if Kst thinks something has gone wrong. The Data Sources tab lists all of the data sources that Kst has successfully loaded. If you are using a data file that depends on a data source plugin that is not listed, then there is probably something wrong with your build or installation. -
- The Log tab provides a log the loading of all data sources and data plugins, as well as logging some errors, such as out of memory errors. This log tab can be a useful place to look if things are not working out well. -
Prev | Contents | |
Supporting Additional File Formats | Up |
Prev | Contents | Next |
Supporting Additional File Formats | Up | The Debug Dialog |
Exporting Tabs |
Prev | Saving and Printing | Next |
To export Kst plots to a graphics file, select from the menu. The following dialog box will appear.
- The root file name is specified in the File name: entry. If Automatic extension is selected, then the file name extension appropriate to the file type is automacially added to the file name. + The root file name is specified in the File name: entry. If Automatic extension is selected, then the file name extension appropriate to the file type is automatically added to the file name.
If Export all tabs is selected, then all tabs will be saved in separate files using the rules suggested in the label. So, for example, if the file name selected in File name: is "demo", the file type is png, and Automatic extension is selected, and there are three tabs, then the three tabs will be saved in "demo_View1.png", "demo_View2.png", and "demo_View3.png".
SVG images, as well all file types supported by QImage are supported by kst. This includes most common output formats. For vector formats, such as SVG, the output, including text, is in vector format. The Include: Vector formats and Bitmap formats checkboxes select what file types are listed in the File format list to make selection easier.
The size of the output image is specified in pixels. The Specify selection has 4 options: In order to preserve the aspect ratio of the on-screen window, the Width and Maintain Aspect Ratio or Height and Maintain Aspect Ratio options can be chosen. The other two options are to specify the Width and Height of the output files, or if you want the output to be a Square, to specify the Size of Square.
In the Save Options section, if is selected, the imaged will be saved with the specified options and settings when or are pressed.
If, instead, you would like to output the image at repeated intervals, say for providing a dynamic image for a web page, then select and input the desired time between images (note that this is the time to wait after the previous image is complete, and not a high precision timer). Once either the or buttons are pressed, Kst will begin performing an image export to the specified file names at the interval selected, silently overwriting the existing files. This will continue until Save Once is selected and the tabs are exported, or Kst is exited. A web page based on this is, admittedly, a little hacky, as it can be subject to displaying partial images if the write is not complete, but it does make for a very quick and easy way of making a kst session viewable remotely.
Prev | Contents | Next |
Printing Tabs | Up | Plugins, Fits, and Filters |
The Kst Handbook |
Next |
Copyright © 2004 - 2017 C. Barth Netterfield
Copyright © 2004 The University of British Columbia
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
Kst is a data plotting, real time data viewing, and quick look analysis program. -
Table of Contents
Next | ||
Introduction |
Table of Contents
Next | ||
Introduction |