>> a = iData([ ifitpath 'Data/ILL_IN6.dat' ]);
>> a = load(iData, [ ifitpath 'Data/ILL_IN6.dat' ]);
>> a = iLoad('')The result of all this mechanics is that importation is fully transparent. The file type is determined automatically, imported and formatted accordingly. The resulting structure is then ready to be converted into an iData object.
>> a = iLoad(filename); % this is a structureIn the case where the automatic importation fails, it is possible to manually force one format specification to be used
>> a = iData(a); % convert to iData object
>> a = iLoad(filename, 'HDF5'); % explicitly use HDF5 loader
>> a = iLoad('formats');The filters have been divided into two categories: those that directly use formats natively known by Matlab, and those that are more specific to neutron and X-ray communities (or other research areas).
format (load) |
Text/Binary |
Description |
iData/saveas Write |
text |
text |
Any text file, using a free format, can be read. Any text editor (gedit, notepad, nedit, ...) can display such files. |
Yes (DAT, M-file) |
'cdf','nc' NetCDF 1 and 2 |
binary |
The NetCDF format is a compact binary format. Such files can be edited/viewed with e.g ncview or hdfview, ncBrowse, OpenDX. Such files can of course also be imported into iData objects. | Yes |
'fits' FITS astronomical image format |
binary |
The FITS format is a standard data format used in astronomy. Can be displayed with e.g. GIMP, xv. |
Yes |
'hdf4' HDF 4 image |
binary |
The HDF4 format is a compact, binary storage format. Such files can be edited/viewed with e.g hdfview. IDL and Matlab also have dedicated HDF 4 browsers (see hdftool). Also includes HDF-EOS format. | Yes (image) |
'hdf5' HDF 5 |
binary |
The HDF5 format is a compact, compressed binary storage format. However, in its use here, it partly reconstructs the initial object, with its main values and alias/axes names. Such files can be edited/viewed with e.g hdfview, OpenDX. Such files can of course also be imported into iData objects. IDL and Matlab also have dedicated HDF browsers (see hdftool). This format includes the NeXus format. | Yes |
'mat' Matlab Mat-file |
binary |
The Matlab workspace binary file is compact and fast to read/write. It carries the whole object information. Such files require Matlab (or Octave) to be installed prior to importation. | Yes |
'xls' Excel spreadsheet |
binary |
Microsoft Excel spreadsheet. Can be viewed with any spreadsheet software (OpenOffice, Excel, Gnumeric) | Yes |
'gif' 'bmp' 'png' 'tiff' 'jpeg' 'ico' |
binary |
Standard image formats. View with e.g. GIMP, xv. | Yes |
'csv' Matlab comma separated values |
text |
A file spreadsheet format. Can be viewed with any spreadsheet software (OpenOffice, Excel, Gnumeric) | Yes |
'fig' Matlab figure | binary |
The Matlab figure can also be opened with openfig(file), and then converted to iData with iData(gcf). |
Yes |
'xml' XML description file |
text |
The XML format (experimental) |
|
'wk1' Lotus1-2-3 (first spreadsheet) |
text/binary |
Lotus 123 spreadsheet format. A replacement to Microsoft Excel, from IBM. |
|
'au' NeXT/SUN (.au) sound |
binary |
Sound format, initially from Sun/NeXT |
|
'wav' Microsoft WAVE sound |
binary |
Sound format, standard |
|
'avi' Audio/Video Interleaved multimedia container |
binary |
A video encoding format |
format (load) |
Text/Binary |
Description |
iData/saveas Write |
ILL data |
text |
Files generated by ILL instruments, with specific support for ILL TAS. May require post-processing to assign Signal and axes right, as well as metadata. This data can also be imported with Lamp. | |
ChalkRiver CNBC/NRU |
text |
Files generated by the CNBC NRU instruments at Chalk River. Multi-wire and polarized data files are supported. |
|
PDB file |
text |
Protein Data Bank file describing e.g. proteins |
|
'spc' SPEC |
text |
The SPEC ESRF legacy format. May be slow to import due to the file format complexity for large files. | |
'sim' McStas/PGPLOT |
text |
The legacy format generated by McStas. Support for 1D, 2D and event lists. |
Similar to the DAT export format |
'sqw','laz','lau' McStas sample files |
text |
Sample files for Isotropic_Sqw, PowderN and Single_crystal McStas components, resp obtained from nMoldyn, FullProf, ICSD and Crystallographica. |
|
'inx' INX |
text |
The INX format is a simple format for reduced neutron time-of-flight data (see example). This data can also be imported/generated with Lamp. | |
'edf' EDF ESRF Data format |
binary with 512-multiple length text header | The EDF format is mainly used at the ESRF and can be viewed with e.g. PyMCA, Zimg, GnuPlot, EDFExplorer, Fit2D. | Yes |
'spe' ISIS SPE |
text |
The SPE data format is obtained after processing ISIS RAW files with Horace and LibISIS. | |
'nx','nxs','n4','n5' |
binary |
The NeXus files are HDF4/5 files. See above format description for more information. ,This format includes all types of derivatives (such as NX SPE from ISIS). | |
'cbf' ESRF/SLS binary |
binary with 4096-multiple length text header |
The Crystallographic Binary File format, used on some X-ray and neutron diffractometers. See the format definition. This format gathers CIF and imgCIF standards. |
|
'hdr'+'img' MRI 3D volume |
binary (2 files) |
A MRI volume data format. The 'hdr' file requires an ssociated 'img' file. Format from the Analyze Biomedical Imaging Resource of the Mayo Clinic. | Yes |
>> iLoad('formats'); % display the list of supported formatsThe configuration file iLoad_ini is stored by default in the
>> config = iLoad('load config'); % retrieve the iLoad configuration and file loaders (from cache)
>> iLoad('force load config'); % force re-read of the configuration file
[ ifitpath 'iFiles' filesep 'iLoad_ini' ]and a local copy (which overrides the default) is stored in
prefdirwhen executing
>> iLoad('save config');This is where you may add your own customized format definitions. Deleting this file will revert to the default configuration.
>> iLoad('save config', config);
% Saved iLoad configuration into /home/farhi/.matlab/R2007a/iLoad.ini <- this is prefdir
>> delete([ prefdir filesep 'iLoad_ini.m' ]);Last, the config.UseSystemDialogs field of the iLoad configuration can be set to 'yes' to use the native Matlab/Java file selector, or to 'no' to use uigetfiles.
format14.name ='INX tof data'; |
struct = looktxt(filename)
The options field provides
additional options that should be sent to the method. When given as a
single string, these options are appended to the filename before being
sent to the method, e.g.struct = looktxt([ filename options ])When given as a cell, they are passed as additional input arguments to the method, e.g.
struct=method(filename, options{1}, options{2}, ...)The structure obtained from the method is then converted into an iData object when called from the iData or iData/load method. In these cases, the postprocess field is used so that the returned iData object is
object = postprocess( iData( method(filename, options...) ) )The post-process is a script that takes as input an iData object, and returns a possibly modified object (or an array of objects). This is where Signal, Axes, Aliases and metadata are re-arranged in the object. The post-process scripts are store in the iFiles/postprocess directory, and use a 'load_<format>' function naming convention for clarity. When missing, the default Signal and axes definitions will be used.
>> iLoad('force load config'); % force to re-read the configuration files