geopulse.io
Data I/O: HDF5, GeoJSON, IAGA-2002.
- class geopulse.io.MatpowerGMDCase(source_path, n_dc_nodes, dc_nodes=<factory>, dc_branches=<factory>, bus_latlon=<factory>, ac_bus_kv=<factory>, ac_branches=<factory>)[source]
Bases:
objectStructured contents of a MATPOWER-GMD
.mfile.- Parameters:
- source_path
Path the case was loaded from.
- Type:
- dc_nodes
One entry per DC node, ordered by 1-based row position within
mpc.gmd_bus. Fields:row1-based row index (DC node id used by branches)parent_ac_busAC bus number this DC node groundsstatus1 = in service, 0 = outg_gnd_Sgrounding conductance in Siemensnamehuman name (e.g."dc_sub1")
- dc_branches
DC branches. Fields:
from_row,to_row1-based DC node row indicesparent_ac_branch1-based AC branch index (or 0 for none)status1 in service, 0 outresistance_OhmDC resistancelength_kmgeographic length (km); 0 for xfmr windingsnamehuman name
- ac_branches
AC-side branches, retained for case-configuration helpers (each has
f,t,rateA,ratio,status).
- geopulse.io.read_matpower_gmd(path)[source]
Parse a MATPOWER-GMD
.mfile.- Parameters:
- Return type:
- Returns:
MatpowerGMDCase – Structured case data.
- Raises:
DataError – If the file is missing required blocks (
gmd_bus,gmd_branch,bus,bus_gmd) or has malformed rows.
- geopulse.io.write_results(path, description='', **groups)[source]
Write results to HDF5 with the current schema version.
- Parameters:
- Return type:
Examples
>>> import numpy as np, tempfile, os >>> tmp = tempfile.NamedTemporaryFile(suffix='.h5', delete=False).name >>> write_results(tmp, description="demo", ... source={"time_s": np.arange(10.0)}) >>> data = read_results(tmp) >>> data["source"]["time_s"].shape (10,) >>> os.unlink(tmp)
Modules
GeoJSON reader for network topologies — STUB (WP2). |
|
Schema-versioned HDF5 reader/writer. |
|
IAGA-2002 magnetometer format parser. |
|
MATPOWER-GMD ( |