NPYLoader
The NPYLoader
parses an array from the NPY format, a lightweight encoding of multidimensional arrays used by the Python NumPy library.
Loader | Characteristic |
---|---|
File Extension | .npy |
File Type | Binary |
File Format | Array |
Data Format | Array |
Supported APIs | load , parse , parseSync |
Decoder Type | Synchronous |
Worker Thread Support | Yes |
Streaming Support | No |
Usage
import {_NPYLoader} from '@loaders.gl/textures';
import {load} from '@loaders.gl/core';
const {data, header} = await load(url, _NPYLoader);
data
is a TypedArray containing the array's data.
header
is an object with three keys:
descr
: a string describing the data type. E.g.|u1
refers touint8
and<u2
refers to little-endianuint16
. Full details are available in the NumPy documentation.fortran_order
: a boolean that istrue
if the array is stored in Fortran order instead of C order.shape
: an array of integers that describes the shape of the array. The length of the array corresponds to the number of dimensions of the array.
Options
Currently no options are supported for this loader.
Option | Type | Default | Description |
---|