propagator.io
The propagator.io package wraps raster loading routines and writer utilities
used by both the CLI and programmatic workflows. The sections below surface the
public classes and protocols that are exported via propagator.io.__all__.
Public Shortcuts
propagator.io
PropagatorDataFromTiles(base_path, mid_lat, mid_lon, grid_dim, tileset=DEFAULT_TILES_TAG)
dataclass
Bases: PropagatorInputDataProtocol
load_tile(zone_number, var, tile_i, tile_j, tileset=DEFAULT_TILES_TAG)
Load a tile from the data directory, either as a .mat or .tif file. :param zone_number: UTM zone number :param var: Variable name (e.g., "quo" or "prop") :param tile_i: Tile index in the i direction :param tile_j: Tile index in the j direction :param tileset: Tileset name (default is "tiles")
load_tile_ref(zone_number, var, tileset=DEFAULT_TILES_TAG)
Load the reference file for the zone, which contains metadata such as step size and tile dimensions. :param zone_number: UTM zone number :param var: Variable name (e.g., "quo" or "prop") :param tileset: Tileset name
Loaders
propagator.io.loader.protocol
propagator.io.loader.geotiff
propagator.io.loader.tiles
PropagatorDataFromTiles(base_path, mid_lat, mid_lon, grid_dim, tileset=DEFAULT_TILES_TAG)
dataclass
Bases: PropagatorInputDataProtocol
load_tile(zone_number, var, tile_i, tile_j, tileset=DEFAULT_TILES_TAG)
Load a tile from the data directory, either as a .mat or .tif file. :param zone_number: UTM zone number :param var: Variable name (e.g., "quo" or "prop") :param tile_i: Tile index in the i direction :param tile_j: Tile index in the j direction :param tileset: Tileset name (default is "tiles")
load_tile_ref(zone_number, var, tileset=DEFAULT_TILES_TAG)
Load the reference file for the zone, which contains metadata such as step size and tile dimensions. :param zone_number: UTM zone number :param var: Variable name (e.g., "quo" or "prop") :param tileset: Tileset name
Writers
propagator.io.writer.protocol
propagator.io.writer.raster_geotiff
write_geotiff(filename, values, dst_trans, dst_crs, dtype=np.uint8, compression='deflate')
Write a single-band GeoTIFF with provided transform and CRS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str or Path
|
Output GeoTIFF file path. |
required |
values
|
ndarray
|
2D array of raster values. |
required |
dst_trans
|
Affine
|
Affine transform for the raster. |
required |
dst_crs
|
CRS
|
Coordinate reference system. |
required |
dtype
|
DTypeLike
|
Data type for output raster, by default np.uint8. |
uint8
|
compression
|
str
|
Compression type for GeoTIFF (e.g., "deflate", "lzw"), by default "deflate". |
'deflate'
|
propagator.io.writer.metadata_json
propagator.io.writer.isochrones_geojson
smooth_linestring(linestring, smooth_sigma)
Uses a gauss filter to smooth out the LineString coordinates.
extract_isochrone(values, transf, thresholds=[0.5, 0.75, 0.9], med_filt_val=9, min_length=0.0001, smooth_sigma=0.8, simp_fact=1e-05)
extract isochrone from the propagation probability map values at the probanilities thresholds, applying filtering to smooth out the result :param values: :param transf: :param thresholds: :param med_filt_val: :param min_length: :param smooth_sigma: :param simp_fact: :return: