Skip to content

Commit 1aa5507

Browse files
committed
refactor v2 code
1 parent 21e72c6 commit 1aa5507

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

docs/read.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
# Hdf5JavaLib: Read Capabilities (Version 0.2.1)
1+
# Hdf5JavaLib: Read Capabilities (Version 0.3.0)
22

3-
Hdf5JavaLib is a pure Java library for reading HDF5 files, released as version 0.2.1. This guide helps users read datasets in the root group using examples from the `org.hdf5javalib.examples.read` package. The library reads HDF5 files generated by the C++ HDF5 library, supporting compound datasets, multi-dimensional data, and various datatypes. New in version 0.2.1: enhanced sequential and parallel streaming, array flattening, slicing, reducing along axes, filtering with coordinate lists, and custom type converters for compound datasets.
3+
Hdf5JavaLib is a pure Java library for reading HDF5 files, released as version 0.3.0. This guide helps users read datasets in the root group using examples from the `org.hdf5javalib.examples.read` package. The library reads HDF5 files generated by the C++ HDF5 library, supporting compound datasets, multi-dimensional data, and various datatypes. Version 0.3.0 and higher should support all hdf5 files.
44

55
## Setup
66

77
### Add the Dependency
88

9-
Add Hdf5JavaLib to your project via [Maven Central](https://search.maven.org/artifact/org.hdf5javalib/hdf5javalib/0.2.1/jar):
9+
Add Hdf5JavaLib to your project via [Maven Central](https://search.maven.org/artifact/org.hdf5javalib/hdf5javalib/0.3.0/jar):
1010

1111
```xml
1212
<dependency>
1313
<groupId>org.hdf5javalib</groupId>
1414
<artifactId>hdf5javalib</artifactId>
15-
<version>0.2.1</version>
15+
<version>0.3.0</version>
1616
</dependency>
1717
```
1818

1919
### Requirements
2020
- Java 17 or higher.
21-
- No external HDF5 dependencies.
21+
- Runtime support for org.slf4j, automatically included in springboot projects or link in slf4j-api and logback runtimes.
22+
- No external HDF5 dependencies required.
2223

2324
### Alternative: Build from Source
2425
1. Clone the repository:
@@ -38,7 +39,7 @@ Add Hdf5JavaLib to your project via [Maven Central](https://search.maven.org/art
3839

3940
## Read Capabilities
4041

41-
Hdf5JavaLib supports reading datasets in the root group (`/`), including:
42+
Hdf5JavaLib supports full dataset and group paths, for example reading datasets in the root group (`/`) or subgroups ('/G1/DS1'), including:
4243
- **Compound Datasets**: Structured data with fields like integers, strings, floats, and nested compounds (e.g., `CompoundData` with `fixed_point`, `floating_point`). Supports mapping to custom Java classes or records with custom type converters.
4344
- **Scalar Datasets**: Single values (e.g., fixed-point, floating-point, strings).
4445
- **Vector Datasets**: 1D arrays (e.g., strings, integers).
@@ -60,6 +61,8 @@ Hdf5JavaLib supports reading datasets in the root group (`/`), including:
6061
- **Metadata**: Partial support for SNODs (symbol table nodes).
6162
- **Streaming**: Sequential and parallel streaming for efficient data processing, with Spliterators for all dataset types.
6263
- **Advanced Operations**: Array flattening, dimensional slicing, reduction along axes, and filtering with coordinate lists via `FlattenedArrayUtils`.
64+
- **V1** and **V2**: Version 1 and 2 hdf file structures.
65+
- **NASA**: Tested against at least 2 actual NASA datafiles, `ATL03_20250302235544_11742607_007_01.h5` and `ATL03_20250302235544_11742607_006_01.h5`, found at [https://nsidc.org/data/atl03/versions/5](https://nsidc.org/data/atl03/versions/5)
6366

6467
## Usage
6568

hdf5/notes.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
java -cp target\hdf5javalib-0.2.2-SNAPSHOT.jar;C:\Users\karln\.m2\repository\org\slf4j\log4j-over-slf4j\2.0.6\log4j-over-slf4j-2.0.6.jar;C:\Users\karln\.m2\repository\org\slf4j\slf4j-api\2.0.6\slf4j-api-2.0.6.jar;C:\Users\karln\.m2\repository\org\slf4j\slf4j-simple\2.0.6\slf4j-simple-2.0.6.jar org.hdf5javalib.examples.hdf5examples.HDF5Debug > ex.out
22

3+
java -cp target\hdf5javalib-0.2.2-SNAPSHOT.jar;C:\Users\karnicho\.m2\repository\org\slf4j\slf4j-api\2.0.17\slf4j-api-2.0.17.jar;C:\Users\karnicho\.m2\repository\ch\qos\logback\logback-classic\1.5.18\logback-classic-1.5.18.jar;C:\Users\karnicho\.m2\repository\ch\qos\logback\logback-core\1.5.18\logback-core-1.5.18.jar org.hdf5javalib.examples.hdf5examples.HDF5Debug > ex.out
4+
5+
java -cp target\hdf5javalib-0.2.2-SNAPSHOT.jar;C:\Users\karnicho\.m2\repository\org\slf4j\slf4j-api\2.0.17\slf4j-api-2.0.17.jar org.hdf5javalib.examples.hdf5examples.HDF5Debug > ex.out
36

47
The HDF5Examples repository (or directory in the HDF5 source distribution) contains code samples demonstrating how to use the HDF5 library across various programming languages. Below, I'll explain the purpose of the specified directories based on their structure and contents. Note that the examples are practical code snippets (e.g., .c files) that compile and run to illustrate specific HDF5 API features.
58

src/main/java/org/hdf5javalib/examples/hdf5examples/HDF5Debug.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ private void run() {
4747
// List all .h5 files in HDF5Examples resources directory
4848
// ATL03_20250302235544_11742607_006_01
4949
// Path dirPath = Paths.get(Objects.requireNonNull(HDF5Debug.class.getClassLoader().getResource("HDF5Examples/h5ex_g_compact2.h5")).toURI());
50-
// Path dirPath = Paths.get("c:/users/karln/Downloads/ATL03_20250302235544_11742607_007_01.h5");
51-
Path dirPath = Paths.get("c:/users/karln/Downloads/ATL03_20250302235544_11742607_006_01.h5");
50+
// Path dirPath = Paths.get("c:/users/karnicho/Downloads/ATL03_20250302235544_11742607_007_01.h5");
51+
Path dirPath = Paths.get("c:/users/karnicho/Downloads/ATL03_20250302235544_11742607_006_01.h5");
5252
processFile(dirPath);
5353
} catch (Exception e) {
5454
throw new IllegalStateException(e);

0 commit comments

Comments
 (0)