>> 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, from the iLoad formats output
>> a = iData(a); % convert to iData object
>> iLoad('formats') ...
HDF read_hdf5/load_psi_RITA HDF5
...
>> a = iLoad(filename, 'HDF5'); % explicitly use HDF5 loader
>> a = iLoad('formats');Some of these formats can be written back, providing a vast conversion capability (see the Save page).
format
(load) |
Text/Binary |
Description |
iData/saveas Write |
text 'xvg','dat','txt... |
text |
Any text file, using a free
format, can be read. Any text editor (gedit, notepad, nedit,
...) can display such files. The XVG format is the native XmGrace
one. |
Yes (DAT, M-file) |
'cdf','nc' NetCDF |
binary |
The NetCDF
format is a compact binary format. Such files can be
edited/viewed with e.g ncview
or hdfview,
ncBrowse,
OpenDX, Panoply,
Autoplot. |
Yes |
'cdf' CDF | The CDF format is a compact binary format. Such files can be edited/viewed with e.g OpenDX and Autoplot. It is incompatible with NetCDF. | 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, Autoplot. |
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, Autoplot. 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. The ROOT data format (CERN) can be converted into HDF5 with rootpy (root2hdf5). You can also read and write such files using LAMP. |
Yes |
'mat' Matlab Mat-file |
binary |
The Matlab workspace serialized binary file is compact and fast to read/write. It carries the whole object information. Such files require Matlab/iFit (or Octave) to be installed prior to importation. To save a file use: save(a,'mat_file','mat'). To load it use load(iData,'mat_file'). | 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. | Yes |
'ppm' 'pgm' 'pbm' | text |
Standard image formats. View with e.g. GIMP, xv, ImageJ. | 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) |
Yes |
'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 |
|
'yaml','json' meta language configuration files |
text |
Data serialization format such as "YAML Ain't Markup Language" and JSON JavaScript Object Notation | yes |
'ibw' Igor pro Wave |
binary |
Igor pro wave data
file |
|
'lvm' 'tdms' LabView |
text/binary |
LabView LVM measurement file and TDMS hierarchical technical data files | |
'sav' IDL |
binary |
IDL saved data (see format here). You can also read and write such files using LAMP. | |
'npy' NUMPY |
binary |
Numpy binary array NPY
format (single array) |
yes |
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. | |
ILL Cyclops Laue
camera |
text/binary |
Specific data format for the Cyclops
Neutron Laue diffractometer, which measures the reciprocal
space image of a sample structure. |
|
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. View with e.g. Jmol. The file
structure is read, the gyration radius Rg, Protein density,
volume, excess charge, scattering structure factor S(q) and pair
correlation function. These files can be viewed by JMol, PyMol, ViewMol, RasMol, Avogadro,
Garlic,
GDis, VMD, Chimera Yasara ... |
|
'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. |
Yes, 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,
FabIO. |
Yes |
'spe' ISIS SPE |
text |
The SPE data format is
obtained after processing ISIS RAW files with Horace and LibISIS (Homer/2d). |
|
'sqw' ISIS SQW |
binary |
The SQW data format is obtained after processing ISIS RAW files with Horace and LibISIS. | |
'spe' Roper Scientific |
binary |
Princeton/Roper
Scientific WinView / PI Acton image file |
|
'sif' Andor Technology |
binary |
Andor
Technology CCD Camera file |
|
'mar','mccd' MarResearch |
binary (TIFF) |
MarResearch CCD
Camera (Mar345)
format, can also be imported as a TIFF format |
|
'img' ADSC image |
binary with 512 char header |
ADSC CCD
Camera |
|
'nx','nxs','n4', 'n5','nxspe' NeXus |
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). Such files can be edited/viewed with e.g hdfview. | Yes (as HDF5) |
'nxs' Mantid
workspace |
binary |
Specific support for reading Mantid and Lamp
workspaces. |
Yes |
'cbf' ESRF/SLS binary imgCIF |
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. These
files are e.g. generated by Pilatus CCD Cameras. |
|
'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.Analyze files can
be obtained from DICOM files
using e.g. DicomNifti,
MiTools, MRIconvert,
or the Matlab tool dicm2nii.
You can view with Invesalius,
MiView (MiTools),
MRICron. |
Yes |
'nii' NifTI MRI volume |
binary |
A NifTI medical imaging volume data format (MRI). Such files can be obtained from DICOM files using e.g. DicomNifti, MiTools, MRIconvert, or the Matlab tool dicm2nii. You can view with MiView (MiTools), MRICron. | Yes |
STL/SLP/PLY/OFF/OBJ Volume/geometry |
text or binary |
The STL SLP OFF OBJ and PLY format are common in stereo-lithography CAD software. They describe raw unstructured triangulated surfaces/volumes by the unit normal and vertices (ordered by the right-hand rule) of the triangles using a three-dimensional Cartesian coordinate system. These files can be viewed with e.g. MeshLab, AdMesh, FreeCAD, Geomview, Chimera. | Yes |
CIF, CFL/PCR, INS/RES Crystallography files (FullProf, ShelX) |
text |
The CIF format is the IUCr standard format for structure descriptions. The PCR and CFL file formats are used by FullProf and CrysFML. The RES, SHX and INS formats are used by ShelX. Such files can be viewed by DrawXtl, JMol, PyMol, RasMol, Avogadro, GDis, Chimera Yasara | |
MRC/CCP4/IMOD, EZD electron density map |
text(EZD) and binary |
Electron density maps in MRC/CCP4
and EZD
file formats. Can be visualized with PyMol, VMD, Chimera, Yasara, VEDA. |
Yes |
acqus, fid or ser Bruker NMR |
text |
NMR data set from
Bruker/WinNMR |
|
fid, procpar Varian NMR |
binary |
NMR data set from Varian | |
'hdr','jdf' JEOL NMR |
text/binary |
NMR data set from JEOL |
|
'0001','0002'... Bruker FT-IR OPUS |
binary |
FT-IR Bruker OPUS
format |
|
'R*' and 'C*' LLB TAS |
binary |
LLB TAS (1T, 2T, 4F1, 4F2, G43). Experimental. May not be properly
imported. Users are advised to use B. Hennion
conversion tools (convasc, convdat from 'wf'). |
|
DAT |
text |
Quantum
Design VMS ppms/mpms |
|
MS, D, RAW Agilent and Thermo Finnigan MS |
binary |
Agilent Mass Spectrometry/Chromatography
LC/MS GC/MS GC/FID Thermo Finnigan Mass Spectrometry/Chromatography |
|
ENDF TSL DAT Evaluated Nuclear Data File |
text |
ENDF
Evaluated
Nuclear Data File with specific support for the
thermal neutron scattering law (TSL) section (MF7, MT=2 and
4). Can make use of PyNE when
installed. |
|
MCNP ACE A compact ENDF |
text/binary |
ACE MCNP
files ("A Compact ENDF"). Requires PyNE to be installed. |
|
POSCAR |
text |
VASP POSCAR
file for molecular modelling |
>> iData('filename','text format with fast import method')will import the raw content, without post formatting of the object in memory. You will probably need to assign manually some of the Signal and Axes (see iData object help). It may be that the looktxt MeX file is corrupted. Refer to the Changes/Bugs and Install pages.
>> iData('filename','Data (text format)')
>> a=iLoad(filename, 'text', '--catenate','--fast','--headers','--wrapped', ... other options);
where 'text' indicates that the file is not binary encoded,
and any following options is forwarded to the text reader. The
possible options are:Text import option |
Description |
'--catenate' | Catenates similar numerical fields (which have similar dimensions and names. Recommended. |
'--fast' |
When numerical data blocks only use isspace(3) separators (\n \r \f \t \v and space), the reading can be made faster with even lower memory requirements. Recommended. |
'--headers' |
Extracts headers for each numerical field. Recommended. |
'--wrapped' |
Catenates single wrapped output lines with
previous matrices (e.g. caused by the 80 chars per line
limit in old data formats written by fortran codes). Recommended. |
'--section=SEC' |
Classifies fields into sections
matching word SEC. This option can be repeated with
different SEC words. |
'--metadata=META' |
Extracts lines containing word META as user metadata. This option can be repeated with different META items. |
'--makerows=NAME' | When a numerical data block label matching
NAME is found, it is transformed into a row vector. This may
be used for wrapped files (--wrapped option). This
option can be repeatedwith as different NAME tokens. |
'--help' |
Lists all possible options. |
>> iLoad(' ','text','--help')
These options can be specified in the 'options' field of an iLoad
configuration entry (see below). The same options can also be used
when importing directly into an iData object (replace 'iLoad' by
'iData' in the example above).>> iLoad('formats'); % display the list of supported formatsThe configuration file iLoad_ini is stored by default in the
>> iLoad('force'); % force re-read of the configuration file and check importers
[ ifitpath 'Libraries' filesep 'Loaders' filesep 'iLoad_ini' ]and a local copy (which overrides the default) is stored in
prefdirwhen executing
>> iLoad('save');This is where you may add your own customized format definitions. Deleting this file will revert to the default configuration.
% Saved iLoad configuration into /home/farhi/.matlab/R2015a/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. The config.MeX field configures if C/Fortran external interfaces (looktxt, cif2hkl) should be use as MeX or as separate executable files.
>> config = iLoad('config'); % retrieve the iLoad configuration and file loaders (from cache)
>> iLoad('save', config);
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 Loaders/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