@earthyscience/netcdf4-wasm 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -219
- package/dist/netcdf-worker.js +10 -3
- package/dist/netcdf-worker.js.map +1 -1
- package/dist/netcdf4-wasm.wasm +0 -0
- package/package.json +2 -4
package/README.md
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
# netcdf4-wasm
|
|
2
2
|
|
|
3
|
-
NetCDF4 library
|
|
3
|
+
Partial compilation of NetCDF4 library to WebAssembly with TypeScript bindings.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
This project provides a
|
|
7
|
+
This project provides a partial WebAssembly port of the NetCDF4 C library, enabling NetCDF file operations in browser and Node.js environments. It includes:
|
|
8
8
|
|
|
9
|
-
-
|
|
9
|
+
- A partial NetCDF4 C library compiled to WASM using Emscripten
|
|
10
10
|
- High-level TypeScript/JavaScript API
|
|
11
11
|
- Support for reading and writing NetCDF4 files
|
|
12
|
-
- Comprehensive test suite
|
|
13
12
|
|
|
14
13
|
## Installation
|
|
15
14
|
|
|
16
15
|
```bash
|
|
17
|
-
npm install netcdf4-wasm
|
|
16
|
+
npm install @earthyscience/netcdf4-wasm
|
|
18
17
|
```
|
|
19
18
|
|
|
20
19
|
## Prerequisites
|
|
@@ -44,222 +43,24 @@ The JavaScript API is modeled closely on the [netcdf4-python](https://unidata.gi
|
|
|
44
43
|
|
|
45
44
|
### Basic Example
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
import { Dataset } from "netcdf4-wasm";
|
|
49
|
-
// or: import { NetCDF4 } from 'netcdf4-wasm';
|
|
50
|
-
|
|
51
|
-
async function example() {
|
|
52
|
-
// Create a new NetCDF file (similar to Python netCDF4.Dataset)
|
|
53
|
-
const nc = await Dataset("example.nc", "w", { format: "NETCDF4" });
|
|
54
|
-
// or: const nc = await NetCDF4.Dataset('example.nc', 'w', { format: 'NETCDF4' });
|
|
55
|
-
|
|
56
|
-
// Create dimensions
|
|
57
|
-
const lat = await nc.createDimension("lat", 73);
|
|
58
|
-
const lon = await nc.createDimension("lon", 144);
|
|
59
|
-
const time = await nc.createDimension("time", null); // unlimited dimension
|
|
60
|
-
|
|
61
|
-
// Create variables
|
|
62
|
-
const temp = await nc.createVariable("temperature", "f4", [
|
|
63
|
-
"time",
|
|
64
|
-
"lat",
|
|
65
|
-
"lon",
|
|
66
|
-
]);
|
|
67
|
-
const times = await nc.createVariable("time", "f8", ["time"]);
|
|
68
|
-
|
|
69
|
-
// Set variable attributes
|
|
70
|
-
temp.units = "Kelvin";
|
|
71
|
-
temp.long_name = "surface temperature";
|
|
72
|
-
times.units = "hours since 0001-01-01 00:00:00.0";
|
|
73
|
-
times.calendar = "gregorian";
|
|
74
|
-
|
|
75
|
-
// Set global attributes
|
|
76
|
-
nc.setncattr("description", "bogus example script");
|
|
77
|
-
nc.setncattr("history", "Created " + new Date().toISOString());
|
|
78
|
-
nc.setncattr("source", "netCDF4-wasm example");
|
|
79
|
-
|
|
80
|
-
// Write data
|
|
81
|
-
const tempData = new Float64Array(73 * 144);
|
|
82
|
-
tempData.fill(288.0); // Fill with 288K
|
|
83
|
-
await temp.setValue(tempData);
|
|
84
|
-
|
|
85
|
-
// Close the file
|
|
86
|
-
await nc.close();
|
|
87
|
-
}
|
|
88
|
-
```
|
|
46
|
+
- WIP
|
|
89
47
|
|
|
90
48
|
### Reading Files
|
|
91
49
|
|
|
92
|
-
|
|
93
|
-
import { Dataset } from "netcdf4-wasm";
|
|
94
|
-
|
|
95
|
-
async function readExample() {
|
|
96
|
-
// Open existing file for reading
|
|
97
|
-
const nc = await Dataset("data.nc", "r");
|
|
98
|
-
|
|
99
|
-
// Access dimensions
|
|
100
|
-
console.log("Dimensions:", Object.keys(nc.dimensions));
|
|
101
|
-
console.log("Time dimension size:", nc.dimensions.time.size);
|
|
102
|
-
|
|
103
|
-
// Access variables
|
|
104
|
-
console.log("Variables:", Object.keys(nc.variables));
|
|
105
|
-
const temp = nc.variables.temperature;
|
|
106
|
-
|
|
107
|
-
// Read variable attributes
|
|
108
|
-
console.log("Temperature units:", temp.units);
|
|
109
|
-
console.log("Temperature long name:", temp.long_name);
|
|
110
|
-
|
|
111
|
-
// Read data
|
|
112
|
-
const data = await temp.getValue();
|
|
113
|
-
console.log("Temperature data shape:", data.length);
|
|
114
|
-
console.log("First few values:", data.slice(0, 5));
|
|
115
|
-
|
|
116
|
-
// Access global attributes
|
|
117
|
-
console.log("Global attributes:", nc.ncattrs());
|
|
118
|
-
console.log("Description:", nc.getncattr("description"));
|
|
119
|
-
|
|
120
|
-
await nc.close();
|
|
121
|
-
}
|
|
122
|
-
```
|
|
50
|
+
- WIP
|
|
123
51
|
|
|
124
52
|
### Alternative Constructor (Direct Instantiation)
|
|
125
53
|
|
|
126
|
-
|
|
127
|
-
import { NetCDF4 } from "netcdf4-wasm";
|
|
128
|
-
|
|
129
|
-
async function directExample() {
|
|
130
|
-
// Direct instantiation (requires manual initialization)
|
|
131
|
-
const nc = new NetCDF4("example.nc", "w", { format: "NETCDF4" });
|
|
132
|
-
await nc.initialize();
|
|
133
|
-
|
|
134
|
-
// Use same API as above...
|
|
135
|
-
const lat = await nc.createDimension("lat", 10);
|
|
136
|
-
const temp = await nc.createVariable("temperature", "f8", ["lat"]);
|
|
137
|
-
|
|
138
|
-
await nc.close();
|
|
139
|
-
}
|
|
140
|
-
```
|
|
54
|
+
- WIP
|
|
141
55
|
|
|
142
56
|
### Working with Groups
|
|
143
57
|
|
|
144
|
-
|
|
145
|
-
async function groupExample() {
|
|
146
|
-
const nc = await Dataset("grouped.nc", "w", { format: "NETCDF4" });
|
|
147
|
-
|
|
148
|
-
// Create a group
|
|
149
|
-
const forecasts = nc.createGroup("forecasts");
|
|
150
|
-
|
|
151
|
-
// Create dimensions and variables in the group
|
|
152
|
-
const time = await forecasts.createDimension("time", 24);
|
|
153
|
-
const temp = await forecasts.createVariable("temperature", "f4", ["time"]);
|
|
154
|
-
|
|
155
|
-
// Set group attributes
|
|
156
|
-
forecasts.setncattr("description", "Forecast data");
|
|
157
|
-
|
|
158
|
-
await nc.close();
|
|
159
|
-
}
|
|
160
|
-
```
|
|
58
|
+
- WIP
|
|
161
59
|
|
|
162
60
|
## API Reference
|
|
163
61
|
|
|
164
62
|
The API closely follows netcdf4-python conventions for ease of use by scientists familiar with Python.
|
|
165
63
|
|
|
166
|
-
### Classes
|
|
167
|
-
|
|
168
|
-
#### `NetCDF4`
|
|
169
|
-
|
|
170
|
-
Main class for NetCDF file operations, similar to `netCDF4.Dataset` in Python.
|
|
171
|
-
|
|
172
|
-
**Constructor**
|
|
173
|
-
|
|
174
|
-
```typescript
|
|
175
|
-
new NetCDF4(filename?: string, mode?: string, options?: NetCDF4WasmOptions)
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
**Static Methods**
|
|
179
|
-
|
|
180
|
-
- `NetCDF4.Dataset(filename: string, mode?: string, options?: object): Promise<NetCDF4>` - Factory method (Python-like)
|
|
181
|
-
|
|
182
|
-
**Module Functions**
|
|
183
|
-
|
|
184
|
-
- `Dataset(filename: string, mode?: string, options?: object): Promise<NetCDF4>` - Convenience function (import directly)
|
|
185
|
-
|
|
186
|
-
**Properties**
|
|
187
|
-
|
|
188
|
-
- `dimensions: {[name: string]: Dimension}` - Dictionary of dimensions
|
|
189
|
-
- `variables: {[name: string]: Variable}` - Dictionary of variables
|
|
190
|
-
- `groups: {[name: string]: Group}` - Dictionary of groups
|
|
191
|
-
- `file_format: string` - File format (e.g., 'NETCDF4')
|
|
192
|
-
- `filepath: string` - Path to the file
|
|
193
|
-
- `isopen: boolean` - Whether file is currently open
|
|
194
|
-
|
|
195
|
-
**Methods**
|
|
196
|
-
|
|
197
|
-
_File Operations_
|
|
198
|
-
|
|
199
|
-
- `initialize(): Promise<void>` - Initialize the WASM module
|
|
200
|
-
- `close(): Promise<void>` - Close the file
|
|
201
|
-
- `sync(): Promise<void>` - Flush data to disk
|
|
202
|
-
|
|
203
|
-
_Structure Definition_
|
|
204
|
-
|
|
205
|
-
- `createDimension(name: string, size: number): Promise<Dimension>` - Create dimension
|
|
206
|
-
- `createVariable(name: string, datatype: string, dimensions: string[], options?: object): Promise<Variable>` - Create variable
|
|
207
|
-
- `createGroup(name: string): Group` - Create hierarchical group
|
|
208
|
-
|
|
209
|
-
_Attribute Access_
|
|
210
|
-
|
|
211
|
-
- `setncattr(name: string, value: any): void` - Set global attribute
|
|
212
|
-
- `getncattr(name: string): any` - Get global attribute
|
|
213
|
-
- `ncattrs(): string[]` - List all global attributes
|
|
214
|
-
|
|
215
|
-
#### `Variable`
|
|
216
|
-
|
|
217
|
-
Represents a NetCDF variable, similar to Python's Variable class.
|
|
218
|
-
|
|
219
|
-
**Properties**
|
|
220
|
-
|
|
221
|
-
- `name: string` - Variable name
|
|
222
|
-
- `datatype: string` - Data type ('f4', 'f8', 'i4', etc.)
|
|
223
|
-
- `dimensions: string[]` - Dimension names
|
|
224
|
-
- `units: string` - Units attribute (convenience property)
|
|
225
|
-
- `long_name: string` - Long name attribute (convenience property)
|
|
226
|
-
- `standard_name: string` - Standard name attribute (convenience property)
|
|
227
|
-
|
|
228
|
-
**Methods**
|
|
229
|
-
|
|
230
|
-
- `getValue(): Promise<Float64Array>` - Read variable data
|
|
231
|
-
- `setValue(data: Float64Array): Promise<void>` - Write variable data
|
|
232
|
-
- `setncattr(name: string, value: any): void` - Set variable attribute
|
|
233
|
-
- `getncattr(name: string): any` - Get variable attribute
|
|
234
|
-
- `ncattrs(): string[]` - List variable attributes
|
|
235
|
-
|
|
236
|
-
#### `Dimension`
|
|
237
|
-
|
|
238
|
-
Represents a NetCDF dimension.
|
|
239
|
-
|
|
240
|
-
**Properties**
|
|
241
|
-
|
|
242
|
-
- `name: string` - Dimension name
|
|
243
|
-
- `size: number` - Dimension size
|
|
244
|
-
- `isUnlimited: boolean` - Whether dimension is unlimited
|
|
245
|
-
|
|
246
|
-
**Methods**
|
|
247
|
-
|
|
248
|
-
- `__len__(): number` - Get dimension size (Python-like)
|
|
249
|
-
|
|
250
|
-
### Constants
|
|
251
|
-
|
|
252
|
-
The `NC_CONSTANTS` object provides NetCDF constants:
|
|
253
|
-
|
|
254
|
-
```typescript
|
|
255
|
-
NC_CONSTANTS.NC_NOERR; // No error
|
|
256
|
-
NC_CONSTANTS.NC_NOWRITE; // Read-only access
|
|
257
|
-
NC_CONSTANTS.NC_WRITE; // Write access
|
|
258
|
-
NC_CONSTANTS.NC_CLOBBER; // Overwrite existing file
|
|
259
|
-
NC_CONSTANTS.NC_NETCDF4; // NetCDF4 format
|
|
260
|
-
NC_CONSTANTS.NC_DOUBLE; // Double data type
|
|
261
|
-
NC_CONSTANTS.NC_UNLIMITED; // Unlimited dimension
|
|
262
|
-
```
|
|
263
64
|
|
|
264
65
|
## Building
|
|
265
66
|
|
|
@@ -324,6 +125,8 @@ netcdf4-wasm/
|
|
|
324
125
|
│ ├── types.ts # Type definitions
|
|
325
126
|
│ ├── constants.ts # NetCDF constants
|
|
326
127
|
│ ├── netcdf4.ts # Main NetCDF4 class
|
|
128
|
+
│ ├── netcdf-workers.ts
|
|
129
|
+
│ ├── netcdf-getters.ts
|
|
327
130
|
│ ├── group.ts # Group class
|
|
328
131
|
│ ├── variable.ts # Variable class
|
|
329
132
|
│ ├── dimension.ts # Dimension class
|
|
@@ -341,18 +144,6 @@ netcdf4-wasm/
|
|
|
341
144
|
└── package.json
|
|
342
145
|
```
|
|
343
146
|
|
|
344
|
-
### Contributing
|
|
345
|
-
|
|
346
|
-
1. Fork the repository
|
|
347
|
-
2. Create a feature branch
|
|
348
|
-
3. Make your changes
|
|
349
|
-
4. Add tests for new functionality
|
|
350
|
-
5. Run the test suite
|
|
351
|
-
6. Submit a pull request
|
|
352
|
-
|
|
353
|
-
## License
|
|
354
|
-
|
|
355
|
-
MIT License - see LICENSE file for details.
|
|
356
147
|
|
|
357
148
|
## NetCDF4 Documentation
|
|
358
149
|
|
package/dist/netcdf-worker.js
CHANGED
|
@@ -11,10 +11,17 @@ const waitForModule = new Promise(async (resolve) => {
|
|
|
11
11
|
// Use the imported module factory
|
|
12
12
|
netcdfModule = await createNetCDF4Module({
|
|
13
13
|
locateFile: (file) => {
|
|
14
|
-
|
|
14
|
+
console.log('[locateFile] file:', file);
|
|
15
15
|
if (file.endsWith('.wasm')) {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const origin = self.location.origin;
|
|
17
|
+
console.log('[locateFile] origin:', origin);
|
|
18
|
+
const basePath = process.env.NEXT_PUBLIC_BASE_PATH ?? '';
|
|
19
|
+
console.log('[locateFile] basePath:', basePath);
|
|
20
|
+
const resolved = `${origin}${basePath}/${file}`;
|
|
21
|
+
console.log('[locateFile] resolved WASM URL:', resolved);
|
|
22
|
+
return resolved;
|
|
23
|
+
}
|
|
24
|
+
console.log('[locateFile] returning unchanged:', file);
|
|
18
25
|
return file;
|
|
19
26
|
}
|
|
20
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"netcdf-worker.js","sourceRoot":"","sources":["../src/netcdf-worker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,IAAI,YAA8B,CAAC;AACnC,IAAI,GAAkB,CAAC;AAEvB,kCAAkC;AAClC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IAClE,0DAA0D;IAC1D,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;IACxD,MAAM,mBAAmB,GAAG,aAAa,CAAC,OAAuD,CAAC;IAElG,kCAAkC;IAClC,YAAY,GAAG,MAAM,mBAAmB,CAAC;QACrC,UAAU,EAAE,CAAC,IAAY,
|
|
1
|
+
{"version":3,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O,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,iBAAiB,IAAI,IAAI,EAAE,GAAG,CAAC,CAAC;QAC9C,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;AACL,CAAC,CAAC"}
|
package/dist/netcdf4-wasm.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earthyscience/netcdf4-wasm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Partial compilation of NetCDF4 library to WebAssembly with TypeScript bindings",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,11 +15,9 @@
|
|
|
15
15
|
"build": "npm run build:wasm && npm run build:js",
|
|
16
16
|
"build:wasm": "bash scripts/build-wasm.sh",
|
|
17
17
|
"build:js": "tsc",
|
|
18
|
-
|
|
19
|
-
|
|
20
18
|
"lint": "echo 'Linting not configured yet'",
|
|
21
19
|
"typecheck": "tsc --noEmit",
|
|
22
|
-
"prepublishOnly": "
|
|
20
|
+
"prepublishOnly": "npm run install-emscripten && npm run build",
|
|
23
21
|
"install-emscripten": "bash scripts/install-emscripten.sh",
|
|
24
22
|
"check-deps": "bash scripts/check-dependencies.sh"
|
|
25
23
|
},
|