Difference between revisions of "Input and Output Functions"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
== ASCII Files == | == ASCII Files == | ||
− | [[IXTdataset_1d]] objects may be stored in ASCII files. These files may contain x and y data or x, y, error data in a 2 or 3 column format. Column 1 will be x values, column 2 will be y values and if available column 3 will be error values, if not available then error is assumed to be 0. Any information at the start or end of the file that is not in a 2 or 3 column format is ignored (for instance, header information may be stored here). Columns may be separated by commas, tabs, or spaces. ASCII files may contain point or histogram data, the x column in histogram data will have one more value than the y and e columns. The following files would all be acceptable ASCII files | + | * [[IXTdataset_1d]] objects may be stored in ASCII files. |
+ | * These files may contain x and y data or x, y, error data in a 2 or 3 column format. | ||
+ | *Column 1 will be x values, column 2 will be y values and if available column 3 will be error values, if not available then error is assumed to be 0. | ||
+ | * Any information at the start or end of the file that is not in a 2 or 3 column format is '''ignored''' (for instance, ''header information'' may be stored here). | ||
+ | * Columns may be separated by commas, tabs, or spaces. | ||
+ | * ASCII files may contain point or histogram data, the x column in histogram data will have one more value than the y and e columns. | ||
+ | |||
+ | * The following files would all be acceptable ASCII files | ||
<pre> | <pre> | ||
Line 31: | Line 38: | ||
Will represent the same 3 column histogram dataset with error data. | Will represent the same 3 column histogram dataset with error data. | ||
− | When files are written by libisis a header is written at the top of the file with the following information | + | * When files are written by libisis a header is written at the top of the file with the following information |
<pre> | <pre> |
Revision as of 12:04, 17 March 2008
ASCII Files
- IXTdataset_1d objects may be stored in ASCII files.
- These files may contain x and y data or x, y, error data in a 2 or 3 column format.
- Column 1 will be x values, column 2 will be y values and if available column 3 will be error values, if not available then error is assumed to be 0.
- Any information at the start or end of the file that is not in a 2 or 3 column format is ignored (for instance, header information may be stored here).
- Columns may be separated by commas, tabs, or spaces.
- ASCII files may contain point or histogram data, the x column in histogram data will have one more value than the y and e columns.
- The following files would all be acceptable ASCII files
title = plots1 xaxis = wavelength yaxis = signal 490.2 30000 491.2 31923 492.2 40000
Represents a three point dataset with 0 error
title = plots1 xaxis = wavelength yaxis = signal 490.2 30000 300 491.2 31923 300 492.2 40000 250 493.2
Represents a 3 column histogram dataset with error data
490.2,30000,300 491.2,31923,300 492.2,40000,250 493.2
Will represent the same 3 column histogram dataset with error data.
- When files are written by libisis a header is written at the top of the file with the following information
name = dataset name title = dataset title signal_units = dataset s axis label x_units = dataset x axis label x_distribution = 1 x1 s1 e1 x2 s2 e2 ...
where the header information is taken from the dataset being written.
To read and write data to ASCII files in