Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ build-backend = "setuptools.build_meta"
name = "mtmhdf"
description = "imutum's packages for HDF"
readme = "README.md"
license = { file = "LICENSE" }
license = "MIT"
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.11",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

3 changes: 2 additions & 1 deletion tests/test_grid2dreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

if __name__ == "__main__":

grid2dreader = Grid2DReader("tests\data\MOD021KM_L.1000.2015001004500.H27V04.000000.nc", do_grid_surround=False)
grid2dreader = Grid2DReader("tests\data\MOD021KM_L.1000.2015001004500.H27V04.000000.nc", do_grid_surround=True)
print(grid2dreader.keys())
dp = grid2dreader.read("/GeometricCorrection/DataSet_1000_5")
print(data:=dp[-1:1202, -1:1202])
print(data:=dp[:])
print(data.shape)
1 change: 1 addition & 0 deletions tests/test_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ def __getitem__(self, item) -> np.ma.MaskedArray | np.ndarray:
grid_size = 1200
test = TestSlice(grid_size)
test[-5:1202, -5:1202]
test[:]
18 changes: 18 additions & 0 deletions tests/test_writer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from netCDF4 import Dataset
import numpy as np
from mtmhdf.reader import HDF5Reader
from mtmhdf._hdf5 import HDF5
path = "test_writer.nc"

x = np.random.rand(100, 100)
x = x.astype(np.float32)
x[1, :] = np.nan

print(x)
with Dataset(path, "w", format="NETCDF4") as fp:
HDF5.write(fp, x, "x", ("t", "p"), "uint16", scale_factor=0.0001)

y = HDF5Reader(path).read("x")[:]
print(y)
print(y.data)
print(y.fill_value)
Loading
Loading