load

From DavinciWiki
(Difference between revisions)
Jump to: navigation, search
(Fix errors, typos, missing info, make consistent with read, remove reference to nonexistent import)
 
Line 6: Line 6:
 
Return Value: The appropriate data array
 
Return Value: The appropriate data array
 
|
 
|
[[Syntax]]: load(filename = STRING [, record = INT] [, xlow = INT] [, xhigh = INT] [, xskip = INT] [, ylow = INT] [, yhigh = INT] [, yskip = INT] [, zlow = INT] [, zhigh = INT] [, zskip = INT]))
+
[[Syntax]]: load(filename = STRING [, record = INT] [, xlow = INT] [, xhigh = INT] [, xskip = INT] [, ylow = INT] [, yhigh = INT] [, yskip = INT] [, zlow = INT] [, zhigh = INT] [, zskip = INT])
 
    
 
    
The load() function loads the specified data file.  The read() function can automatically recognize and load the following file formats:
+
The load() function loads the specified data file.  The load() function can automatically recognize and load the following file formats:
 
*SpecPR_FS2
 
*SpecPR_FS2
 
*VICAR
 
*VICAR
Line 18: Line 18:
 
*AVIRIS
 
*AVIRIS
 
*GIF, JPEG, TIFF, PNG, BMP
 
*GIF, JPEG, TIFF, PNG, BMP
*[[hdf|HDF5]]
+
*[[HDF|HDF5]]
 +
*GDB (DV version 1.58)
 +
*ENVI (DV version 1.59)
 
   
 
   
 
If the specified path is not absolute (ie: it doesn't start with a '/'), and the specified file cannot be found in the current directory, the DATAPATH variable is used as a list of directories to additionally search. The specified path is appended to each directory listed in the DATAPATH variable.
 
If the specified path is not absolute (ie: it doesn't start with a '/'), and the specified file cannot be found in the current directory, the DATAPATH variable is used as a list of directories to additionally search. The specified path is appended to each directory listed in the DATAPATH variable.
 
   
 
   
 +
Additionally you can now load remote files using any common URL format (e.g. http,https,ftp,ftps,file).
 +
 
If the variable VERBOSE is set to a value greater than zero, details of the file loading process are printed to stderr.  Higher values (up to 3)produce more output.
 
If the variable VERBOSE is set to a value greater than zero, details of the file loading process are printed to stderr.  Higher values (up to 3)produce more output.
 
   
 
   
Line 28: Line 32:
 
The values low, high and skip can be specified for each axis (ie: xlow, zhigh, etc) to specify a precise subset to be read.  All the subsetting arguments are optional.
 
The values low, high and skip can be specified for each axis (ie: xlow, zhigh, etc) to specify a precise subset to be read.  All the subsetting arguments are optional.
 
   
 
   
Reading a PPM image produces a 3-plane, BIP cube of byte values. Each plane represents the red, green and blue values respectivly.
+
Reading a PPM image produces a 3-plane, BIP cube of byte values. Each plane represents the red, green and blue values respectively.
 
   
 
   
The functions load() and [[import]]() are aliases for the [[read]]() function.
+
The function [[read]]() is an alias for the load() function.
 
|
 
|
 +
Local file load:
 
  dv> a=load("/work/knowicki/I01002002.project.00082523.QUB")
 
  dv> a=load("/work/knowicki/I01002002.project.00082523.QUB")
 
  ..........1356x7100x10 array of float, bsq format [385,104,000 bytes]
 
  ..........1356x7100x10 array of float, bsq format [385,104,000 bytes]
 +
 +
Remote URL load:
 +
dv> a=load("http://www.mars.asu.edu/data/tes_ti/small/tes_ti.png")
 +
Downloading...................done.
 +
......................................................
 +
/tmp/dv_27072/5y5R2h: bip PNG image: 2725x1779x1, 8 bits
 +
2725x1779x1 array of byte, bip format [4,847,775 bytes]
 
|
 
|
 
|
 
|
 
|
 
|
 
*[[read]]
 
*[[read]]
*[[import]]
 
 
*[[write]]
 
*[[write]]
 
|
 
|

Latest revision as of 10:44, 14 April 2016



Description

Load data from a file

Arguments and Return Values

Arguments: A string containing the path of file to be loaded

Return Value: The appropriate data array

Usage

Syntax: load(filename = STRING [, record = INT] [, xlow = INT] [, xhigh = INT] [, xskip = INT] [, ylow = INT] [, yhigh = INT] [, yskip = INT] [, zlow = INT] [, zhigh = INT] [, zskip = INT])

The load() function loads the specified data file. The load() function can automatically recognize and load the following file formats:

  • SpecPR_FS2
  • VICAR
  • PDS/ISIS Qube and Image
  • PBMPlus: PBM, PGM and PPM formats
  • USGS GRD
  • Imath
  • GOES weather satellite
  • AVIRIS
  • GIF, JPEG, TIFF, PNG, BMP
  • HDF5
  • GDB (DV version 1.58)
  • ENVI (DV version 1.59)

If the specified path is not absolute (ie: it doesn't start with a '/'), and the specified file cannot be found in the current directory, the DATAPATH variable is used as a list of directories to additionally search. The specified path is appended to each directory listed in the DATAPATH variable.

Additionally you can now load remote files using any common URL format (e.g. http,https,ftp,ftps,file).

If the variable VERBOSE is set to a value greater than zero, details of the file loading process are printed to stderr. Higher values (up to 3)produce more output.

The record value is required for SpecPR files. If it is given with another file type, it is used as the high and low value for a Z axis subset, causing a single image to be extracted from cubes.

The values low, high and skip can be specified for each axis (ie: xlow, zhigh, etc) to specify a precise subset to be read. All the subsetting arguments are optional.

Reading a PPM image produces a 3-plane, BIP cube of byte values. Each plane represents the red, green and blue values respectively.

The function read() is an alias for the load() function.

Examples

Local file load:

dv> a=load("/work/knowicki/I01002002.project.00082523.QUB")
..........1356x7100x10 array of float, bsq format [385,104,000 bytes]

Remote URL load:

dv> a=load("http://www.mars.asu.edu/data/tes_ti/small/tes_ti.png")
Downloading...................done.
......................................................
/tmp/dv_27072/5y5R2h: bip PNG image: 2725x1779x1, 8 bits
2725x1779x1 array of byte, bip format [4,847,775 bytes]

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Related Functions

Recent Core Changes

Modified On: 04-14-2016

Personal tools