cfdm.H5netcdfArray¶
-
class
cfdm.
H5netcdfArray
(filename=None, address=None, dtype=None, shape=None, mask=True, unpack=True, attributes=None, storage_options=None, source=None, copy=True)[source]¶ Bases:
cfdm.data.mixin.indexmixin.IndexMixin
,cfdm.data.abstract.filearray.FileArray
A netCDF array accessed with
h5netcdf
.New in version (cfdm): 1.11.2.0
Initialisation
- Parameters
- filename: (sequence of
str
), optional The locations of datasets containing the array.
- address: (sequence of
str
), optional How to find the array in the datasets.
- dtype:
numpy.dtype
, optional The data type of the array. May be
None
if is not known. This may differ from the data type of the array in the datasets.- shape:
tuple
, optional The shape of the dataset array.
- mask:
bool
, optional If True (the default) then mask by convention when reading data from disk.
- unpack:
bool
, optional If True (the default) then unpack by convention when reading data from disk.
- attributes:
dict
orNone
, optional Provide netCDF attributes for the data as a dictionary of key/value pairs.
If attributes is
None
, the default, then the attributes will be set during the first__getitem__
call.- storage_options:
dict
orNone
, optional Key/value pairs to be passed on to the creation of
s3fs.S3FileSystem
file systems to control the opening of files in S3 object stores. Ignored for files not in an S3 object store, i.e. those whose names do not start withs3:
.By default, or if
None
, then storage_options is taken as{}
.If the
'endpoint_url'
key is not in storage_options or is not in a dictionary defined by the'client_kwargs
key (which is always the case when storage_options isNone
), then one will be automatically inserted for accessing an S3 file. For example, for a file name of's3://store/data/file.nc'
, an'endpoint_url'
key with value'https://store'
would be created.- Parameter example:
For a file name of
's3://store/data/file.nc'
, the following are equivalent:None
,{}
, and{'endpoint_url': 'https://store'}
,{'client_kwargs': {'endpoint_url': 'https://store'}}
- Parameter example:
{'key': 'scaleway-api-key...', 'secret': 'scaleway-secretkey...', 'endpoint_url': 'https://s3.fr-par.scw.cloud', 'client_kwargs': {'region_name': 'fr-par'}}
- source: optional
Convert source, which can be any type of object, to a
H5netcdfArray
instance.All other parameters, apart from copy, are ignored and their values are instead inferred from source by assuming that it has the
H5netcdfArray
API. Any parameters that can not be retrieved from source in this way are assumed to have their default value.Note that if
x
is also aH5netcdfArray
instance thencfdm.H5netcdfArray(source=x)
is equivalent tox.copy()
.- copy:
bool
, optional If True (the default) then deep copy the input parameters prior to initialisation. By default the parameters are not deep copied.
- filename: (sequence of
Inspection¶
Methods
Returns the array’s compression type. |
|
|
|
The attributes of the array. |
|
The missing values of the data. |
|
The index to be applied when converting to a |
|
True if the index represents a subspace of the data. |
Attributes
Return an independent numpy array containing the data. |
|
Data-type of the array. |
|
Number of array dimensions. |
|
Shape of the array. |
|
Number of elements in the array. |
|
The shape of the data in the file. |
|
The shape of the data in the file with added dimensions. |
Units¶
Methods
The calendar of the array. |
|
The units of the array. |
Attributes
The |
File¶
Methods
The file directory. |
|
The name of the file containing the array. |
|
Close the dataset containing the data. |
|
Return a dataset file object and address. |
|
The name of the file containing the array. |
|
The netCDF4 group structure of a netCDF variable. |
|
Whether or not to automatically mask the data. |
|
Whether or not to automatically unpack the data. |
|
Return |
|
Replace the file directory. |
|
Replace the file location. |
Miscellaneous¶
Return a deep copy of the array. |
|
Bring data on disk into memory. |
Special¶
Returns a subspace of the data as a new |
Docstring substitutions¶
Methods
Return the special docstring substitutions. |
|
Returns the substitutions that apply to methods of the class. |
|
Returns the class {{package}} substitutions package depth. |
|
Returns method names excluded in the class substitutions. |