fileio/
mg_getdata.pro
includes main-level programRoutines
top mg_getdata
result = mg_getdata(filename, variable [, bounds=lonarr(3, ndims) or string] [, error=long])
Pulls out a section of a variable in a file.
Return value
data array
Parameters
- filename in required type=string
filename of the file
- variable in required type=string
variable name (with path if inside a group)
Keywords
- bounds in optional type=lonarr(3, ndims) or string
gives start value, end value, and stride for each dimension of the variable
- error out optional type=long
error value
Examples
Try the main-level example program at the end of this file:
IDL> .run mg_getdata
MG_GETDATA
:
nc_filename = file_which('sample.nc')
im = mg_getdata(nc_filename, '/image')
title = mg_getdata(nc_filename, '/image.TITLE')
line = mg_getdata(nc_filename, '/image[*, 256]')
h5_filename = filepath('hdf5_test.h5', subdir=['examples', 'data'])
arr3d = mg_getdata(h5_filename, '/arrays/3D int array[3, 5:*:2, 0:49:3]')
File attributes
Modification date: | Wed May 14 15:07:14 2014 |
Lines: | 17 |
Docformat: | rst rst |
Contact me if you have enhancement requests or bug fixes.