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.|u1refers touint8and<u2refers to little-endianuint16. Full details are available in the NumPy documentation.fortran_order: a boolean that istrueif 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 |
|---|