This page lists the public classes and functions of GeoLattice 0.3.49, grouped by area and by the module you import them from, with the first sentence of each docstring. Use help(name) in Python, or the user guide, for parameters and worked examples. Every subpackage is available after import geolattice (for example geolattice.raster.clip), and each object is listed once, under its shortest public import path.
The page is generated by docs/make_api_reference.py from the installed package (2,302 classes and functions). Rebuild it after changing the public API:
python docs/make_api_reference.pyContents
- Top-level package (5)
- Coordinate reference systems (17)
- Core types (7)
- Vector data (103)
- Raster data (63)
- Spatial analysis (293)
- Spatial statistics (247)
- Geostatistics (177)
- Spatial databases (10)
- Web and cloud GIS (26)
- Remote sensing (1197)
- Visualization (40)
- Distributed and GPU computing (98)
- Compute backends (5)
- WhiteboxTools (9)
- Networks, point clouds and STAC (3)
- Installation options (2)
- Aliases
Top-level package
Readers, compute backends and configuration available after import geolattice.
Exports
Functions
| Name | Description |
|---|---|
geolattice.cpu_backend |
Context manager to temporarily use CPU backend. |
geolattice.gpu_backend |
Context manager to temporarily use GPU backend. |
geolattice.read_pointcloud |
Read point cloud data from file. |
geolattice.read_raster |
Read raster data from file. |
geolattice.read_vector |
Read vector data from file. |
Coordinate reference systems
Search EPSG and ESRI codes, define custom projections, choose datum transformations.
import geolattice.crs
Functions and classes
Classes
| Name | Description |
|---|---|
geolattice.crs.AreaOfUse |
Geographic area where a CRS is appropriate. Methods: bounds, from_pyproj. |
geolattice.crs.CRS |
Coordinate reference system representation. Methods: area_of_use, authority, code, equivalent, from_authority, from_epsg, from_proj4, from_projjson, from_wkt, identifier, is_geographic, is_projected, name, proj, projjson, spatial_reference, to_epsg, to_wkt, wkt. |
geolattice.crs.CRSCatalogEntry |
One CRS in the selector: authority, code, WKT, PROJ, and area of use. Methods: auth_code, crs, proj, projjson, spatial_reference, wkt. |
geolattice.crs.CRSPromptRequired |
A layer has no CRS and the settings say to prompt for one. |
geolattice.crs.CRSSelector |
CRS selector dialog. Methods: authorities, get, search. |
geolattice.crs.CRSSettings |
Settings → Options → CRS and Transforms. Methods: missing_crs_behavior, prefer, resolve_missing_layer_crs. |
geolattice.crs.CustomProjection |
A CRS defined from a PROJ string or WKT. Methods: auth_code. |
geolattice.crs.CustomProjectionRegistry |
Settings → Custom Projections. Methods: define, get, get_by_code, remove. |
geolattice.crs.DatumTransformation |
One transformation path between two coordinate reference systems. Methods: missing_grids, uses_grid. |
geolattice.crs.DatumTransformationDialog |
Choose a datum transformation when several paths exist. Methods: download_missing_grids, missing_grids, offer_grid_download, paths, requires_choice, resolve, select. |
geolattice.crs.DatumTransformationRequired |
Several datum transformations exist and the user needs to choose one. |
geolattice.crs.Layer |
A map layer and the CRS on Layer Properties → Source. Methods: assign_crs, crs, crs_is_unknown, override_crs. |
geolattice.crs.LayoutMapGrid |
A print-layout map grid. Methods: draws_in_map_crs, grid_crs. |
geolattice.crs.MissingCRSBehavior |
What to do when a layer is created or loaded with no CRS. |
geolattice.crs.PreferredDatumTransformation |
A datum transformation chosen ahead of time for a source and target CRS. |
geolattice.crs.Project |
A project whose CRS is set from Project Properties → CRS. Methods: add_layer, crs, crs_mismatch, display_transform, layers, mismatched_layers, on_the_fly, status_bar_crs. |
geolattice.crs.TransformationGrid |
A grid file used by a datum transformation, and whether it is installed. |
Core types
Spatial data containers, bounds and metadata shared by the other modules.
import geolattice.core
geolattice.core.base
Base classes for spatial data types.
Classes
| Name | Description |
|---|---|
geolattice.core.PointCloudData |
Base class for point cloud spatial data. Methods: bounds, crs, filter_ground, from_file, generate_dtm, metadata, num_points, reproject, to_file, transform. |
geolattice.core.RasterData |
Base class for raster spatial data. Methods: aspect, bounds, crs, from_file, metadata, nodata, reproject, resolution, shape, slope, to_file, transform. |
geolattice.core.SpatialData |
Abstract base class for all spatial data types. Methods: bounds, crs, from_file, metadata, reproject, to_file, transform. |
geolattice.core.VectorData |
Base class for vector spatial data. Methods: bounds, buffer, crs, from_file, geometry_type, intersect, metadata, reproject, to_file, transform, union. |
Functions and classes
Classes
| Name | Description |
|---|---|
geolattice.core.SpatialReference |
Formats SpatialReference.org publishes for one coordinate reference system. Methods: esri_wkt, format_url, ogcwkt, pretty_wkt, pretty_wkt2, proj4, projjson, url. |
geolattice.core.bounds
Spatial bounds and extent management.
Classes
| Name | Description |
|---|---|
geolattice.core.Bounds |
Spatial bounds representation. Methods: area, buffer, centroid, from_extent, from_points, height, intersection, intersects, maxx, maxy, minx, miny, to_list, to_tuple, union, width. |
geolattice.core.metadata
Metadata management for spatial datasets.
Classes
| Name | Description |
|---|---|
geolattice.core.Metadata |
Metadata container for spatial datasets. Methods: add_provenance_entry, attributes, created, from_dict, from_json, get_attribute, get_quality_indicator, modified, provenance, quality, remove_attribute, set_attribute, set_quality_indicator, to_dict, to_json, update_modified. |
Vector data
Read and write vector formats, cloud-native vector data, geoprocessing, geometry tools, vector analysis and attribute tables.
import geolattice.vector
geolattice.vector.bbox
Axis-aligned bounds that can move between coordinate reference systems.
Classes
| Name | Description |
|---|---|
geolattice.vector.VectorBBox |
Bounding box (minx, miny, maxx, maxy) with a CRS. Methods: from_raster, from_vector, to_crs, total_bounds. |
Functions
| Name | Description |
|---|---|
geolattice.vector.to_crs |
Reproject a VectorBBox or a GeoDataFrame/GeoSeries to crs. |
geolattice.vector.read_vector_data
Open file-based vector datasets with GDAL/OGR.
Classes
| Name | Description |
|---|---|
geolattice.vector.DriverUnavailableError |
Raised when this GDAL build does not include the driver for a format. |
geolattice.vector.VectorDataset |
An open GDAL/OGR vector dataset. Methods: bounds, close, crs, feature_count, features, get_layer, layer, layer_count, layer_names, layers, read, to_dataframe, to_dataframes. |
geolattice.vector.VectorFeature |
One vector feature. Methods: to_dict, wkt. |
geolattice.vector.VectorField |
One attribute field on a vector layer. |
geolattice.vector.VectorFormat |
One file-based vector format and the GDAL/OGR drivers that read it. |
geolattice.vector.VectorLayer |
One OGR layer inside an opened dataset. Methods: bounds, compute_bounds, feature_count, features, field_names, fields, read, to_dataframe. |
geolattice.vector.VectorOpenError |
Raised when a vector dataset cannot be opened or read. |
Functions
| Name | Description |
|---|---|
geolattice.vector.driver_available |
Return whether this GDAL build can open datasets with name. |
geolattice.vector.open_vector |
Open a vector dataset. |
geolattice.vector.open_vectors_data |
Open a file-based vector dataset with GDAL/OGR. |
geolattice.vector.read_vector_data |
Read a file-based vector dataset. |
geolattice.vector.supported_formats |
List the file-based formats this module opens, and which drivers exist. |
geolattice.vector.write_vector_data
Write file-based vector datasets that :mod:geolattice.vector.read_vector_data can open.
Classes
| Name | Description |
|---|---|
geolattice.vector.VectorWriteError |
Raised when vector features cannot be written. |
Functions
| Name | Description |
|---|---|
geolattice.vector.supported_write_formats |
List file-based formats and whether this GDAL build can create them. |
geolattice.vector.write_csv |
Write delimited text with a WKT column that read_vector_data can open. |
geolattice.vector.write_geojson |
Write GeoJSON that read_vector_data can open. |
geolattice.vector.write_geopackage |
Write a GeoPackage that read_vector_data can open. |
geolattice.vector.write_shapefile |
Write an ESRI Shapefile that read_vector_data can open. |
geolattice.vector.write_vector_data |
Write vector features to a file the reader can open. |
geolattice.vector.write_cloud_native_vector_data
Write cloud-native vector layouts: GeoParquet, FlatGeobuf and PMTiles.
Functions
| Name | Description |
|---|---|
geolattice.vector.geoparquet_info |
Summarize a GeoParquet file from its footer, without reading the data. |
geolattice.vector.read_geoparquet |
Read a GeoParquet file, optionally only the features inside a bounding box. |
geolattice.vector.write_flatgeobuf |
Write features to FlatGeobuf, with a packed Hilbert R-tree by default. |
geolattice.vector.write_geoparquet |
Write features to a GeoParquet file. |
geolattice.vector.write_pmtiles |
Write features to a PMTiles archive of Mapbox vector tiles. |
geolattice.vector.open_cloud_native_vector_data
Open cloud-native vector data, lakehouse tables, and related spatial layouts.
Classes
| Name | Description |
|---|---|
geolattice.vector.CloudNativeDataset |
An open cloud-native vector dataset. Methods: bounds, close, copc, crs, feature_count, features, geometry_encoding, get_layer, hierarchy, layer, layer_count, layer_names, layers, read, read_tile, spatial_index, to_dataframe. |
geolattice.vector.CloudNativeFormat |
One cloud-native, lakehouse, or related vector layout. |
geolattice.vector.CloudNativeLayer |
One layer of features from a cloud-native dataset. Methods: bounds, compute_bounds, feature_count, features, field_names, fields, read, to_dataframe. |
geolattice.vector.CloudNativeOpenError |
Raised when a cloud-native vector dataset cannot be opened or read. |
Functions
| Name | Description |
|---|---|
geolattice.vector.open_cloud_native_vector |
Open a cloud-native vector dataset. |
geolattice.vector.open_cloud_native_vector_data |
Open cloud-native vector data, a lakehouse table, or a related layout. |
geolattice.vector.supported_cloud_native_formats |
List the layouts this module opens. |
geolattice.vector.geoprocessing_vector_data
Geoprocessing for vector layers.
Classes
| Name | Description |
|---|---|
geolattice.vector.GeoprocessError |
Raised when a geoprocessing input cannot be used. |
Functions
| Name | Description |
|---|---|
geolattice.vector.buffer |
Buffer features by a distance. |
geolattice.vector.clip |
Clip features to a mask. |
geolattice.vector.convex_hull |
Build convex hulls. |
geolattice.vector.dissolve |
Dissolve features by attribute. |
geolattice.vector.erase |
Erase one layer from another. |
geolattice.vector.intersect |
Intersect two layers. |
geolattice.vector.union |
Union geometries. |
geolattice.vector.vector_CRS
Vector CRS helpers: define, validate, and reproject geometries.
Classes
| Name | Description |
|---|---|
geolattice.vector.VectorCRSError |
Raised when a vector CRS cannot be defined, validated, or applied. |
Functions
| Name | Description |
|---|---|
geolattice.vector.align_vector_crs |
Reproject other to the CRS of data when both have CRS and they differ. |
geolattice.vector.choose_vector_datum_transformation |
Resolve the datum transformation between two CRS definitions. |
geolattice.vector.crs_equal |
True when two CRS definitions describe the same coordinate system. |
geolattice.vector.define_vector_crs |
Build a geolattice.crs.CRS from an EPSG code, WKT, PROJ string, authority string, pyproj CRS, or existing CRS. |
geolattice.vector.is_geographic |
True when the CRS is geographic (longitude / latitude). |
geolattice.vector.reproject_geometries |
Reproject a sequence of Shapely geometries. |
geolattice.vector.reproject_geometry |
Reproject one Shapely geometry from source_crs to target_crs. |
geolattice.vector.reproject_vector |
Reproject vector features to target_crs. |
geolattice.vector.validate_vector_crs |
Return a CRS after checking that pyproj can bind the definition. |
geolattice.vector.geometry_tools
Geometry construction and cleanup for vector layers.
Functions
| Name | Description |
|---|---|
geolattice.vector.add_geometry_attributes |
Add measurements taken from each geometry. |
geolattice.vector.affine_transform |
Scale, rotate, and then translate the features. |
geolattice.vector.build_sections |
Build section polygons and their attributes. |
geolattice.vector.centroids |
Create the centroid of each feature. |
geolattice.vector.check_validity |
Report whether each geometry is valid. |
geolattice.vector.collect_geometries |
Group features into multipart geometries. |
geolattice.vector.delete_holes |
Remove interior rings from polygons. |
geolattice.vector.diamonds |
Create a diamond centered on each point. |
geolattice.vector.fix_geometries |
Repair invalid geometries. |
geolattice.vector.offset_lines |
Create parallel lines from each input line. |
geolattice.vector.oriented_minimum_bounding_box |
Build the rotated rectangle that encloses the features. |
geolattice.vector.orthogonalize |
Square corners that are already close to a right angle. |
geolattice.vector.ovals |
Create an oval (ellipse) centered on each point. |
geolattice.vector.point_on_surface |
Create a point guaranteed to lie inside each feature. |
geolattice.vector.points_along_geometry |
Place points along each line at a fixed spacing. |
geolattice.vector.points_displacement |
Spread point features that were recorded at the same location. |
geolattice.vector.rectangles |
Create a rectangle centered on each point. |
geolattice.vector.remove_duplicate_vertices |
Drop repeated or nearly repeated vertices. |
geolattice.vector.rotate |
Rotate features counterclockwise about a shared origin. |
geolattice.vector.snap_geometries_to_layer |
Move vertices onto a reference layer. |
geolattice.vector.snap_points_to_grid |
Round every vertex onto a regular grid. |
geolattice.vector.transect |
Draw lines perpendicular to a path. |
geolattice.vector.translate |
Shift every feature by the same easting, northing, and height. |
geolattice.vector.vector_analysis
Vector analysis tools for attribute and spatial statistics.
Functions
| Name | Description |
|---|---|
geolattice.vector.aggregate_attributes |
Group features by attributes and aggregate values. |
geolattice.vector.basic_statistics_for_fields |
Compute basic statistics for one attribute field. |
geolattice.vector.calculate_fields |
Create or overwrite attributes from expressions or callables. |
geolattice.vector.climb_along_line |
Calculate climb and descent along 3D line geometries. |
geolattice.vector.count_points_in_polygon |
Count points that fall inside each polygon. |
geolattice.vector.dbscan_clustering |
Cluster point features with DBSCAN. |
geolattice.vector.distance_matrix |
Build a point-to-point distance matrix. |
geolattice.vector.distance_to_nearest_hub_lines |
Create lines from each feature center to its nearest hub center. |
geolattice.vector.distance_to_nearest_hub_points |
Create points at each feature center with nearest-hub name and distance. |
geolattice.vector.drop_geometry |
Return the attribute table without geometries. |
geolattice.vector.filter_features |
Select features that match attribute criteria. |
geolattice.vector.hub_lines |
Join hubs to spokes with matching ID fields by drawing connecting lines. |
geolattice.vector.join_attributes |
Join attributes from a table or layer onto features by a common key. |
geolattice.vector.kmeans_clustering |
Partition features into k clusters with 2D k-means. |
geolattice.vector.list_unique_values |
List unique values of one or more attribute fields and count occurrences. |
geolattice.vector.mean_coordinates |
Compute the center of mass of geometries. |
geolattice.vector.nearest_neighbor_analysis |
Perform Clark-Evans nearest-neighbour analysis on a point layer. |
geolattice.vector.overlap_analysis |
Measure how much each input polygon is overlapped by overlay layers. |
geolattice.vector.rename_fields |
Rename attribute columns. |
geolattice.vector.reshape_attributes |
Reshape attribute tables between wide and long forms. |
geolattice.vector.select_fields |
Keep a subset of attribute columns. |
geolattice.vector.shortest_line_between_features |
Create the shortest line from each source feature to nearest destinations. |
geolattice.vector.sort_features |
Order features by one or more attribute fields. |
geolattice.vector.statistics_by_categories |
Calculate field statistics within category groups. |
geolattice.vector.stdbscan_clustering |
Cluster point features with spatiotemporal DBSCAN (ST-DBSCAN). |
geolattice.vector.string_field |
Apply a string operation to a text attribute. |
geolattice.vector.sum_line_lengths |
Sum the length and count of lines that cross each polygon. |
geolattice.vector.transform_field |
Apply a function to one attribute column. |
geolattice.vector.update_where |
Update attributes where a condition is true. |
Raster data
Read, write and reproject rasters, and basic raster operations.
import geolattice.raster
geolattice.raster.raster_read_write
Open and create file-based raster datasets with GDAL raster drivers.
Classes
| Name | Description |
|---|---|
geolattice.raster.DriverUnavailableError |
Raised when this GDAL build does not include the driver for a format. |
geolattice.raster.RasterBand |
Metadata and read helpers for one raster band. Methods: color_interpretation, dtype, metadata, nodata, read, statistics. |
geolattice.raster.RasterDataset |
An open GDAL raster dataset. Methods: band_count, bands, bounds, close, copy_metadata_from, crs, geotransform, get_band, has_subdatasets, height, metadata, projection_wkt, read, shape, subdatasets, width. |
geolattice.raster.RasterFormat |
One file-based raster format and the GDAL drivers that read or write it. |
geolattice.raster.RasterOpenError |
Raised when a raster dataset cannot be opened or read. |
geolattice.raster.RasterWriteError |
Raised when raster pixels cannot be written. |
Functions
| Name | Description |
|---|---|
geolattice.raster.driver_available |
Return whether this GDAL build includes raster driver name. |
geolattice.raster.list_gdal_raster_drivers |
List every raster driver registered in this GDAL build. |
geolattice.raster.open_raster |
Open a raster dataset. |
geolattice.raster.open_raster_data |
Open a raster dataset for reading. |
geolattice.raster.read_raster_data |
Read a raster dataset. |
geolattice.raster.supported_formats |
List file-based raster formats this module knows about. |
geolattice.raster.supported_write_formats |
List raster formats and whether this GDAL build can create them. |
geolattice.raster.write_geotiff |
Write a GeoTIFF that read_raster_data can open. |
geolattice.raster.write_jpeg |
Write a JPEG image that read_raster_data can open. |
geolattice.raster.write_png |
Write a PNG image that read_raster_data can open. |
geolattice.raster.write_raster_data |
Write raster pixels with a GDAL raster driver. |
geolattice.raster.open_imagery
Read a remote raster window and compute NDVI.
Functions
| Name | Description |
|---|---|
geolattice.raster.clip_to_bbox |
Clip raster to a geolattice.vector.bbox.VectorBBox or a bounds tuple. |
geolattice.raster.raster_ndvi |
Normalized difference vegetation index, (nir - red) / (nir + red). |
geolattice.raster.read_raster |
Open a GeoTIFF, COG, or raster URL as an xarray DataArray. |
geolattice.raster.raster_CRS
Raster CRS helpers: define, validate, datum choice, and GDAL warp / reproject.
Classes
| Name | Description |
|---|---|
geolattice.raster.RasterCRSError |
Raised when a raster CRS cannot be defined, validated, or warped. |
Functions
| Name | Description |
|---|---|
geolattice.raster.assign_raster_crs |
Write a CRS onto a copy of the raster without warping pixel values. |
geolattice.raster.choose_raster_datum_transformation |
Resolve the datum transformation between two CRS definitions. |
geolattice.raster.crs_to_gdal |
Export a CRS as a string GDAL accepts for srcSRS / dstSRS. |
geolattice.raster.define_raster_crs |
Build a geolattice.crs.CRS from an EPSG code, WKT, or PROJ string. |
geolattice.raster.get_raster_crs |
Return the CRS of a raster file or open RasterDataset. |
geolattice.raster.list_datum_transformations |
List every datum transformation path between source and target. |
geolattice.raster.reproject_raster |
Reproject a raster to dst_crs (thin wrapper around warp). |
geolattice.raster.reproject_raster_array |
Reproject an in-memory NumPy array (or open dataset) and return (array, geotransform, crs). |
geolattice.raster.validate_raster_crs |
Read and validate the CRS of a raster dataset. |
geolattice.raster.validate_raster_crs_definition |
Return a CRS after checking that a WKT or authority string is available. |
geolattice.raster.warp |
Warp a raster with osgeo.gdal.Warp. |
geolattice.raster.warp_options |
Build a osgeo.gdal.WarpOptions object. |
geolattice.raster.basic_raster_operation
Basic raster operations built on GDAL (and NumPy for algebra / focal stats).
Classes
| Name | Description |
|---|---|
geolattice.raster.RasterOperationError |
Raised when a basic raster operation cannot be completed. |
Functions
| Name | Description |
|---|---|
geolattice.raster.aggregate |
Aggregate (coarsen) a raster by an integer factor. |
geolattice.raster.blend |
Blend / compose two aligned rasters (gdal raster blend). |
geolattice.raster.calc |
Perform raster algebra (gdal raster calc). |
geolattice.raster.class_intervals |
Classification break points for a raster band (R classIntervals). |
geolattice.raster.clip |
Clip a raster by projected bounds, pixel window, or vector cutline (gdal raster clip). |
geolattice.raster.color_map |
Generate an RGB/RGBA dataset from a single band using a color map file (gdal raster color-map / gdaldem color-relief). |
geolattice.raster.compare |
Compare two rasters (gdal raster compare). |
geolattice.raster.contour |
Create vector contours from a DEM (gdal raster contour). |
geolattice.raster.convert |
Convert a raster dataset (gdal raster convert / gdal_translate). |
geolattice.raster.create |
Create a new raster dataset (gdal raster create). |
geolattice.raster.disaggregate |
Disaggregate (refine) a raster by an integer factor. |
geolattice.raster.edit |
Edit raster metadata without changing pixel dimensions (gdal raster edit). |
geolattice.raster.fill_nodata |
Fill nodata regions by interpolation from edges (gdal raster fill-nodata). |
geolattice.raster.focal_statistics |
Moving-window focal statistics over a single raster band. |
geolattice.raster.mosaic |
Build a mosaic from multiple rasters (gdal raster mosaic). |
geolattice.raster.neighbors |
Compute each pixel from its neighbors / focal statistics (gdal raster neighbors, alias neighbours). |
geolattice.raster.polygonize |
Create polygons from a raster band (gdal raster polygonize). |
geolattice.raster.proximity |
Produce a raster proximity map (gdal raster proximity). |
geolattice.raster.raster_algebra |
Evaluate a NumPy-backed raster algebra expression and write the result. |
geolattice.raster.raster_histogram |
Histogram of raster values (R hist()-style breaks and counts). |
geolattice.raster.rasterize |
Burn vector features into a raster grid (R raster::rasterize / GDAL Rasterize). |
geolattice.raster.reclassify |
Reclassify raster values (gdal raster reclassify). |
geolattice.raster.reclassify_by |
Reclassify a raster into n classes using a histogram / quantile / cluster scheme (R classIntervals + classify). |
geolattice.raster.resample |
Resample a raster to a new resolution or dimensions via GDAL Warp. |
geolattice.raster.resize |
Resize a raster without changing georeferenced extents (gdal raster resize). |
geolattice.raster.stack |
Combine input bands into a multi-band output (gdal raster stack). |
geolattice.raster.summarize_raster |
Summarize raster values (min, max, mean, std, count, percentiles). |
geolattice.raster.unscale |
Convert scaled values into unscaled values using band scale/offset (gdal raster unscale). |
geolattice.raster.zonal_stats |
Calculate raster zonal statistics (gdal raster zonal-stats). |
Spatial analysis
Terrain analysis, surface hydrology, multidimensional rasters, multi-criteria suitability, network analysis, segregation analysis, spatial causal inference and vector analysis.
import geolattice.spatial_analysis
geolattice.spatial_analysis.terrain_analysis
Terrain analysis and geomorphometry from digital elevation models (DEMs).
Classes
| Name | Description |
|---|---|
geolattice.spatial_analysis.TerrainAnalysisError |
Raised when a terrain-analysis operation cannot be completed. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_analysis.aspect |
Aspect from a DEM (gdaldem aspect). |
geolattice.spatial_analysis.contours |
Vector elevation contours from a DEM (gdal raster contour). |
geolattice.spatial_analysis.curvature |
Surface curvature from a DEM. |
geolattice.spatial_analysis.gaussian_curvature |
Gaussian curvature (see curvature). |
geolattice.spatial_analysis.hillshade |
Hillshade / shaded relief from a DEM (gdaldem hillshade). |
geolattice.spatial_analysis.landform_classification |
Landform classification from nested TPI scales (Weiss-style). |
geolattice.spatial_analysis.mean_curvature |
Mean curvature (see curvature). |
geolattice.spatial_analysis.multiscale_analysis |
Multiscale terrain metric (Whitebox multiscale-signatures style). |
geolattice.spatial_analysis.plan_curvature |
Plan (projected contour) curvature (see curvature). |
geolattice.spatial_analysis.profile_curvature |
Profile (normal slope-line) curvature (see curvature). |
geolattice.spatial_analysis.roughness |
Terrain roughness (gdaldem roughness): max − min in the 3×3 window. |
geolattice.spatial_analysis.slope |
Slope from a DEM (gdaldem slope). |
geolattice.spatial_analysis.tangential_curvature |
Tangential (normal contour) curvature (see curvature). |
geolattice.spatial_analysis.tpi |
Topographic Position Index. |
geolattice.spatial_analysis.tri |
Terrain Ruggedness Index (gdaldem TRI). |
geolattice.spatial_analysis.twi |
Topographic Wetness Index: ln(a / tan(β)). |
geolattice.spatial_analysis.viewshed |
Binary viewshed from one or more observer locations. |
geolattice.spatial_analysis.surface_hydrology
Surface hydrological analysis from digital elevation models (DEMs).
Classes
| Name | Description |
|---|---|
geolattice.spatial_analysis.SurfaceHydrologyError |
Raised when a surface-hydrology operation cannot be completed. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_analysis.basins |
Delineate whole drainage basins draining to DEM edges / sinks. |
geolattice.spatial_analysis.breach_depressions |
Breach depressions in a DEM (Whitebox BreachDepressions style). |
geolattice.spatial_analysis.catchment_delineation |
Delineate catchments draining to each stream link ID. |
geolattice.spatial_analysis.d8_flow_accumulation |
Basic D8 flow accumulation. |
geolattice.spatial_analysis.d8_pointer |
D8 flow pointer (O’Callaghan & Mark, 1984). |
geolattice.spatial_analysis.dinf_flow_accumulation |
D-infinity flow accumulation / specific contributing area (Tarboton, 1997). |
geolattice.spatial_analysis.dinf_pointer |
D-infinity flow pointer (Tarboton, 1997). |
geolattice.spatial_analysis.downslope_distance_to_stream |
Downslope flow-path distance from each cell to the nearest stream. |
geolattice.spatial_analysis.elevation_above_stream |
Elevation difference between each cell and the stream cell it drains to. |
geolattice.spatial_analysis.extract_streams |
Simple threshold stream extraction (Whitebox ExtractStreams). |
geolattice.spatial_analysis.fd8_pointer |
FD8 (Freeman) multiple-flow-direction weights. |
geolattice.spatial_analysis.fill_depressions |
Fill depressions in a DEM (Wang & Liu / priority-flood style). |
geolattice.spatial_analysis.hydrologic_connectivity |
Binary hydrologic connectivity to the stream network along D8 flow paths. |
geolattice.spatial_analysis.impoundment_analysis |
Impoundment size index (simplified Whitebox ImpoundmentSizeIndex). |
geolattice.spatial_analysis.mdinf_pointer |
MD-infinity flow apportionment (Seibert & McGlynn, 2007). |
geolattice.spatial_analysis.minimal_dispersion_pointer |
Adaptive flow routing between D8 and D-infinity (minimal dispersion). |
geolattice.spatial_analysis.quinn_pointer |
Quinn et al. |
geolattice.spatial_analysis.rho8_pointer |
Rho8 stochastic single-flow pointer (Fairfield & Leymarie, 1991). |
geolattice.spatial_analysis.snap_pour_points |
Snap outlet points to the nearest stream cell (Jenson-style). |
geolattice.spatial_analysis.stochastic_depression_analysis |
Stochastic depression probability (Whitebox StochasticDepressionAnalysis). |
geolattice.spatial_analysis.stream_segmentation |
Assign unique IDs to stream links between junctions / heads / outlets. |
geolattice.spatial_analysis.subbasins |
Subbasin delineation from stream links (Whitebox Subbasins style). |
geolattice.spatial_analysis.watershed |
Delineate watersheds for one or more outlet points. |
geolattice.spatial_analysis.wetness_index |
Topographic Wetness Index: ln(a / tan(β)). |
geolattice.spatial_analysis.multidimensional_raster
Multidimensional raster data management and analysis.
Classes
| Name | Description |
|---|---|
geolattice.spatial_analysis.MultidimensionalRaster |
In-memory multidimensional raster backed by an xarray.Dataset. Methods: dataset, get_dimension_attributes, get_dimension_names, get_dimension_values, isel, open, sel, to_netcdf, to_zarr, variables. |
geolattice.spatial_analysis.MultidimensionalRasterError |
Raised when a multidimensional raster operation cannot be completed. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_analysis.aggregate_function |
On-the-fly aggregate (raster-function style; no write unless destination set). |
geolattice.spatial_analysis.aggregate_multidimensional_raster |
Aggregate along a dimension (ArcGIS Aggregate Multidimensional Raster). |
geolattice.spatial_analysis.analyze_changes_using_ccdc |
Continuous Change Detection and Classification style analysis (ArcGIS Analyze Changes Using CCDC). |
geolattice.spatial_analysis.analyze_changes_using_landtrendr |
LandTrendr-style temporal segmentation for disturbance and recovery (ArcGIS Analyze Changes Using LandTrendr). |
geolattice.spatial_analysis.anomaly_function |
On-the-fly anomaly (raster-function style). |
geolattice.spatial_analysis.build_multidimensional_info |
Build a multidimensional dataset from a mosaic / file series (ArcGIS Build Multidimensional Info). |
geolattice.spatial_analysis.build_multidimensional_transpose |
Restructure storage for fast per-pixel time-series reads (ArcGIS Build Multidimensional Transpose). |
geolattice.spatial_analysis.copy_multidimensional_raster |
Copy / convert a multidimensional raster to another format. |
geolattice.spatial_analysis.create_space_time_cube_from_multidimensional_raster |
Convert a gridded series into a space-time cube structure (ArcGIS Create Space Time Cube From Multidimensional Raster Layer). |
geolattice.spatial_analysis.detect_change_using_change_analysis_raster |
Extract change date, magnitude, or count from CCDC / LandTrendr output (ArcGIS Detect Change Using Change Analysis Raster). |
geolattice.spatial_analysis.feature_to_netcdf |
Export point features / a DataFrame to NetCDF (ArcGIS Feature to NetCDF). |
geolattice.spatial_analysis.find_argument_statistics |
Find the dimension value where a statistic occurs (ArcGIS Find Argument Statistics). |
geolattice.spatial_analysis.generate_multidimensional_anomaly |
Compute anomalies relative to a mean, median, or external baseline (ArcGIS Generate Multidimensional Anomaly). |
geolattice.spatial_analysis.generate_trend_raster |
Per-pixel trend along a dimension (ArcGIS Generate Trend Raster). |
geolattice.spatial_analysis.make_multidimensional_raster_layer |
Create a multidimensional raster layer from NetCDF, GRIB, HDF, Zarr, or OPeNDAP (ArcGIS Make Multidimensional Raster Layer). |
geolattice.spatial_analysis.make_netcdf_feature_layer |
Read NetCDF coordinates / variables as a point feature table (ArcGIS Make NetCDF Feature Layer). |
geolattice.spatial_analysis.make_netcdf_raster_layer |
Read a NetCDF variable as a raster layer (ArcGIS Make NetCDF Raster Layer). |
geolattice.spatial_analysis.make_netcdf_table_view |
Read NetCDF variables as a tabular view (ArcGIS Make NetCDF Table View). |
geolattice.spatial_analysis.make_opendap_raster_layer |
Stream a multidimensional raster from an OPeNDAP / THREDDS server (ArcGIS Make OPeNDAP Raster Layer). |
geolattice.spatial_analysis.merge_multidimensional_rasters |
Combine multidimensional rasters along a dimension (ArcGIS Merge Multidimensional Rasters). |
geolattice.spatial_analysis.multidimensional_filter |
On-the-fly multidimensional filter (subset without writing). |
geolattice.spatial_analysis.multidimensional_principal_components |
PCA / EOF-style analysis across a dimension (ArcGIS Multidimensional Principal Components). |
geolattice.spatial_analysis.predict_using_trend_raster |
Project values at new dimension values from a trend raster (ArcGIS Predict Using Trend Raster). |
geolattice.spatial_analysis.raster_to_netcdf |
Export a multidimensional raster to NetCDF (ArcGIS Raster to NetCDF). |
geolattice.spatial_analysis.sample_multidimensional |
Sample a multidimensional raster at point locations for every slice (ArcGIS Sample with multidimensional input). |
geolattice.spatial_analysis.subset_multidimensional_raster |
Subset by variable, dimension values / ranges, and/or spatial extent (ArcGIS Subset Multidimensional Raster). |
geolattice.spatial_analysis.table_to_netcdf |
Export a table to NetCDF (ArcGIS Table to NetCDF). |
geolattice.spatial_analysis.temporal_profile |
Extract a pixel or zone time series for a Temporal Profile chart. |
geolattice.spatial_analysis.trend_function |
On-the-fly trend (raster-function style). |
geolattice.spatial_analysis.zonal_statistics_as_table |
Per-slice zonal statistics for a multidimensional raster (ArcGIS Zonal Statistics as Table with multidimensional input). |
geolattice.spatial_analysis.multi_criteria_suitability_analysis
Multi-criteria suitability analysis (MCDA) for rasters and arrays.
Classes
| Name | Description |
|---|---|
geolattice.spatial_analysis.SuitabilityAnalysisError |
Raised when a suitability-analysis operation cannot be completed. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_analysis.block_mean |
Aggregate an array by non-overlapping factor × factor block means. |
geolattice.spatial_analysis.categorical_and |
Logical AND of Boolean criterion flags (all must pass). |
geolattice.spatial_analysis.categorical_or |
Logical OR of Boolean criterion flags (any may pass). |
geolattice.spatial_analysis.criteria_count |
Count how many criteria each location meets (k-of-n ordinal score). |
geolattice.spatial_analysis.fuzzy_membership |
Transform a continuous raster to a 0-1 fuzzy membership surface. |
geolattice.spatial_analysis.fuzzy_overlay |
Combine fuzzy membership rasters. |
geolattice.spatial_analysis.gaussian |
μ = exp(-spread · (x − midpoint)²); peak of 1 at the midpoint. |
geolattice.spatial_analysis.hybrid_suitability |
Apply hard Boolean constraints to a soft suitability score. |
geolattice.spatial_analysis.interp_membership |
Interpolate a discrete membership function at points x. |
geolattice.spatial_analysis.jaccard_index |
Jaccard similarity of two Boolean masks: \|A ∩ B\| / \|A ∪ B\|. |
geolattice.spatial_analysis.large |
μ = 1 / (1 + (x / midpoint)^(-spread)); large values → 1. |
geolattice.spatial_analysis.limiting_criterion |
Index (or name) of the weakest membership at each location (fuzzy AND limit). |
geolattice.spatial_analysis.linear |
Linear ramp: 0 at minimum, 1 at maximum (decreasing if min > max). |
geolattice.spatial_analysis.locate_regions |
Turn a continuous suitability surface into discrete candidate sites. |
geolattice.spatial_analysis.mamdani |
Vectorized Mamdani inference with min implication, max aggregation, and centroid defuzzification. |
geolattice.spatial_analysis.minmax_normalize |
Min-max normalize values to [0, 1]. |
geolattice.spatial_analysis.monte_carlo_weights |
Dirichlet Monte Carlo over weights around a baseline (concentration kappa). |
geolattice.spatial_analysis.ms_large |
Mean/std-based increasing membership (ArcGIS MS Large). |
geolattice.spatial_analysis.ms_small |
Mean/std-based decreasing membership (ArcGIS MS Small). |
geolattice.spatial_analysis.near |
μ = 1 / (1 + spread · (x − midpoint)²); sharper peak, longer tails. |
geolattice.spatial_analysis.overlay |
Combine fuzzy membership arrays or Series. |
geolattice.spatial_analysis.percentile_rank_normalize |
Percentile-rank normalize values to [0, 1] (ties share the average rank). |
geolattice.spatial_analysis.perturb_weights |
One-at-a-time weight perturbation with proportional renormalization. |
geolattice.spatial_analysis.rescale_by_function |
Rescale continuous raster values with a transformation function. |
geolattice.spatial_analysis.score_contributions |
Return per-criterion weighted contributions w_i * x_i. |
geolattice.spatial_analysis.small |
μ = 1 / (1 + (x / midpoint)^spread); small values → 1. |
geolattice.spatial_analysis.somewhat |
Dilation hedge: √μ (more lenient membership). |
geolattice.spatial_analysis.spread_for_small |
Spread that gives μ = 0.9 at x_at_09 for the Small membership. |
geolattice.spatial_analysis.suitability_reclassify |
Reclassify raster values with the C suitability kernel. |
geolattice.spatial_analysis.top_quantile_mask |
Boolean mask of cells at or above the q quantile (optionally within mask). |
geolattice.spatial_analysis.trapezoidal_mf |
Trapezoidal membership: abcd = (a, b, c, d) with plateau [b, c]. |
geolattice.spatial_analysis.triangular_mf |
Triangular membership: abc = (a, b, c) with peak at b. |
geolattice.spatial_analysis.very |
Concentration hedge: μ² (stricter membership). |
geolattice.spatial_analysis.weighted_fuzzy_overlay |
Weighted fuzzy Gamma operator. |
geolattice.spatial_analysis.weighted_linear_combination |
Weighted linear combination (WLC): sum(w_i * x_i) with weights normalized to sum to 1. |
geolattice.spatial_analysis.weighted_overlay |
Weighted overlay of evaluation-scale rasters. |
geolattice.spatial_analysis.weighted_sum |
Weighted sum of rasters: sum(raster_i * weight_i). |
geolattice.spatial_analysis.network_analysis
Spatial network analysis for GeoLattice.
Classes
| Name | Description |
|---|---|
geolattice.spatial_analysis.NetworkAnalysisError |
Raised when a spatial-network operation cannot be completed. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_analysis.arrival_times |
First time step where prevalence ≥ threshold for each patch. |
geolattice.spatial_analysis.attach_od_impedance |
Attach network minutes (and optional Euclidean km) to OD rows. |
geolattice.spatial_analysis.build_spatial_graphs |
Build common adjacency / distance graphs from polygons or points. |
geolattice.spatial_analysis.circuity_sample |
Sample OD pairs: Euclidean vs network distance and circuity ratio. |
geolattice.spatial_analysis.closure_impact |
Δ OD travel times after removing edges (road closure scenario). |
geolattice.spatial_analysis.community_label_agreement |
Adjusted Rand index between two labelings. |
geolattice.spatial_analysis.cumulative_accessibility |
Opportunity mass reachable within cutoff from each opportunity node. |
geolattice.spatial_analysis.describe_spatial_graph |
Links, degree, components, clustering, and mean / max link length. |
geolattice.spatial_analysis.diffusion_centrality |
Banerjee et al. finite-horizon diffusion centrality. |
geolattice.spatial_analysis.dominant_flow_hierarchy |
Nystuen-Dacey dominant-flow hierarchy tree and central places. |
geolattice.spatial_analysis.edge_travel_time_betweenness |
Attach sample-k travel-time edge betweenness as an edge attribute. |
geolattice.spatial_analysis.evaluate_candidate_sites |
p-median (pop-weighted mean time) and coverage gain per candidate site. |
geolattice.spatial_analysis.fit_gravity_model |
Fit a gravity model by OLS-on-log or PPML (Poisson). |
geolattice.spatial_analysis.flow_communities |
Louvain regions on a symmetric flow graph; returns communities and Q. |
geolattice.spatial_analysis.flow_pagerank |
Attraction ranking from weighted PageRank on a flow Digraph. |
geolattice.spatial_analysis.gaussian_distance_decay |
Gaussian impedance with weight ≈ 0.14 at d0. |
geolattice.spatial_analysis.graph_component_summary |
Edges, clustering, LCC share, and average path length on the LCC. |
geolattice.spatial_analysis.graph_from_edgelist |
Build a (Di)Graph from an edgelist; optionally attach node attributes. |
geolattice.spatial_analysis.graph_positions |
Return {node: (x, y)} from node attributes. |
geolattice.spatial_analysis.haversine_km |
Great-circle distance in kilometres (vectorized). |
geolattice.spatial_analysis.is_planar_graph |
Return whether the undirected simple graph is planar. |
geolattice.spatial_analysis.isochrone_polygons |
Network-buffer isochrones for travel-time budgets (minutes). |
geolattice.spatial_analysis.kansky_indices |
Planar connectivity indices α, β, γ plus node / edge counts. |
geolattice.spatial_analysis.lines_to_graph |
Build an undirected graph from a line GeoDataFrame (snap endpoints). |
geolattice.spatial_analysis.link_probability_by_distance |
Empirical P(edge) by distance bin for an undirected simple graph. |
geolattice.spatial_analysis.load_road_graph |
Load an OSMnx-compatible GraphML road network. |
geolattice.spatial_analysis.lorenz_curve_gini |
Population-weighted Lorenz curve and Gini coefficient. |
geolattice.spatial_analysis.metapopulation_sir |
Commuting-coupled metapopulation SIR; returns prevalence history (days, n). |
geolattice.spatial_analysis.min_threshold_distance |
Smallest distance-band threshold with no islands. |
geolattice.spatial_analysis.monte_carlo_contagion |
Repeated seeding + diffusion; returns histories (reps, periods+1) and adoption times. |
geolattice.spatial_analysis.morans_i |
Moran’s I given a row-standardised weights matrix. |
geolattice.spatial_analysis.nearest_facility_euclidean |
Straight-line nearest facility and distance (map units / 1000 → km). |
geolattice.spatial_analysis.nearest_facility_network |
Multi-source Dijkstra: distance and nearest facility per demand node. |
geolattice.spatial_analysis.node_flow_balance |
Inflow, outflow, net flow, and in/out ratio by node. |
geolattice.spatial_analysis.od_to_digraph |
Build a directed weighted flow graph from an OD table. |
geolattice.spatial_analysis.od_travel_time_matrix |
Place × place travel-time (or length) matrix via Dijkstra. |
geolattice.spatial_analysis.pairwise_distance_matrix |
Euclidean pairwise distance matrix from point geometries. |
geolattice.spatial_analysis.participation_coefficient |
Guimerà-Amaral participation coefficient by community assignment. |
geolattice.spatial_analysis.percolation_curve |
LCC %, components, and mean degree vs distance threshold. |
geolattice.spatial_analysis.population_coverage |
Share of each population column within travel-time thresholds. |
geolattice.spatial_analysis.prepare_travel_times |
Add edge speeds and travel times; optionally store minutes. |
geolattice.spatial_analysis.pseudo_r2 |
Squared Pearson correlation as a gravity-model fit diagnostic. |
geolattice.spatial_analysis.route_summary |
Summarise a node route: km, minutes, segments, % on given highways. |
geolattice.spatial_analysis.row_standardize |
Row-standardise an adjacency matrix. |
geolattice.spatial_analysis.select_seeds |
Select k seeds by strategy name (notebook 06 seeding policies). |
geolattice.spatial_analysis.set_edge_lengths_euclidean |
Fill edge lengths from projected node coordinates (scale converts units). |
geolattice.spatial_analysis.set_edge_lengths_haversine |
Fill edge lengths from lon/lat node attributes via haversine_km. |
geolattice.spatial_analysis.shortest_routes |
Shortest paths under one or more edge weight attributes. |
geolattice.spatial_analysis.similarity_weighted_communities |
Louvain communities on edges weighted by attribute similarity. |
geolattice.spatial_analysis.simulate_contagion |
Simple or complex contagion on an adjacency matrix. |
geolattice.spatial_analysis.snap_points_to_nodes |
Nearest network nodes for point geometries (osmnx). |
geolattice.spatial_analysis.spatial_lag |
Spatial lag Wr @ y. |
geolattice.spatial_analysis.symmetric_flow_graph |
Undirected Louvain-ready flow graph (optionally relative flows). |
geolattice.spatial_analysis.tie_distance_decay |
P(tie) vs distance, optionally stratified by same-group membership. |
geolattice.spatial_analysis.travel_time_matrix |
Origin × destination network times (+ optional access legs on origins). |
geolattice.spatial_analysis.two_sfca |
Classic or enhanced 2SFCA accessibility (supply per scale demand). |
geolattice.spatial_analysis.weights_to_graph |
Convert a libpysal W object to NetworkX (symmetrise k-NN). |
geolattice.spatial_analysis.segregation
Segregation analysis for GeoLattice.
Classes
| Name | Description |
|---|---|
geolattice.spatial_analysis.segregation.MultiscaleProfile |
Per-unit divergence at each queried radius, plus the compact summaries. |
geolattice.spatial_analysis.segregation.Neighborhood |
A sparse unit-by-unit weights matrix plus the centroid coordinates it was built from. Methods: n, pooled_counts. |
geolattice.spatial_analysis.segregation.SegregationDataError |
Raised when input data cannot be turned into a valid group-count table. |
geolattice.spatial_analysis.segregation.SegregationResult |
Uniform result of compute. Methods: map, summary, to_frame. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_analysis.segregation.areal_interpolate |
Area-weighted interpolation of value_cols from source_gdf‘s polygons onto target_gdf’s polygons – the standard way to compare counts across geographies that do not share boundaries (e.g. two census years’ tracts). |
geolattice.spatial_analysis.segregation.chain_decomposition |
Apply decompose_change across every pair of consecutive periods in gdfs (a {period: gdf} mapping, e.g. |
geolattice.spatial_analysis.segregation.combine_years |
Stack several years’ wide_to_long outputs into one panel, tagging each row with its year (already present if built by wide_to_long, but reapplied here so callers can also pass plain per-year long frames directly). |
geolattice.spatial_analysis.segregation.compute |
Compute one named index and return it in a uniform SegregationResult. |
geolattice.spatial_analysis.segregation.compute_panel |
One row per period: index_fn(gdf, groups, **index_kwargs) for each {period: gdf} pair in gdfs (defaults to geolattice.spatial_analysis.segregation.indices.dissimilarity). |
geolattice.spatial_analysis.segregation.compute_profile |
Compute the multiscale profile for every unit at each radius in radii (ascending). |
geolattice.spatial_analysis.segregation.correlation_ratio |
Correlation ratio / Eta-squared (Bell 1954; White 1986): normalized exposure, (P* - P) / (1 - P) where P* is group’s isolation index and P its region-wide share. 0 when group is evenly spread (isolation equals its region-wide… |
geolattice.spatial_analysis.segregation.dasymetric_interpolate |
Dasymetric interpolation: like areal_interpolate, but each source-target overlap piece is weighted by the sum of a raster layer inside that piece (a land-cover built-up mask, a population or nighttime-lights grid, …) instead of by… |
geolattice.spatial_analysis.segregation.decompose_change |
Split index_fn(gdf_a, groups) - index_fn(gdf_b, groups) into a spatial and a composition component (exactly 2 group columns; defaults to geolattice.spatial_analysis.segregation.indices.dissimilarity if index_fn is not given). |
geolattice.spatial_analysis.segregation.dissimilarity |
Duncan & Duncan (1955) index of dissimilarity: the share of either group that would have to move for every unit to match the region’s overall composition. |
geolattice.spatial_analysis.segregation.distance_band_weights |
All unit pairs within threshold distance, weighted 1 (equivalent to kernel_weights(..., kernel="uniform"), kept separate as the more common name). |
geolattice.spatial_analysis.segregation.evenness_null |
“Evenness” null (the one most indices are compared against): every unit keeps its observed total population t_i, but its group composition is redrawn from a multinomial with the region’s proportions global_props – i.e. the null… |
geolattice.spatial_analysis.segregation.export_for_causal |
A unit-id-keyed, geometry-free table of local_values – the shape PyCausalML’s and geolattice.spatial_analysis.spatialcausal’s panel/cross-sectional estimators expect for an exposure or confounder column. |
geolattice.spatial_analysis.segregation.exposure |
Exposure index (Bell 1954): the average share of group_b in the unit a randomly chosen member of group_a lives in. |
geolattice.spatial_analysis.segregation.extract_counts |
Pull the group-count columns out of gdf as a float (n_units, n_groups) array. |
geolattice.spatial_analysis.segregation.fdr_correction |
Benjamini-Hochberg false-discovery-rate correction: which of p_values are significant at alpha once you account for running one test per unit (the same multiple-comparisons adjustment LISA cluster maps need – otherwise ~5% of units… |
geolattice.spatial_analysis.segregation.gini |
Segregation Gini index (James & Taeuber 1985): the population-weighted Gini coefficient of each unit’s minority share p_i = x_i / t_i. |
geolattice.spatial_analysis.segregation.global_proportions |
Region-wide share of each group, X_k / T. |
geolattice.spatial_analysis.segregation.harmonize_panel |
Interpolate every period’s source geometry in gdfs onto one common target_gdf, so the whole panel ends up on the same units before computing any index across it – the usual problem with multi-decade segregation panels, since census… |
geolattice.spatial_analysis.segregation.isolation |
Isolation index (Bell 1954; Lieberson 1981): the average share of group in the unit a randomly chosen member of group lives in. |
geolattice.spatial_analysis.segregation.kernel_weights |
Distance-decay weights: every pair within a few bandwidths gets a smooth weight (Gaussian) or a hard cutoff (triangular tapers to 0 at bandwidth; uniform is 1 inside, 0 outside). |
geolattice.spatial_analysis.segregation.knn_weights |
The k nearest centroids to each unit, weighted 1 (asymmetric: i having j as a nearest neighbor does not guarantee the reverse, matching libpysal’s own KNN). |
geolattice.spatial_analysis.segregation.local_dissimilarity_contribution |
Each unit’s own contribution to the two-group dissimilarity index: D = sum_i d_i, with d_i = t_i * \|p_i - P\| / (2*X*(1-P)) for minority group groups[0] (so the region-wide indices.dissimilarity is recovered exactly by summing this). |
geolattice.spatial_analysis.segregation.local_entropy |
Local Shannon entropy E_i = -sum_k p_ik * ln(p_ik): 0 when a unit (or its pooled neighborhood) has only one group present, highest when groups are evenly mixed. |
geolattice.spatial_analysis.segregation.local_exposure_deviation |
How far a unit’s share of group departs from the regional share, p_ik - P_k (signed: positive means locally over-represented). |
geolattice.spatial_analysis.segregation.local_proportions |
Within-unit share of each group, p_ik = x_ik / t_i (0 where t_i == 0). |
geolattice.spatial_analysis.segregation.local_quotient |
Location quotient: LQ_i = p_ik / P_k, the unit’s share of group relative to the region’s own share. |
geolattice.spatial_analysis.segregation.local_significance |
Permutation significance for any local statistic in this module (pass the function itself, e.g. |
geolattice.spatial_analysis.segregation.local_simpson_diversity |
Local Simpson diversity 1 - sum_k p_ik^2: the probability two people drawn at random from this unit (or its pooled neighborhood) belong to different groups. |
geolattice.spatial_analysis.segregation.multigroup_dissimilarity |
Multigroup generalized dissimilarity index (Sakoda 1981): sum_i sum_k t_i * \|p_ik - P_k\| / (2 * T * I_s), where I_s = sum_k P_k*(1-P_k) normalizes by the region’s own group diversity so the index still ranges roughly 0-1. |
geolattice.spatial_analysis.segregation.network_weights |
Shortest-path network distance (in the graph’s own edge-length units, typically meters) between each unit’s nearest node, thresholded at radius. |
geolattice.spatial_analysis.segregation.panel_trend_test |
Mann-Kendall trend test across a panel’s successive period values (3+ periods needed), plus an ordinary-least-squares slope for an interpretable rate of change. |
geolattice.spatial_analysis.segregation.permutation_pvalue |
Permutation p-value for a scalar observed statistic against its simulated null distribution null_values, with the standard +1 correction so the p-value can never read exactly 0 from a finite number of simulations. |
geolattice.spatial_analysis.segregation.plot_decomposition |
Stacked bar chart of the spatial vs. composition components from geolattice.spatial_analysis.segregation.decomposition.chain_decomposition, one bar per consecutive period pair. |
geolattice.spatial_analysis.segregation.plot_local_map |
Choropleth of a local measure. |
geolattice.spatial_analysis.segregation.plot_profile |
Divergence-vs-radius curves for selected units from a geolattice.spatial_analysis.segregation.multiscale.MultiscaleProfile (defaults to the 5 units with the highest segregation_scale, i.e. the most persistently segregated ones, if… |
geolattice.spatial_analysis.segregation.plot_trend |
Line plot of a panel’s statistic over time (panel is the DataFrame from geolattice.spatial_analysis.segregation.temporal.compute_panel, with period and statistic columns), with the Sen slope overlaid if trend_result (from… |
geolattice.spatial_analysis.segregation.simpson_diversity |
Region-wide Simpson diversity index: the probability two people drawn at random from the whole region (not a single unit – see local.local_simpson_diversity for that) belong to different groups, 1 - sum_k P_k^2. |
geolattice.spatial_analysis.segregation.single_value_test |
Is the observed index_fn(gdf, groups, **index_kwargs) more extreme than the chosen null model would produce? |
geolattice.spatial_analysis.segregation.spatial_block_bootstrap |
Bootstrap confidence interval for index_fn, resampling whole spatial blocks (from spatial_blocks) with replacement rather than individual units – so neighboring, spatially-correlated units are resampled together instead of as if… |
geolattice.spatial_analysis.segregation.spatial_blocks |
Partition units into n_blocks contiguous-ish spatial groups: "kmeans" clusters centroid coordinates (fast, no extra dependency beyond scikit-learn); "grid" instead cuts the bounding box into a sqrt(n_blocks) x sqrt(n_blocks)… |
geolattice.spatial_analysis.segregation.spatially_constrained_null |
Like systematic_null, but compositions are only reshuffled within each spatial block (block_labels, e.g. from inference.spatial_blocks) – respects whatever spatial autocorrelation exists beyond block scale, instead of mixing… |
geolattice.spatial_analysis.segregation.systematic_null |
“Systematic” (spatial-randomization) null: the exact observed set of unit compositions is kept, but which unit gets which composition is reshuffled. |
geolattice.spatial_analysis.segregation.theil_h |
Multigroup information-theory index H (Theil & Finizza 1971; Reardon & Firebaugh 2002): the population-weighted share of the region’s overall group-diversity (entropy) that is “explained away” by sorting people into units. 0 when every… |
geolattice.spatial_analysis.segregation.trend |
compute_panel followed by geolattice.spatial_analysis.segregation.inference.panel_trend_test on the resulting series – the one-call version of “is this index trending across the panel.” |
geolattice.spatial_analysis.segregation.two_value_test |
Does index_fn differ between two datasets (two cities, or the same city two years apart)? |
geolattice.spatial_analysis.segregation.unit_totals |
Signature: unit_totals(counts: 'np.ndarray') -> 'np.ndarray'. |
geolattice.spatial_analysis.segregation.weighted_gini |
Weighted Gini coefficient of values, via the Lorenz-curve trapezoid rule – O(n log n) from one sort, not the O(n^2) pairwise-difference formula it is algebraically equal to. |
geolattice.spatial_analysis.segregation.wide_to_long |
One row per (unit, group) for a single year – the building block combine_years and temporal stack into a long panel. |
geolattice.spatial_analysis.segregation.backend
CPU/GPU array dispatch for the segregation package.
Functions
| Name | Description |
|---|---|
geolattice.spatial_analysis.segregation.backend.array_module |
Return the array module that owns arr (NumPy, or CuPy if it is a CuPy array). |
geolattice.spatial_analysis.segregation.backend.available_backends |
["cpu"], plus "cuda" if CuPy and a GPU are both importable. |
geolattice.spatial_analysis.segregation.backend.device |
Temporarily switch the backend within a with block. |
geolattice.spatial_analysis.segregation.backend.get_backend |
Signature: get_backend() -> 'str'. |
geolattice.spatial_analysis.segregation.backend.get_xp |
Return the array module (numpy or cupy) for backend (or the active one). |
geolattice.spatial_analysis.segregation.backend.is_gpu_array |
Signature: is_gpu_array(arr: 'Any') -> 'bool'. |
geolattice.spatial_analysis.segregation.backend.set_backend |
Switch the module-level default backend ("cpu" or "cuda"). |
geolattice.spatial_analysis.segregation.backend.to_cpu |
Move an array to host (NumPy) memory; a no-op for arrays already there. |
geolattice.spatial_analysis.segregation.backend.to_device |
Move arr to backend (or the active backend). |
geolattice.spatial_analysis.spatialcausal
Causal inference for spatially dependent data (ported from PySpatialCausal 0.3.1).
Classes
| Name | Description |
|---|---|
geolattice.spatial_analysis.spatialcausal.BayesianSpatialCausal |
Bayesian treatment and spillover effects with an ICAR / BYM spatial field. Methods: effect, effect_draws, fit, probability, summary. |
geolattice.spatial_analysis.spatialcausal.BernoulliDesign |
Each unit treated independently with probability p (scalar or vector). Methods: sample. |
geolattice.spatial_analysis.spatialcausal.BipartiteExposure |
Exposure of receptor units to treatments applied at other locations. Methods: high_exposure, key_source, neighbor_exposure. |
geolattice.spatial_analysis.spatialcausal.ClusterDesign |
Whole clusters (e.g. villages, blocks) treated with probability p. Methods: sample. |
geolattice.spatial_analysis.spatialcausal.ClusterRandomizedDesign |
Randomise spatial clusters to treatment. Methods: analysis_mask, interior_share, sample. |
geolattice.spatial_analysis.spatialcausal.CompleteDesign |
Exactly n_treated units treated, chosen uniformly at random. Methods: sample. |
geolattice.spatial_analysis.spatialcausal.DistanceDecayExposure |
Exposure as a kernel-weighted sum of treated units within range. Methods: condition_names, conditions, high_exposure, neighbor_exposure. |
geolattice.spatial_analysis.spatialcausal.EffectEstimate |
One causal contrast with its standard error and confidence interval. Methods: as_dict, ci, p_value, z. |
geolattice.spatial_analysis.spatialcausal.ExposureMapping |
Map a treatment vector to neighbourhood exposure and exposure conditions. Methods: condition_names, conditions, high_exposure, neighbor_exposure. |
geolattice.spatial_analysis.spatialcausal.GCCM |
Geographical convergent cross mapping. Methods: embed, fit, summary. |
geolattice.spatial_analysis.spatialcausal.GeographicRDD |
Sharp regression discontinuity at a geographic boundary. Methods: along_boundary, balance, bandwidth_sensitivity, boundary_position, effect, fit, running_variable, summary. |
geolattice.spatial_analysis.spatialcausal.GWCausalForest |
Geographically weighted causal forest for a binary treatment. Methods: effect, fit, predict, summary. |
geolattice.spatial_analysis.spatialcausal.GWDML |
Geographically weighted double machine learning. Methods: effect, fit, predict, stationarity_test, summary. |
geolattice.spatial_analysis.spatialcausal.InterferenceEstimator |
Estimate direct and spillover effects under spatial interference. Methods: effect, fit, summary. |
geolattice.spatial_analysis.spatialcausal.PyCausalMLAdapter |
Run any PyCausalML estimator on spatially augmented features. Methods: fit, predict, transform. |
geolattice.spatial_analysis.spatialcausal.SaturationDesign |
Two-stage randomised saturation design. Methods: sample, unit_saturation. |
geolattice.spatial_analysis.spatialcausal.SpatialBasis |
A spatial smooth expressed as basis columns. Methods: build. |
geolattice.spatial_analysis.spatialcausal.SpatialBlockKFold |
K-fold splitter over spatial blocks. Methods: get_n_splits, make_blocks, split. |
geolattice.spatial_analysis.spatialcausal.SpatialCausalData |
Spatially indexed causal data. Methods: from_geodataframe, is_binary, to_frame, w, w_sparse. |
geolattice.spatial_analysis.spatialcausal.SpatialCausalResult |
A table of causal contrasts plus metadata about how SEs were computed. Methods: get, plot, stats, summary, to_frame. |
geolattice.spatial_analysis.spatialcausal.SpatialDiD |
Two-way fixed effects DiD with distance rings for spillovers. Methods: effect, fit, summary, unit_groups. |
geolattice.spatial_analysis.spatialcausal.SpatialDML |
Partially linear DML with spatial features, folds and SEs. Methods: confidence_interval, effect, fit, summary. |
geolattice.spatial_analysis.spatialcausal.SpatialDRLearner |
Doubly robust learner with spatial cross-fitting. Methods: effect, fit, predict, summary. |
geolattice.spatial_analysis.spatialcausal.SpatialGranger |
Panel Granger causality test with spatial lags. Methods: fit, summary. |
geolattice.spatial_analysis.spatialcausal.SpatialNOTEARS |
Structure learning with local and spillover edges. Methods: fit, summary. |
geolattice.spatial_analysis.spatialcausal.SpatialPanel |
Unit × time panel with unit locations. Methods: adoption_times, from_long, is_balanced, n_obs, n_units, to_frame, wide. |
geolattice.spatial_analysis.spatialcausal.SpatialPlus |
spatial+ (Dupont, Wood & Augustin, 2022). Methods: effect, fit, summary. |
geolattice.spatial_analysis.spatialcausal.SpatialSyntheticControl |
Synthetic control with a spatial donor buffer. Methods: buffer_sensitivity, effect, fit, spillovers, summary. |
geolattice.spatial_analysis.spatialcausal.StaggeredSpatialDiD |
Group-time DiD for staggered adoption with spatial spillovers. Methods: effect, exposure_times, fit, summary. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_analysis.spatialcausal.balanced_allocation |
Spatially balanced treatment allocation using GRTS (geolattice.spatial_statistics.sampling.grts). |
geolattice.spatial_analysis.spatialcausal.block_permutation_test |
Randomisation test that shuffles treatment within spatial blocks. |
geolattice.spatial_analysis.spatialcausal.compare_adjustments |
Side-by-side estimates: naive OLS, OLS + spatial smooth, spatial+, spatial DML. |
geolattice.spatial_analysis.spatialcausal.conley_variance |
Spatial HAC variance of mean(psi). |
geolattice.spatial_analysis.spatialcausal.design_diagnostics |
Balance and spatial structure of an assignment. |
geolattice.spatial_analysis.spatialcausal.diagnose_spatial_confounding |
Moran’s I (via PySpatialStats) on treatment, outcome and their residuals. |
geolattice.spatial_analysis.spatialcausal.exposure_probabilities |
Monte-Carlo probability that each unit falls in each exposure condition. |
geolattice.spatial_analysis.spatialcausal.ik_bandwidth |
Imbens & Kalyanaraman (2012) MSE-optimal bandwidth for a sharp RDD at 0. |
geolattice.spatial_analysis.spatialcausal.kernel_weights |
Sparse distance-decay weights K[i, j] = k(d_ij / bandwidth). |
geolattice.spatial_analysis.spatialcausal.make_folds |
Return a list of (train, test) index pairs. |
geolattice.spatial_analysis.spatialcausal.moran_eigenvectors |
Moran eigenvector maps (Griffith; Dray et al.). |
geolattice.spatial_analysis.spatialcausal.notears_linear |
Linear NOTEARS with least-squares loss and L1 penalty (Zheng et al., 2018). |
geolattice.spatial_analysis.spatialcausal.power_analysis |
Simulation-based power for a spatial design. |
geolattice.spatial_analysis.spatialcausal.power_curve |
Power over a design parameter, e.g. |
geolattice.spatial_analysis.spatialcausal.rbf_basis |
Gaussian radial basis functions centred on k-means knots. |
geolattice.spatial_analysis.spatialcausal.rerandomize |
Rerandomisation: draw assignments until balance criteria are met. |
geolattice.spatial_analysis.spatialcausal.spatial_block_bootstrap |
Block bootstrap: resample whole spatial blocks with replacement. |
geolattice.spatial_analysis.spatialcausal.spatial_features |
Append spatial features to X. |
geolattice.spatial_analysis.spatialcausal.standard_error |
Standard error of mean(psi) under the chosen dependence model. |
geolattice.spatial_analysis.spatialcausal.suggest_cutoff |
Heuristic Conley cutoff: the distance at which the residual correlogram first drops below 0.1, or a quantile of pairwise distances. |
geolattice.spatial_analysis.spatialcausal.datasets
Functions
| Name | Description |
|---|---|
geolattice.spatial_analysis.spatialcausal.datasets.simulate_areal_causal |
Areal (lattice) data with an ICAR-like spatial effect and Queen neighbours. |
geolattice.spatial_analysis.spatialcausal.datasets.simulate_gccm |
Coupled spatial logistic maps (the test system of Gao et al., 2023). |
geolattice.spatial_analysis.spatialcausal.datasets.simulate_geographic_rdd |
Units north of a wavy border are treated. |
geolattice.spatial_analysis.spatialcausal.datasets.simulate_interference |
Outcomes depend on own treatment and the share of treated neighbours. |
geolattice.spatial_analysis.spatialcausal.datasets.simulate_spatial_confounding |
Unmeasured, spatially smooth confounder U affects both T and Y. |
geolattice.spatial_analysis.spatialcausal.datasets.simulate_spatial_dag |
Cross-sectional data from a linear SEM with local and spillover edges. |
geolattice.spatial_analysis.spatialcausal.datasets.simulate_spatial_did |
Panel where treatment spills over to untreated neighbours. |
geolattice.spatial_analysis.spatialcausal.datasets.simulate_spatial_granger |
Panel where past x (own and neighbours’) drives y; y does not drive x. |
geolattice.spatial_analysis.spatialcausal.datasets.simulate_spatial_heterogeneity |
Binary treatment whose effect varies smoothly over space. |
geolattice.spatial_analysis.spatialcausal.datasets.simulate_staggered_spillover |
Staggered adoption with dynamic direct effects and spatial spillovers. |
geolattice.spatial_analysis.spatialcausal.datasets.simulate_synthetic_control |
One treated unit at the centre; nearby units get a decaying spillover. |
Spatial statistics
Spatial weights, ESDA, geographically weighted models, point patterns, spatial regression, interpolation, sampling and Bayesian disease mapping.
import geolattice.spatial_statistics
geolattice.spatial_statistics.core
geolattice.spatial_statistics.core.
Classes
| Name | Description |
|---|---|
geolattice.spatial_statistics.SpatialData |
Thin wrapper around a GeoDataFrame with CRS, geometry type, and variable roles. Methods: X_array, coords_array, crs, ensure_projected, from_frame, gdf, geometry_type, n, set_roles, to_crs, y_array. |
geolattice.spatial_statistics.SpatialResult |
Base class for analysis results. Methods: get, plot, stats, summary, to_frame. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.core.coords_from_geometry |
Extract (x, y) coordinate array from a GeoSeries or GeoDataFrame. |
geolattice.spatial_statistics.core.ensure_projected |
Return a projected GeoDataFrame. |
geolattice.spatial_statistics.core.euclidean_distance_matrix |
Compute n×n Euclidean distance matrix. |
geolattice.spatial_statistics.core.euclidean_distances |
Pairwise Euclidean distances between two coordinate sets. |
geolattice.spatial_statistics.core.haversine_distance_matrix |
Great-circle distance matrix in kilometres. |
geolattice.spatial_statistics.core.is_geographic |
Return True if CRS is geographic (lat/lon). |
geolattice.spatial_statistics.core.is_projected |
Return True if CRS is projected. |
geolattice.spatial_statistics.core.normalize_coords |
Scale coordinates to [0, 1] per axis. |
geolattice.spatial_statistics.core.pairwise_distances |
Dispatch distance computation. |
geolattice.spatial_statistics.core.to_crs |
Reproject a GeoDataFrame to crs. |
geolattice.spatial_statistics.core.validate_crs |
Validate and normalize a CRS specification. |
geolattice.spatial_statistics.weights
geolattice.spatial_statistics.weights.
Classes
| Name | Description |
|---|---|
geolattice.spatial_statistics.W |
Sparse spatial weights matrix. Methods: cardinalities, from_libpysal, from_sparse, is_symmetric, islands, lag, n_components, sparse, summary, to_libpysal, transform, transform_type. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.weights.Delaunay |
Delaunay triangulation adjacency weights. |
geolattice.spatial_statistics.weights.DistanceBand |
Distance-band weights: neighbors within threshold. |
geolattice.spatial_statistics.weights.Gabriel |
Gabriel graph: edge (i,j) if no point lies in the diameter circle of i-j. |
geolattice.spatial_statistics.weights.higher_order |
K-order contiguity from an existing weights object. |
geolattice.spatial_statistics.weights.Kernel |
Kernel-based distance weights (Gaussian, triangular, bisquare). |
geolattice.spatial_statistics.KNN |
k-nearest neighbor weights. |
geolattice.spatial_statistics.Queen |
Queen contiguity weights (share edge or vertex). |
geolattice.spatial_statistics.weights.RelativeNeighborhood |
Relative neighborhood graph (RNG): edge (i,j) if no k is closer to both than i and j are to each other. |
geolattice.spatial_statistics.Rook |
Rook contiguity weights (share edge of positive length). |
geolattice.spatial_statistics.esda
geolattice.spatial_statistics.esda.
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.esda.conditional_permutation |
Conditional (randomization) permutation test. |
geolattice.spatial_statistics.esda.fdr_bh |
Benjamini-Hochberg FDR correction. |
geolattice.spatial_statistics.esda.G_Local |
Getis-Ord Gi (star=False) or Gi* (star=True). |
geolattice.spatial_statistics.Geary |
Global Geary’s C. |
geolattice.spatial_statistics.esda.Geary_Local |
Local Geary’s C. |
geolattice.spatial_statistics.GeneralG |
Getis-Ord General G statistic. |
geolattice.spatial_statistics.esda.Join_Counts |
Binary join count statistics (BB, WW, BW). |
geolattice.spatial_statistics.Moran |
Global Moran’s I. |
geolattice.spatial_statistics.esda.Moran_Diff |
Differential Moran’s I on y_t - y_t0 (e.g. change between two periods). |
geolattice.spatial_statistics.Moran_Local |
Local Moran’s I (Anselin LISA). |
geolattice.spatial_statistics.esda.Moran_Local_BV |
Bivariate local Moran’s I (bivariate LISA). |
geolattice.spatial_statistics.esda.MoranBV |
Bivariate Moran’s I: correlation of x with spatial lag of y. |
geolattice.spatial_statistics.gwmodel
Geographically Weighted Modeling (geolattice.spatial_statistics.gwmodel).
Classes
| Name | Description |
|---|---|
geolattice.spatial_statistics.ComputeConfig |
Global compute settings for PyGWmodel heavy workloads. Methods: joblib_prefer, lightgbm_params, resolved_n_jobs, resolved_torch_threads, xgboost_params. |
geolattice.spatial_statistics.GNNWR |
Geographically Neural Network Weighted Regression (GNNWR). Methods: fit, get_params, predict, score, set_params. |
geolattice.spatial_statistics.GTNNWR |
Geographically and Temporally Neural Network Weighted Regression (GTNNWR). Methods: fit, get_params, predict, score, set_params. |
geolattice.spatial_statistics.GTWR |
Geographically and Temporally Weighted Regression (GTWR). Methods: fit, get_params, predict, score, set_params. |
geolattice.spatial_statistics.GWGLM |
Geographically Weighted Generalised Linear Model. Methods: fit, get_params, predict, score, set_params. |
geolattice.spatial_statistics.GWLightGBM |
Geographically Weighted LightGBM. Methods: fit, get_params, predict, score, set_params. |
geolattice.spatial_statistics.GWPCA |
Geographically Weighted PCA. Methods: fit. |
geolattice.spatial_statistics.GWR |
Geographically Weighted Regression. Methods: fit, get_params, local_significance, monte_carlo_test, predict, score, set_params, summary. |
geolattice.spatial_statistics.GWRandomForest |
Geographically Weighted Random Forest. Methods: feature_importance_map, fit, get_params, predict, score, set_params. |
geolattice.spatial_statistics.GWSS |
Geographically Weighted Summary Statistics. Methods: fit, to_dataframe. |
geolattice.spatial_statistics.GWXGBoost |
Geographically Weighted XGBoost. Methods: fit, get_params, predict, score, set_params. |
geolattice.spatial_statistics.MGWR |
Multiscale Geographically Weighted Regression (MGWR). Methods: fit, get_params, predict, score, set_params, summary. |
geolattice.spatial_statistics.NetworkGWR |
GWR using network shortest-path distances. Methods: fit, get_params, local_significance, monte_carlo_test, predict, score, set_params, summary. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.get_compute_config |
Return the active global compute configuration. |
geolattice.spatial_statistics.set_compute_options |
Configure global CPU/GPU options for all subsequent model fits. |
geolattice.spatial_statistics.viz
geolattice.spatial_statistics.viz.
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.viz.choropleth |
Plot a classified choropleth. |
geolattice.spatial_statistics.viz.lisa_cluster_map |
Plot LISA cluster labels on a GeoDataFrame. |
geolattice.spatial_statistics.viz.moran_scatter |
Moran scatterplot of standardized y vs spatial lag. |
geolattice.spatial_statistics.datasets
geolattice.spatial_statistics.datasets.
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.datasets.load_beijing_pm25 |
Signature: load_beijing_pm25(as_gdf: 'bool' = True). |
geolattice.spatial_statistics.datasets.load_georgia |
Signature: load_georgia(as_gdf: 'bool' = True). |
geolattice.spatial_statistics.datasets.load_lattice |
Regular square lattice with a spatially autocorrelated attribute. |
geolattice.spatial_statistics.datasets.load_londonhouse |
Signature: load_londonhouse(as_gdf: 'bool' = True). |
geolattice.spatial_statistics.datasets.load_ncovid |
Signature: load_ncovid(as_gdf: 'bool' = True). |
geolattice.spatial_statistics.datasets.load_points_csr |
Homogeneous Poisson (CSR) point pattern in the unit square. |
geolattice.spatial_statistics.gwmodel.core
Classes
| Name | Description |
|---|---|
geolattice.spatial_statistics.gwmodel.core.AnisotropicKernel |
Directional anisotropic kernel with elliptical decay. Methods: weights_for_point. |
geolattice.spatial_statistics.gwmodel.core.BandwidthSelector |
Bandwidth selector using golden-section search or grid search. Methods: golden_section, grid_search, select. |
geolattice.spatial_statistics.gwmodel.core.BaseGWModel |
Abstract base for all geographically weighted models. Methods: fit, get_params, predict, score, set_params. |
geolattice.spatial_statistics.gwmodel.core.GWClassifier |
Base class for geographically weighted classifiers. Methods: fit, get_params, predict, predict_proba, score, set_params. |
geolattice.spatial_statistics.gwmodel.core.GWEnsemble |
Base class for geographically weighted ensemble models. Methods: fit, get_params, predict, score, set_params. |
geolattice.spatial_statistics.gwmodel.core.GWRegressor |
Base class for geographically weighted regression models. Methods: fit, get_params, predict, score, set_params. |
geolattice.spatial_statistics.gwmodel.core.SpatialKernel |
Unified spatial kernel interface. Methods: weights_for_point. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.gwmodel.core.bisquare |
Bi-square kernel: w = (1-(d/h)2)2 for d < h, else 0. |
geolattice.spatial_statistics.gwmodel.core.boxcar |
Boxcar kernel: w = 1 for d <= h, else 0. |
geolattice.spatial_statistics.gwmodel.core.exponential |
Exponential kernel: w = exp(-d/h). |
geolattice.spatial_statistics.gwmodel.core.gaussian |
Gaussian kernel: w = exp(-(d/h)^2). |
geolattice.spatial_statistics.gwmodel.core.triangular |
Triangular kernel: w = 1 - d/h for d < h, else 0. |
geolattice.spatial_statistics.gwmodel.core.tricube |
Tri-cube kernel: w = (1-(d/h)3)3 for d < h, else 0. |
geolattice.spatial_statistics.gwmodel.linear
Classes
| Name | Description |
|---|---|
geolattice.spatial_statistics.gwmodel.linear.MixedGWR |
Mixed (Semiparametric) GWR. Methods: fit, get_params, predict, score, set_params. |
geolattice.spatial_statistics.gwmodel.diagnostics
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.gwmodel.diagnostics.f3_test |
F3 test for spatial non-stationarity of coefficient surfaces (Leung et al. 2000). |
geolattice.spatial_statistics.gwmodel.diagnostics.local_condition_number |
Compute local condition number of the weighted design matrix X’W(i)X at each calibration point. |
geolattice.spatial_statistics.gwmodel.diagnostics.local_vif |
Compute local variance inflation factors (VIF) at each calibration point. |
geolattice.spatial_statistics.gwmodel.diagnostics.monte_carlo_variability |
Monte Carlo test for spatial variability of coefficient surfaces. |
geolattice.spatial_statistics.gwmodel.diagnostics.moran_test |
Moran’s I test for spatial autocorrelation in residuals. |
geolattice.spatial_statistics.gwmodel.visualization
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.gwmodel.visualization.plot_bandwidth_search |
Plot AICc (or other criterion) vs bandwidth from a BandwidthSelector trace. |
geolattice.spatial_statistics.gwmodel.visualization.plot_local_coefficients |
Choropleth maps of local coefficient surfaces. |
geolattice.spatial_statistics.gwmodel.visualization.plot_local_importance |
Choropleth maps of spatially varying feature importances (for ensemble models). |
geolattice.spatial_statistics.gwmodel.visualization.plot_residuals |
Map GWR residuals. |
geolattice.spatial_statistics.gwmodel.datasets
geolattice.spatial_statistics.gwmodel.datasets.
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.gwmodel.datasets.load_beijing_pm25 |
Simulated Beijing PM2.5 dataset with meteorological covariates. |
geolattice.spatial_statistics.gwmodel.datasets.load_georgia |
Simulated Georgia (USA) educational attainment dataset. |
geolattice.spatial_statistics.gwmodel.datasets.load_londonhouse |
Simulated London house prices dataset. |
geolattice.spatial_statistics.gwmodel.datasets.load_ncovid |
Simulated US county COVID mortality dataset for GTNNWR demonstration. |
geolattice.spatial_statistics.gwmodel.utils
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.gwmodel.utils.aic |
Standard AIC. |
geolattice.spatial_statistics.gwmodel.utils.aicc |
Corrected Akaike Information Criterion. |
geolattice.spatial_statistics.gwmodel.utils.bh_correction |
Benjamini-Hochberg false discovery rate correction. |
geolattice.spatial_statistics.gwmodel.utils.bic |
Bayesian Information Criterion. |
geolattice.spatial_statistics.gwmodel.utils.chunk_indices |
Split n indices into n_jobs roughly equal chunks. |
geolattice.spatial_statistics.gwmodel.utils.configure_torch_threads |
Set PyTorch / OpenMP thread counts for CPU inference/training. |
geolattice.spatial_statistics.gwmodel.utils.coords_from_geometry |
Extract (x, y) coordinate array from a GeoSeries or GeoDataFrame geometry column. |
geolattice.spatial_statistics.gwmodel.utils.effective_df |
Effective degrees of freedom from hat matrix trace. |
geolattice.spatial_statistics.gwmodel.utils.euclidean_distance_matrix |
Compute n×n Euclidean distance matrix efficiently. |
geolattice.spatial_statistics.gwmodel.utils.hat_matrix_gwr |
Compute n×n hat matrix row for a single GWR calibration point. |
geolattice.spatial_statistics.gwmodel.utils.haversine_distance_matrix |
Compute n×n great-circle distance matrix in kilometres. |
geolattice.spatial_statistics.gwmodel.utils.local_r2 |
Weighted local R² at a calibration point. |
geolattice.spatial_statistics.gwmodel.utils.normalize_coords |
Scale coordinates to [0, 1] range (per axis). |
geolattice.spatial_statistics.gwmodel.utils.pairwise_distances |
Dispatch to the correct distance function. |
geolattice.spatial_statistics.gwmodel.utils.parallel_calibrate |
Run fn(i, **kwargs) for each index in parallel. |
geolattice.spatial_statistics.gwmodel.utils.parallel_map |
Run delayed tasks in parallel using global compute settings. |
geolattice.spatial_statistics.gwmodel.utils.resolve_n_jobs |
Map -1 / 0 to the number of available CPUs. |
geolattice.spatial_statistics.gwmodel.utils.resolve_torch_device |
Return a torch.device for deep-learning models. |
geolattice.spatial_statistics.gwmodel.utils.t_to_p |
Convert t-statistics to two-tailed p-values. |
geolattice.spatial_statistics.pointpattern
geolattice.spatial_statistics.pointpattern.
Classes
| Name | Description |
|---|---|
geolattice.spatial_statistics.pointpattern.EnvelopeResult |
Observed summary function with simulation envelopes and global CSR tests. Methods: get, plot, stats, summary, test, to_frame. |
geolattice.spatial_statistics.pointpattern.FunctionResult |
A summary function f(r) with its CSR-theoretical curve. Methods: estimate, get, plot, stats, summary, to_frame. |
geolattice.spatial_statistics.pointpattern.KDEResult |
Kernel intensity surface on a regular grid (rows = y ascending, cols = x ascending). Methods: at, extent, get, integral, plot, stats, summary, to_frame. |
geolattice.spatial_statistics.pointpattern.PointPattern |
A set of event locations observed in a window, with optional marks. Methods: area, by_mark, deduplicate, from_gdf, intensity, jitter, n, n_duplicates, plot, subset, to_frame. |
geolattice.spatial_statistics.pointpattern.QuadratResult |
Base class for analysis results. Methods: get, plot, stats, summary, to_frame. |
geolattice.spatial_statistics.pointpattern.Window |
Observation window (a polygon, or a rectangle in the common case). Methods: contains, convex_hull, distance_to_boundary, from_bounds, from_gdf, from_points, raster, sample, set_covariance, short_side. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.pointpattern.bandwidth_cv |
Likelihood cross-validation bandwidth for a Gaussian kernel. |
geolattice.spatial_statistics.pointpattern.bandwidth_scott |
Scott’s rule for a 2-D Gaussian kernel: σ · n^(-1/6) (σ = mean coordinate s.d.). |
geolattice.spatial_statistics.pointpattern.clark_evans |
Clark-Evans nearest-neighbour test of CSR. |
geolattice.spatial_statistics.pointpattern.cross_k |
Bivariate (cross) K function between two mark types: the expected number of mark_j events within r of a typical mark_i event, divided by the mark_j intensity. |
geolattice.spatial_statistics.pointpattern.envelope |
Monte Carlo envelope for a summary function under a null model. |
geolattice.spatial_statistics.pointpattern.f_function |
Empty-space function F(r) = P(distance from a random location to the nearest event ≤ r). |
geolattice.spatial_statistics.pointpattern.g_function |
Nearest-neighbour distance distribution G(r) = P(d_i ≤ r). |
geolattice.spatial_statistics.pointpattern.intensity_at_points |
Gaussian-kernel intensity evaluated at each event, optionally leaving the event itself out (as required for inhomogeneous K-function estimation). |
geolattice.spatial_statistics.pointpattern.j_function |
J(r) = (1 - G(r)) / (1 - F(r)). |
geolattice.spatial_statistics.pointpattern.k_inhom |
Inhomogeneous K function (Baddeley-Møller-Waagepetersen): K after removing the effect of a known or estimated spatially varying intensity, so that K_inhom(r) = π r² for an inhomogeneous Poisson process. |
geolattice.spatial_statistics.pointpattern.kde |
Kernel estimate of the first-order intensity λ(u). |
geolattice.spatial_statistics.pointpattern.nearest_neighbor_distances |
Distance from each event to its nearest other event. |
geolattice.spatial_statistics.pointpattern.pair_correlation |
Pair correlation function g(r) = K'(r) / (2π r), estimated by kernel smoothing of pair distances (Epanechnikov kernel). |
geolattice.spatial_statistics.pointpattern.quadrat_test |
Quadrat-count chi-square test of complete spatial randomness. |
geolattice.spatial_statistics.pointpattern.relative_risk |
Kernel relative-risk surface f_cases(u) / f_controls(u) (spatial densities, not intensities). |
geolattice.spatial_statistics.pointpattern.ripley_k |
Ripley’s K function: the expected number of further events within distance r of a typical event, divided by the intensity. |
geolattice.spatial_statistics.pointpattern.ripley_l |
Variance-stabilised L(r) = sqrt(K(r)/π); equals r under CSR (plot L(r) - r). |
geolattice.spatial_statistics.pointpattern.simulate_csr |
Complete spatial randomness in window. |
geolattice.spatial_statistics.pointpattern.simulate_matern_inhibition |
Matérn type-II hard-core process: a Poisson pattern in which, of any two events closer than radius, the later-marked one is deleted. |
geolattice.spatial_statistics.pointpattern.simulate_thomas |
Thomas cluster process: Poisson parent points (intensity kappa), each with Poisson(mu) offspring displaced by an isotropic Gaussian (s.d. |
geolattice.spatial_statistics.interpolate
geolattice.spatial_statistics.interpolate.
Classes
| Name | Description |
|---|---|
geolattice.spatial_statistics.interpolate.Cokriging |
Ordinary cokriging of one primary variable and one secondary. Methods: fit, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.ColocatedCokriging |
Colocated cokriging under the Markov model MM1 (Xu et al., 1992). Methods: fit, predict. |
geolattice.spatial_statistics.interpolate.CrossVariogramModel |
Cross-semivariogram γ₁₂(h) = nugget + psill · g(h / range) for h > 0. Methods: gamma, sill. |
geolattice.spatial_statistics.interpolate.CVResult |
Cross-validation predictions and error summaries. Methods: get, plot, stats, summary, to_frame. |
geolattice.spatial_statistics.interpolate.GAMRegressor |
Additive model f(X) = β₀ + Σⱼ sⱼ(Xⱼ) with one spline smooth per column. Methods: fit, get_params, predict, set_params. |
geolattice.spatial_statistics.interpolate.Grid |
A regular prediction grid; coords lists the cell centres row by row (y ascending). Methods: extent, shape, to_frame, to_raster. |
geolattice.spatial_statistics.interpolate.IDW |
Inverse-distance weighting: ẑ(s) = Σ w_i z_i / Σ w_i with w_i = d_i^(-power). Methods: clone, fit, get_params, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.IndicatorKriging |
Ordinary indicator kriging. Methods: etype, fit, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.Interpolator |
Base class: fit(coords, values) then predict(new_coords). Methods: clone, fit, get_params, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.MultivariateCokriging |
Ordinary cokriging of a primary variable with any number of secondaries. Methods: fit, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.NearestNeighbor |
Value of the nearest observation. Methods: clone, fit, get_params, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.OrdinaryKriging |
Ordinary kriging: the best linear unbiased predictor under an unknown constant mean, with the kriging (prediction) variance. Methods: clone, fit, get_params, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.RBF |
Radial-basis-function interpolation; kernel='thin_plate_spline' gives a smooth thin-plate surface. Methods: clone, fit, get_params, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.RegressionKriging |
Regression kriging: fit a trend in the covariates, then ordinary-krige the residuals. Methods: feature_importances_, fit, predict. |
geolattice.spatial_statistics.interpolate.SimpleKriging |
Simple kriging: the best linear predictor when the mean is known. Methods: clone, fit, get_params, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.Thiessen |
Proximity analysis by Thiessen (Voronoi) polygons. Methods: clone, fit, get_params, polygons, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.ThinPlateSpline |
Thin-plate spline: the smooth surface of minimum bending energy through the samples. Methods: clone, fit, get_params, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.TIN |
Piecewise-linear interpolation on the Delaunay triangulation (a TIN surface). Methods: clone, fit, get_params, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.TrendSurface |
Global polynomial trend surface of total degree degree. Methods: clone, fit, get_params, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.UniversalKriging |
Universal kriging: ordinary kriging with a polynomial drift in the coordinates. Methods: clone, fit, get_params, predict, predict_grid. |
geolattice.spatial_statistics.interpolate.VariogramModel |
Parametric semivariogram γ(h) = nugget + psill · g(h / range) for h > 0 (γ(0) = 0). Methods: gamma, plot, sill. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.interpolate.areal_weighting |
Area-weighted interpolation from source polygons to target polygons. |
geolattice.spatial_statistics.interpolate.as_xy |
Coordinates as an (n, 2) float array (ndarray, DataFrame with x/y, or point GeoDataFrame/GeoSeries). |
geolattice.spatial_statistics.interpolate.check_lmc_validity |
Positive-semidefinite check for the coregionalization matrices of an LMC. |
geolattice.spatial_statistics.interpolate.compare_methods |
Cross-validated error table for several interpolators (same folds for all). |
geolattice.spatial_statistics.interpolate.cross_validate |
Cross-validate an interpolator. |
geolattice.spatial_statistics.interpolate.dasymetric |
Dasymetric interpolation: like areal_weighting, but a point layer of ancillary information (e.g. populated places, buildings, land-cover cells) replaces the assumption of uniform density. |
geolattice.spatial_statistics.interpolate.empirical_cross_variogram |
Cross-semivariogram γ̂₁₂(h) = 1/(2 N(h)) Σ (z₁ᵢ − z₁ⱼ)(z₂ᵢ − z₂ⱼ). |
geolattice.spatial_statistics.interpolate.empirical_indicator_variogram |
Empirical variogram of the indicator at threshold. |
geolattice.spatial_statistics.interpolate.empirical_variogram |
Matheron’s classical estimator γ̂(h) = 1/(2 N(h)) Σ (z_i - z_j)² in equal-width distance bins. |
geolattice.spatial_statistics.interpolate.enforce_quantile_monotonicity |
Sort quantile-regression predictions so a lower quantile stays below a higher one. |
geolattice.spatial_statistics.interpolate.etype_estimate |
E-type (conditional expectation) from indicator-kriging probabilities. |
geolattice.spatial_statistics.interpolate.fit_cross_variogram |
Least-squares fit of a cross-variogram. |
geolattice.spatial_statistics.interpolate.fit_indicator_variogram |
Fit a variogram model to the indicator at threshold. |
geolattice.spatial_statistics.interpolate.fit_lmc |
Fit auto- and cross-variograms under a one-structure linear model of coregionalization. |
geolattice.spatial_statistics.interpolate.fit_variogram |
Weighted least-squares fit of a variogram model to an empirical variogram (Cressie’s weights N(h) / γ_model(h)², which favour short lags with many pairs). |
geolattice.spatial_statistics.interpolate.fit_variogram_auto |
Fit each candidate model and keep the one with the smallest weighted residual sum of squares. |
geolattice.spatial_statistics.interpolate.grid_search |
Try every combination of param_grid and rank by cross-validated metric. |
geolattice.spatial_statistics.interpolate.indicator_transform |
Code a continuous sample as an indicator. |
geolattice.spatial_statistics.interpolate.make_grid |
Regular grid over a region. |
geolattice.spatial_statistics.interpolate.Spline |
Thin-plate spline (an RBF with the thin-plate kernel). |
geolattice.spatial_statistics.interpolate.thiessen_polygons |
Thiessen (Voronoi) polygons: one cell per sample, containing every location closer to that sample than to any other. |
geolattice.spatial_statistics.regression
geolattice.spatial_statistics.regression.
Classes
| Name | Description |
|---|---|
geolattice.spatial_statistics.regression.LMResult |
Lagrange Multiplier diagnostics for spatial dependence in OLS residuals. Methods: get, plot, recommendation, stats, summary, to_frame. |
geolattice.spatial_statistics.regression.OLS |
Ordinary least squares regression with spatial diagnostics. Methods: aic, bic, breusch_pagan, coef_frame, condition_number, diagnostics, get, jarque_bera, lm_tests, plot, pseudo_r2, residual_moran, stats, summary, to_frame. |
geolattice.spatial_statistics.regression.RegressionResult |
Shared behaviour of fitted regression models (OLS, SLM, SEM, …). Methods: aic, bic, coef_frame, get, plot, pseudo_r2, residual_moran, stats, summary, to_frame. |
geolattice.spatial_statistics.regression.SpatialError |
Spatial error model (SEM), fitted by maximum likelihood:: Methods: aic, bic, coef_frame, get, plot, pseudo_r2, residual_moran, stats, summary, to_frame. |
geolattice.spatial_statistics.regression.SpatialLag |
Spatial lag model (SAR / SLM), fitted by maximum likelihood:: Methods: aic, bic, coef_frame, get, impacts, plot, pseudo_r2, residual_moran, stats, summary, to_frame. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.regression.breusch_pagan |
Koenker (studentised) Breusch-Pagan test for heteroskedasticity: n R² of the regression of squared residuals on the regressors (χ² with k-1 d.f.). |
geolattice.spatial_statistics.regression.compare_models |
Side-by-side comparison of fitted models. |
geolattice.spatial_statistics.regression.condition_number |
Multicollinearity condition number (columns scaled to unit length). |
geolattice.spatial_statistics.regression.jarque_bera |
Jarque-Bera test of normality of residuals (χ² with 2 d.f.). |
geolattice.spatial_statistics.regression.lm_tests |
Lagrange Multiplier tests for spatial dependence (Anselin et al. 1996). |
geolattice.spatial_statistics.regression.lr_test |
Likelihood-ratio test between nested models fitted by ML/OLS on the same data and weights, e.g. |
geolattice.spatial_statistics.regression.moran_residuals |
Moran’s I for OLS residuals with the exact moments of Cliff & Ord (1981). |
geolattice.spatial_statistics.regression.SLX |
SLX model: OLS with spatially lagged regressors (lag_x=True). |
geolattice.spatial_statistics.regression.SpatialDurbin |
Spatial Durbin model: SpatialLag with spatially lagged regressors (slx=True). |
geolattice.spatial_statistics.bayes
geolattice.spatial_statistics.bayes.
Classes
| Name | Description |
|---|---|
geolattice.spatial_statistics.bayes.BYM |
Bayesian spatial smoothing of small-area counts with a BYM model. Methods: exceedance, get, plot, posterior_draws, shrinkage, stats, summary, to_frame. |
geolattice.spatial_statistics.bayes.EBResult |
Empirical Bayes estimates. Methods: get, plot, stats, summary, to_frame. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.bayes.eb_gamma_poisson |
Global gamma-Poisson empirical Bayes. |
geolattice.spatial_statistics.bayes.eb_james_stein |
Normal shrinkage of noisy estimates x_i ~ N(θ_i, σ_i²) toward their common mean. |
geolattice.spatial_statistics.bayes.eb_local |
Spatial (local) empirical Bayes, after Marshall (1991). |
geolattice.spatial_statistics.bayes.ess |
Effective sample size (Geyer’s initial monotone sequence) for draws of shape (chains, draws). |
geolattice.spatial_statistics.bayes.evaluate_smoothing |
Score estimators against a known true risk surface. |
geolattice.spatial_statistics.bayes.excess_pvalue |
One-sided exact Poisson p-value P(X >= O \| RR = 1) for an excess of cases. |
geolattice.spatial_statistics.bayes.expected_counts |
Expected counts by indirect standardisation. |
geolattice.spatial_statistics.bayes.funnel_limits |
Funnel-plot control limits for the SMR under RR = 1 (exact Poisson quantiles). |
geolattice.spatial_statistics.bayes.icar_scaling_factor |
Sørbye-Rue (2014) scaling factor s: the geometric mean of the marginal variances of the ICAR field with unit precision. |
geolattice.spatial_statistics.bayes.icar_structure |
Binary adjacency structure of a geolattice.spatial_statistics.weights.W for an ICAR prior. |
geolattice.spatial_statistics.bayes.pymc_available |
Signature: pymc_available() -> 'bool'. |
geolattice.spatial_statistics.bayes.rhat |
Split-R̂ (Gelman-Rubin) for draws of shape (chains, draws); values ≲ 1.01 indicate convergence. |
geolattice.spatial_statistics.bayes.shrinkage_summary |
Per-area account of what smoothing did. |
geolattice.spatial_statistics.bayes.simulate_counts |
Draw O_i ~ Poisson(E_i θ_i). |
geolattice.spatial_statistics.bayes.simulate_relative_risk |
Draw a spatially smooth true relative-risk surface for simulation studies. |
geolattice.spatial_statistics.bayes.smr |
Standardised morbidity/mortality ratio O / E (the crude relative risk). |
geolattice.spatial_statistics.bayes.smr_confidence_interval |
Exact (Garwood) Poisson confidence interval for the SMR. |
geolattice.spatial_statistics.sampling
geolattice.spatial_statistics.sampling.
Classes
| Name | Description |
|---|---|
geolattice.spatial_statistics.sampling.EstimateResult |
Point estimate of a population mean (and total) with its standard error and CI. Methods: get, plot, stats, summary, to_frame. |
geolattice.spatial_statistics.sampling.SpatialSample |
A sample drawn from a finite sampling frame. Methods: coords, get, n, plot, stats, summary, take, to_frame, weights. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.sampling.as_coords |
Coordinates (N, 2) of a sampling frame: ndarray, DataFrame with x/y, or GeoDataFrame. |
geolattice.spatial_statistics.sampling.clhs |
Conditioned Latin hypercube sampling (Minasny & McBratney 2006). |
geolattice.spatial_statistics.sampling.compare_designs |
evaluate_design for several designs; adds deff = (Monte Carlo variance)/(variance of the first design), so list simple random sampling first to get design effects relative to SRS. |
geolattice.spatial_statistics.sampling.coverage_metrics |
Geometric quality of a sample: balance (Stevens-Olsen B), mean_dist_to_sample and max_dist_to_sample (from every frame unit to its nearest sampled unit, the quantity a kriging-oriented design tries to minimise) and min_spacing… |
geolattice.spatial_statistics.sampling.design_effect |
deff = Var(design) / Var(SRS of the same size): < 1 means the design is more efficient. |
geolattice.spatial_statistics.sampling.effective_sample_size |
Effective number of independent observations in n spatially autocorrelated ones. |
geolattice.spatial_statistics.sampling.estimate_mean |
Estimate the finite-population mean of y from a probability sample. |
geolattice.spatial_statistics.sampling.evaluate_design |
Repeatedly draw a sample from a fully known population and score the estimator. |
geolattice.spatial_statistics.sampling.grid_points |
Systematic grid of locations in a continuous region (random origin). |
geolattice.spatial_statistics.sampling.grts |
Spatially balanced sample by random-hierarchical-address ordering and systematic PPS selection (the core of GRTS; Stevens & Olsen 2004). |
geolattice.spatial_statistics.sampling.local_mean_variance |
Local-mean variance estimator of the Horvitz-Thompson total Σ z_i (z_i = y_i / π_i) for spatially balanced samples (Stevens & Olsen 2003; Grafström & Schelin 2014). |
geolattice.spatial_statistics.sampling.neyman_allocation |
Optimal (Neyman) allocation n_h ∝ N_h σ_h with a floor and largest-remainder rounding. |
geolattice.spatial_statistics.sampling.sample_size_mean |
Sample size to estimate a mean to within ± margin at confidence conf: n0 = deff · (z σ / margin)² with the finite-population correction n = n0 / (1 + n0/N). |
geolattice.spatial_statistics.sampling.simple_random |
Simple random sample without replacement: π_i = n / N. |
geolattice.spatial_statistics.sampling.space_filling |
Purposive design that covers the study area evenly (for model-based inference, e.g. choosing monitoring sites for kriging). |
geolattice.spatial_statistics.sampling.spatial_balance |
Stevens-Olsen (2004) spatial balance statistic B. |
geolattice.spatial_statistics.sampling.spatial_order |
Permutation that orders units along a space-filling path (‘hilbert’) or an axis (‘x’, ‘y’). |
geolattice.spatial_statistics.sampling.stratified |
Stratified random sample. |
geolattice.spatial_statistics.sampling.systematic |
Systematic sample from a frame ordered along a path: pick a random start and then every k = N/n-th unit. |
geolattice.spatial_statistics.sampling.two_stage |
Two-stage cluster sample: n_clusters primary units (e.g. counties) drawn by SRS, then n_per_cluster units by SRS inside each (all units if the cluster is smaller). |
geolattice.spatial_statistics.cluster
geolattice.spatial_statistics.cluster.
Classes
| Name | Description |
|---|---|
geolattice.spatial_statistics.cluster.HotSpotResult |
Result of getis_ord_gi. Methods: get, plot, stats, summary, to_frame. |
geolattice.spatial_statistics.cluster.LisaClusterResult |
Result of local_moran_clusters. Methods: get, plot, stats, summary, to_frame. |
geolattice.spatial_statistics.cluster.PointClusterResult |
Attributes ———- labels : ndarray (n,) cluster id (0, 1, …) or -1 for noise summary_frame : DataFrame per-cluster size, centroid, hull area and density Methods: get, plot, stats, summary, to_frame. |
geolattice.spatial_statistics.cluster.RegionResult |
Attributes ———- labels : ndarray (n,) region id (0 … k-1) ssw, sst : float within-region and total sum of squares of the (standardised) attributes r2 : float 1 - ssw / sst (share of attribute variation explained by the regions)… Methods: get, is_contiguous, plot, stats, summary, to_frame. |
geolattice.spatial_statistics.cluster.ScanResult |
Attributes ———- clusters : DataFrame one row per reported cluster: center, radius, n_locations, observed, expected, rr (relative risk inside vs outside), llr, p_value, significant members : list of ndarray… Methods: get, plot, stats, summary, to_frame. |
Functions
| Name | Description |
|---|---|
geolattice.spatial_statistics.cluster.adjust_pvalues |
Multiple-testing adjustment: 'fdr' (Benjamini-Hochberg), 'bonferroni' or 'none'. |
geolattice.spatial_statistics.cluster.agglomerative |
Contiguity-constrained hierarchical clustering: at each step only adjacent clusters may merge (the neighbour graph w is the connectivity constraint). |
geolattice.spatial_statistics.cluster.agreement_matrix |
Pairwise Jaccard indices between named boolean masks (e.g. ’Gi*’ hot spots vs ‘LISA’ HH clusters). |
geolattice.spatial_statistics.cluster.dbscan_clusters |
DBSCAN: a point is core if at least min_samples points (itself included) lie within eps; clusters are the connected sets of core points plus their border points; the rest is noise. |
geolattice.spatial_statistics.cluster.evaluate_regions |
ssw (within-region SS), r2 (share of variation explained) and the mean silhouette. |
geolattice.spatial_statistics.cluster.flag_stability |
Share of runs in which each area is flagged. |
geolattice.spatial_statistics.cluster.getis_ord_gi |
Getis-Ord Gi* (or Gi) hot-spot analysis. |
geolattice.spatial_statistics.cluster.hdbscan_clusters |
HDBSCAN: like DBSCAN across all eps at once, keeping the clusters that persist, so it finds clusters of differing density without tuning eps (needs scikit-learn ≥ 1.3). |
geolattice.spatial_statistics.cluster.jaccard |
Jaccard index of two boolean masks (1 = identical sets of flagged areas; NaN if both empty). |
geolattice.spatial_statistics.cluster.k_distance |
Sorted distance of every point to its k-th nearest neighbour (the “k-distance plot”). |
geolattice.spatial_statistics.cluster.local_moran_clusters |
Local Moran’s I (LISA) cluster / outlier map with proper conditional permutation inference. |
geolattice.spatial_statistics.cluster.partition_agreement |
Adjusted Rand index and normalised mutual information between two partitions (e.g. two regionalisations). |
geolattice.spatial_statistics.cluster.skater |
SKATER (Spatial ’K’luster Analysis by Tree Edge Removal; Assunção et al. 2006). |
geolattice.spatial_statistics.cluster.spatial_scan |
Kulldorff spatial scan statistic with a Poisson model and circular windows. |
Geostatistics
Variograms, kriging, simulation, cross-validation and GSLIB-style helpers, on CPU, GPU (CuPy) or JAX.
import geolattice.geostatistics
geolattice.geostatistics.core
Core geostatistical components: variogram estimation, theoretical models, and kriging.
Classes
| Name | Description |
|---|---|
geolattice.geostatistics.OrdinaryKriging |
Ordinary Kriging with GPU support (CuPy) and block kriging option. Methods: fit, predict. |
geolattice.geostatistics.SimpleKriging |
Simple Kriging with known mean. Methods: fit, predict. |
geolattice.geostatistics.Variogram |
Signature: Variogram(coords, values, model='spherical', estimator='matheron', maxlag=None, n_lags=10, anisotropy=None, use_gpu='auto'). Methods: fit, set_params. |
geolattice.geostatistics.VariogramCloud |
Container for variogram cloud data (pairwise dist, gamma, and point-pair indices). Methods: from_coords, point_pairs. |
Functions
| Name | Description |
|---|---|
geolattice.geostatistics.compute_variogram_cloud |
Compute the variogram cloud: all pairwise distances and semivariances. |
geolattice.geostatistics.covariance_from_variogram |
Covariance C(h) from variogram: C(h) = C(0) - γ(h), with C(0) = nugget + sill. |
geolattice.geostatistics.cubic |
Cubic variogram (Chilès & Delfiner / gstat). |
geolattice.geostatistics.exponential |
Signature: exponential(h, nugget, sill, range_). |
geolattice.geostatistics.fit_indicator_variogram |
Fit empirical indicator variogram and return lags, gamma. |
geolattice.geostatistics.gaussian |
Signature: gaussian(h, nugget, sill, range_). |
geolattice.geostatistics.matern |
Signature: matern(h, nugget, sill, range_, nu=1.5). |
geolattice.geostatistics.plot_variogram_cloud |
Plot variogram cloud (distance vs semivariance) and optionally identify or digitize point pairs. |
geolattice.geostatistics.spherical |
Signature: spherical(h, nugget, sill, range_). |
geolattice.geostatistics.stable |
Signature: stable(h, nugget, sill, range_, alpha=1.0). |
geolattice.geostatistics.jax_variogram_kriging
JAX variograms and kriging for CPU and GPU.
Classes
| Name | Description |
|---|---|
geolattice.geostatistics.JaxCokriging |
Ordinary cokriging of one primary and one secondary variable. Methods: fit, predict. |
geolattice.geostatistics.JaxOrdinaryKriging |
Ordinary kriging on a JAX device (CPU or GPU). Methods: fit, predict. |
geolattice.geostatistics.JaxSimpleKriging |
Simple kriging with a known mean. Methods: fit, predict. |
geolattice.geostatistics.JaxUniversalKriging |
Universal kriging with a polynomial drift. Methods: fit, predict. |
geolattice.geostatistics.JaxVariogram |
Empirical variogram and a fitted theoretical model, evaluated with JAX. Methods: fit, set_params. |
geolattice.geostatistics.ml
Regression kriging with machine-learning trend models.
Classes
| Name | Description |
|---|---|
geolattice.geostatistics.CNNLSTMRegressionKriging |
Convolutional-LSTM trend model + per-time-step kriging of residuals, for a fixed set of monitoring locations observed repeatedly over time. Methods: fit, predict. |
geolattice.geostatistics.ConvLSTM |
Convolutional LSTM (Shi, Chen, Wang, Yeung, Wong & Woo, 2015, https://arxiv.org/abs/1506.04214) + kriging of residuals. Methods: fit, predict. |
geolattice.geostatistics.DCRNN |
Diffusion Convolutional Recurrent Neural Network (Li, Yi, Shahabi & Liu, 2018, https://arxiv.org/abs/1707.01926) + kriging of residuals. Methods: fit, predict. |
geolattice.geostatistics.DeepRegressionKriging |
Deep Regression Kriging: a PyTorch MLP trend model + kriging of residuals. Methods: fit, plot_losses, plot_optuna_history, predict. |
geolattice.geostatistics.DeepRegressionKrigingTF |
Deep Regression Kriging with TensorFlow/Keras for the trend model. Methods: fit, plot_losses, plot_optuna_history, predict. |
geolattice.geostatistics.GAMRegressor |
scikit-learn-compatible wrapper around pyGAM <https://pygam.readthedocs.io>_, fitting a purely additive smooth-term model :math:f(X) = \beta_0 + \sum_j s_j(X_j) – one spline smooth per feature. Methods: fit, get_params, predict, set_params. |
geolattice.geostatistics.GMAN |
Graph Multi-Attention Network (Zheng, Fan, Wang & Qi, 2020, AAAI, https://arxiv.org/abs/1911.08415) + kriging of residuals. Methods: fit, predict. |
geolattice.geostatistics.GNNRegressionKriging |
Plain spatial Graph Neural Network trend model + kriging of residuals. Methods: fit, predict. |
geolattice.geostatistics.IGNNK |
Inductive Graph Neural Network for Kriging (Wu, Cui, Nie & Wang, 2021), adapted from its original spatiotemporal-sensor-network setting to static regression kriging, + kriging of residuals. Methods: fit, predict. |
geolattice.geostatistics.KCN |
Kriging Convolutional Networks (Appleby, Liu & Liu, 2020) + kriging of residuals. Methods: fit, predict. |
geolattice.geostatistics.RegressionKriging |
Regression Kriging = Regression + Kriging of Residuals. Methods: feature_importances_, fit, predict. |
geolattice.geostatistics.RegressionKrigingH2O |
Regression Kriging with H2O-3 for the trend model. Methods: fit, get_best_model_metrics, predict, shutdown. |
geolattice.geostatistics.STGNNRegressionKriging |
Spatio-temporal graph neural network trend model + per-time-step kriging of residuals, for a fixed set of monitoring locations observed repeatedly over time. Methods: fit, predict. |
geolattice.geostatistics.STGTNRegressionKriging |
Spatial-temporal graph Transformer trend model + per-time-step kriging of residuals, for a fixed set of monitoring locations observed repeatedly over time. Methods: fit, predict. |
geolattice.geostatistics.STTN |
Spatial-Temporal Transformer Network (Xu, Dai, Liu, Gao, Lin, Qi & Xiong, 2020, https://arxiv.org/abs/2001.02908) + kriging of residuals. Methods: fit, predict. |
geolattice.geostatistics.TGCN |
Temporal Graph Convolutional Network (Zhao, Song, Zhang, Liu, Wang & Li, 2019, https://arxiv.org/abs/1811.05320) + kriging of residuals. Methods: fit, predict. |
Functions
| Name | Description |
|---|---|
geolattice.geostatistics.enforce_quantile_monotonicity |
Fix “quantile crossing”: given predictions from several independently fitted regressor='quantile' models (e.g. quantile levels 0.1, 0.5, 0.9) at the same locations, sort them point-by-point so a lower quantile is never predicted… |
geolattice.geostatistics.kriging
Kriging estimators beyond ordinary / simple kriging (those live in core).
Classes
| Name | Description |
|---|---|
geolattice.geostatistics.AreaPoissonKriging |
Area-to-area and area-to-point Poisson Kriging of block-support count/rate data, using each area’s actual point support (e.g. population points, see PointSupport) instead of a single representative centroid. Methods: fit, predict_area, predict_points. |
geolattice.geostatistics.BayesianGLMKriging |
Bayesian generalized linear kriging (spatial GLMM) by MCMC. Methods: fit, latent_samples, predict, predict_proba, predictive_samples. |
geolattice.geostatistics.BayesianKriging |
Bayesian kriging with discrete priors on the range and the relative nugget and a conjugate normal-inverse-gamma prior on the trend and variance. Methods: fit, from_variogram, predict, predict_proba, predict_quantiles, predictive_samples, sample_parameters. |
geolattice.geostatistics.BayesianTransformedKriging |
Bayesian transformed Gaussian kriging (De Oliveira, Kedem & Short, 1997) for positive, skewed data: the Box-Cox parameter lambda joins the range and nugget-ratio grid. Methods: fit, from_variogram, predict, predict_proba, predict_quantiles, predictive_samples, sample_parameters. |
geolattice.geostatistics.Cokriging |
Ordinary cokriging (two unbiasedness constraints). Methods: fit, predict. |
geolattice.geostatistics.ColocatedCokriging |
Markov-model colocated cokriging (MM1; Xu et al. 1992). Methods: fit, predict. |
geolattice.geostatistics.ConjugateBayesianKriging |
Bayesian kriging with known correlation (fixed range and nugget ratio): conjugate normal-inverse-gamma posterior for the trend and variance, and a Student-t predictive (Kitanidis, 1986). Methods: fit, from_variogram, predict, predict_proba, predict_quantiles, predictive_samples, sample_parameters. |
geolattice.geostatistics.CrossVariogram |
Empirical and theoretical cross-variogram. Methods: fit, fit_model, set_params. |
geolattice.geostatistics.DisjunctiveKriging |
Disjunctive Kriging: a nonlinear estimator built from a Gaussian anamorphosis + Hermite polynomial expansion under the bi-Gaussian model. Methods: fit, predict, predict_proba. |
geolattice.geostatistics.EmpiricalBayesianKriging |
Empirical Bayesian Kriging: an ensemble of kriging models built from simulate-and-refit semivariograms, combined to propagate semivariogram-parameter uncertainty into the prediction variance and into a genuine mixture-of-Gaussians… Methods: fit, predict, predict_proba. |
geolattice.geostatistics.FactorialKriging |
Factorial Kriging Analysis: estimate individual structures of a nested variogram model, not just their sum. Methods: extract, fit, n_structures, total_sill. |
geolattice.geostatistics.IndicatorKriging |
Ordinary Indicator Kriging with per-threshold variogram support. Methods: fit, predict. |
geolattice.geostatistics.LMC |
Fitted Linear Model of Coregionalization: one spatial structure with a common range and a P x P positive-semidefinite sill matrix B, plus an optional P x P nugget matrix B0. Methods: correlation, cov, gamma, sill. |
geolattice.geostatistics.MultivariateCokriging |
Ordinary full cokriging of a primary variable using one or more secondaries and an LMC. Methods: fit, predict. |
geolattice.geostatistics.PointSupport |
Groups point-support locations (e.g. census population points) by the area (block/polygon) they fall inside. Methods: centroid, coords, from_geodataframes, total, values. |
geolattice.geostatistics.PoissonKriging |
Centroid-based Poisson Kriging of areal count/rate data. Methods: fit, predict, predict_id. |
geolattice.geostatistics.SoftKriging |
Ordinary Markov-Bayes soft (indicator) kriging. Methods: fit, predict. |
geolattice.geostatistics.UniversalKriging |
Universal Kriging (kriging with a polynomial drift/trend). Methods: fit, predict. |
Functions
| Name | Description |
|---|---|
geolattice.geostatistics.bayesian_kriging |
Fit BayesianKriging and return a table of predictive mean, sd and quantiles at coords_pred. |
geolattice.geostatistics.build_grid_3d |
Build the (nxnynz, 3) array of grid-node centers for a GSLIB-style grid definition, in kt3d’s own node order (x fastest, then y, then z). |
geolattice.geostatistics.c_exp |
Exponential covariance C(h) = sill * exp(-h / range). |
geolattice.geostatistics.c_sph |
Spherical covariance C(h) = sill*(1 - 1.5 h/a + 0.5 (h/a)^3), 0 beyond a. |
geolattice.geostatistics.check_lmc_validity |
Cauchy-Schwarz / PSD check for LMC coregionalization matrices. |
geolattice.geostatistics.compute_etype_from_probabilities |
Compute E-type estimate from conditional probabilities. |
geolattice.geostatistics.correlation_function |
Correlation rho(h) = 1 - gamma(h) of a unit-sill, zero-nugget model from MODEL_FUNCS (rho(0) = 1). |
geolattice.geostatistics.covariance_model |
Map ‘Exp’/‘Sph’ to the covariance function (R: covariance.model). |
geolattice.geostatistics.eb_risk |
Empirical-Bayes standardized rate (R: eb.risk). |
geolattice.geostatistics.fit_lmc |
Fit auto- and cross-variograms under a 1-structure LMC. |
geolattice.geostatistics.fit_nested_variogram |
Fit a nugget + nested sum of models structures to the experimental semivariogram of values at coords, via least squares. |
geolattice.geostatistics.fit_poisson_lmc |
Fit an LMC to empirical direct and cross semivariograms (R: fit.lmc via lmc.poisson.cokrige.*). |
geolattice.geostatistics.fit_soft_probability_model |
Calibrate soft probabilities :math:P(I=1 \mid \text{proxy}) from a continuous secondary/proxy variable via logistic regression – a simple, robust default for the calibration step Zhu & Journel’s method requires before Markov-Bayes… |
geolattice.geostatistics.hermite_indicator_coefficients |
Hermite coefficients of the indicator function :math:\mathbf 1_{Y>y_c}: |
geolattice.geostatistics.hermite_polynomials |
Normalized (orthonormal) probabilists’ Hermite polynomials :math:H_0, \dots, H_{n_{max}} evaluated at y: :math:H_0=1,\ H_1(y)=y,\ H_n(y)=\frac{1}{\sqrt n}\big(y H_{n-1}(y)-\sqrt{n-1}\,H_{n-2}(y)\big), satisfying… |
geolattice.geostatistics.indicator_transform |
Convert continuous data to a binary indicator. |
geolattice.geostatistics.kt3d |
Krige value from data onto points (GSLIB’s kt3d program). |
geolattice.geostatistics.kt3d_cross_validate |
Leave-one-out cross-validation: krige each datum’s location from all other data (GSLIB’s kt3d jackknife-against-self option, koption=1). |
geolattice.geostatistics.kt3d_grid |
Convenience wrapper: build a regular grid with build_grid_3d and krige onto it with kt3d. |
geolattice.geostatistics.markov_bayes_calibrate |
Estimate the Markov-Bayes calibration coefficient :math:B = \mathrm{Cov}(I, F) / \mathrm{Var}(F) (Zhu & Journel, 1993) from hard indicator data and co-located (or nearby) soft probability data. |
geolattice.geostatistics.pck_crossvariogram |
Population-weighted cross Poisson semivariogram (R: pck.crossvariogram). |
geolattice.geostatistics.pck_variogram |
Population-weighted direct Poisson semivariogram (R: pck.variogram). |
geolattice.geostatistics.poisson_cokrige |
N-variate Poisson cokriging (generalises poisson.cokrige.bi/three/four). |
geolattice.geostatistics.poisson_krige |
Ordinary univariate Poisson kriging (R: poisson.krige.one). |
geolattice.geostatistics.shared_risk |
Poisson shared risk between two diseases (R: rlk). |
geolattice.geostatistics.spacetime
Space-time geostatistics.
Classes
| Name | Description |
|---|---|
geolattice.geostatistics.STKriging |
Ergonomic wrapper around pygstat.krige_st.krige_st for irregular space-time monitoring-network data (unequal numbers of observations per site, missing time stamps, etc. – no complete grid required, unlike variogram estimation,… Methods: fit, predict, predict_id. |
geolattice.geostatistics.STPoissonKriging |
Spatio-temporal Poisson Kriging of area-year rate/count data. Methods: fit, predict, predict_id. |
Functions
| Name | Description |
|---|---|
geolattice.geostatistics.cov_fn_st |
Spatio-temporal covariance between two point sets. coords_: (n, 2) or (n, 3) spatial coordinates time_: (n,) time values model: StVariogramModel dict (from vgm_st) separate: if True and model is separable and grid_shape_* given,… |
geolattice.geostatistics.empirical_st_variogram |
Matheron-estimator empirical space-time semivariogram of an area x time panel. |
geolattice.geostatistics.extract_par |
Extract free parameters from an StVariogramModel as a 1D array. |
geolattice.geostatistics.extract_par_names |
Return parameter names for the model type (for display). |
geolattice.geostatistics.fit_metric_st_variogram |
Fit a “metric” spatio-temporal variogram model (vgm_st) to an empirical variogram from empirical_st_variogram, using reasonable data-driven starting values. |
geolattice.geostatistics.fit_st_variogram |
Fit a spatio-temporal variogram model to empirical (binned) values. object_df: dict with keys at least ‘dist’ (spatial lag), ‘timelag’, ‘gamma’, ‘np’. |
geolattice.geostatistics.insert_par |
Insert parameter vector into StVariogramModel template; return new model. |
geolattice.geostatistics.joint_nugget_sill_range |
Extract (nugget, sill, range) from a fitted metric (or simpleSumMetric) model’s joint component list, robust to a fitted nugget of exactly 0 – vgm omits the nugget component entirely when nugget == 0, collapsing joint… |
geolattice.geostatistics.krige_st |
Spatio-temporal kriging: main entry. |
geolattice.geostatistics.krige_st_df |
Spatio-temporal kriging: compute predictions (and optionally variance) at new locations. |
geolattice.geostatistics.krige_st_local |
Local spatio-temporal kriging using nearest neighbours in (space, time*st_ani). |
geolattice.geostatistics.krige_st_tg |
Trans-Gaussian spatio-temporal kriging (Box-Cox transform). |
geolattice.geostatistics.krige_st_tg_local |
Local trans-Gaussian ST kriging. |
geolattice.geostatistics.load_atlantic_panel |
Build a long (FIPS, year, rate, x, y, pop) panel from lbc_atlantic.csv (wide rate panel) + lbc_rate.csv (centroid + population per county). |
geolattice.geostatistics.load_ca_pm25_panel |
Build a monthly (site_id, month, x, y, pm25) panel from the daily CA_pm25_2025.csv monitoring-network CSV: aggregates daily concentrations to monthly station means and projects station lat/long to California Albers Equal Area… |
geolattice.geostatistics.make_prediction_grid |
Build a regular cell_size x cell_size grid of point centers covering boundary, clipped to the cells whose center falls inside the boundary polygon(s). |
geolattice.geostatistics.variogram_line |
Evaluate variogram (or covariance) for a variogram model at given distances. model: list of component dicts (from vgm) or single dict with model, psill, range, kappa. dist_vector: array of distances (or 2D array; output shape matches). |
geolattice.geostatistics.variogram_surface |
Compute spatio-temporal variogram (or covariance) surface. dist_grid: dict with keys ‘spacelag’ and ‘timelag’ (arrays of same shape), or array-like of shape (n, 2) with columns [spacelag, timelag]. |
geolattice.geostatistics.vgm |
Build a variogram model structure (list of components), compatible with R’s vgm. |
geolattice.geostatistics.vgm_area_st |
Area-to-point spatio-temporal covariance (e.g. for block kriging). |
geolattice.geostatistics.vgm_st |
Construct a spatio-temporal variogram model (StVariogramModel). st_model: one of “separable”, “productSum”, “productSumOld”, “sumMetric”, “simpleSumMetric”, “metric”. |
geolattice.geostatistics.validation
Model validation and spatial cross-validation.
Classes
| Name | Description |
|---|---|
geolattice.geostatistics.H2OResidualKriging |
Signature: H2OResidualKriging(h2o_model, kriging_model, feature_names). Methods: predict. |
geolattice.geostatistics.IndicatorKrigingCV |
K-fold cross-validation for IndicatorKriging using Brier score. Methods: validate. |
geolattice.geostatistics.KFoldCV_AutoML |
Signature: KFoldCV_AutoML(n_splits=5, max_runtime_secs=30, random_state=42). Methods: validate. |
geolattice.geostatistics.KFoldCV_Cokriging |
K-Fold Cross-Validation wrapper for Cokriging models. Methods: validate. |
geolattice.geostatistics.KFoldCV_H2O_ResidualRK |
K-Fold CV for H2OResidualKriging wrappers. Methods: shutdown, validate. |
geolattice.geostatistics.KFoldCV_H2O_RK |
K-Fold CV for H2O-based Regression Kriging wrappers. Methods: validate. |
geolattice.geostatistics.KFoldCV_PyTorch_RK |
K-Fold Cross-Validation for PyTorch-based Regression Kriging. Methods: validate. |
geolattice.geostatistics.KFoldCV_RK |
Signature: KFoldCV_RK(n_splits=5, random_state=None). Methods: validate. |
geolattice.geostatistics.KFoldCV_TF_RK |
K-Fold CV for TensorFlow-based Regression Kriging. Methods: validate. |
geolattice.geostatistics.LOOCV_AutoML |
Signature: LOOCV_AutoML(/, *args, **kwargs). Methods: validate. |
geolattice.geostatistics.LOOCV_RK |
Signature: LOOCV_RK(/, *args, **kwargs). Methods: validate. |
Functions
| Name | Description |
|---|---|
geolattice.geostatistics.kfold_cv |
K-Fold Cross-Validation for pygstat models. |
geolattice.geostatistics.loo_cv |
Leave-One-Out Cross-Validation for pygstat models. |
geolattice.geostatistics.io
I/O helpers for loading spatial data.
Functions
| Name | Description |
|---|---|
geolattice.geostatistics.from_geodataframe |
Extract coordinates and a value column from a GeoDataFrame. |
geolattice.geostatistics.gslib
GSLIB-equivalent helper utilities.
Functions
| Name | Description |
|---|---|
geolattice.geostatistics.add_coordinates_to_grid |
Build X and Y coordinate arrays for a 2D grid (GSLIB addcoord style). |
geolattice.geostatistics.addcoord |
Add X,Y coordinates to a GSLIB grid file (Python equivalent of addcoord.exe). |
geolattice.geostatistics.back_transform_boxcox |
Inverse of transform_boxcox. |
geolattice.geostatistics.back_transform_log |
Inverse of log: exp. |
geolattice.geostatistics.backtr_transform |
Back-transform values using a lookup table (e.g. from nscore_forward). |
geolattice.geostatistics.declus_cell |
Cell declustering: weight = 1 / (number of points in same cell). |
geolattice.geostatistics.nscore_back |
Back-transform normal scores to original units (inverse of nscore_forward). |
geolattice.geostatistics.nscore_file |
Read GSLIB file, apply normal score transform to one variable, write result. |
geolattice.geostatistics.nscore_forward |
Normal score transform (forward): data -> standard normal. |
geolattice.geostatistics.read_gslib |
Read a GSLIB Geo-EAS file. |
geolattice.geostatistics.read_gslib_grid |
Alias for read_gslib (same format for point or grid data). |
geolattice.geostatistics.transform_boxcox |
Box-Cox: (x^lambda - 1) / lambda for lambda != 0, else log(x). |
geolattice.geostatistics.transform_log |
Log transform; optional floor to avoid log(0). |
geolattice.geostatistics.write_gslib |
Write a GSLIB Geo-EAS file. |
geolattice.geostatistics.simulation
Stochastic simulation of continuous and categorical variables.
Classes
| Name | Description |
|---|---|
geolattice.geostatistics.DirectSequentialSimulator |
Direct sequential (co-)simulator in original units. Methods: fit, simulate. |
geolattice.geostatistics.FFTSimulator |
FFT (circulant embedding) Gaussian simulator on a regular lattice. Methods: conditional_std_, conditioning_xy_, fit, simulate, simulate_lattice. |
geolattice.geostatistics.GaussianCoSimulator |
Sequential Gaussian co-simulator (collocated cokriging, Markov Model 1). Methods: fit, simulate. |
geolattice.geostatistics.GlobalDistribution |
Global cdf F of a variable with the transforms z -> y = G^-1(F(z)) and back, built from (optionally weighted) data. Methods: cdf, from_gaussian, quantile, to_gaussian. |
geolattice.geostatistics.IndicatorCoSimulator |
Sequential indicator (co-)simulator with Markov-Bayes soft data. Methods: fit, simulate. |
geolattice.geostatistics.LUSimulator |
LU (Cholesky) decomposition Gaussian simulator. Methods: fit, simulate. |
geolattice.geostatistics.PluriGaussianSimulator |
Plurigaussian simulator of categorical variables. Methods: fit, simulate. |
geolattice.geostatistics.SimulatedAnnealing |
Simulated annealing simulator. Methods: experimental_variogram, fit, simulate, simulate_lattice, target_variogram. |
geolattice.geostatistics.SoftCalibration |
Calibration of a continuous secondary variable into soft indicators. Methods: fit, transform. |
geolattice.geostatistics.TBSimulator |
Turning bands Gaussian simulator, unconditional or conditioned by kriging. Methods: conditional_std_, conditioning_xy_, fit, simulate. |
geolattice.geostatistics.TruncationRule |
Truncation (lithotype) rule: rectangles in probability space mapped to categories. Methods: classify, from_flag, hierarchical, n_fields, proportions, truncated_gaussian. |
Functions
| Name | Description |
|---|---|
geolattice.geostatistics.category_probabilities |
Per-node frequency of each category code over realizations, shape (n_categories, n_nodes). |
geolattice.geostatistics.category_proportions |
Global proportion of each category code per realization, shape (nsim, n_categories). |
geolattice.geostatistics.dssim_direct |
Direct sequential simulation (or co-simulation with secondary) in one call. |
geolattice.geostatistics.fftsim |
FFT spectral (circulant embedding) simulation on a regular lattice, conditioned by simple or ordinary kriging. |
geolattice.geostatistics.fftsim_unconditional |
Unconditional FFT realizations with mean mean and covariance vario at the lattice prediction_grid; shape (nsim, len(prediction_grid)). |
geolattice.geostatistics.lusim |
LU (Cholesky) decomposition simulation. |
geolattice.geostatistics.lusim_unconditional |
Unconditional Gaussian realizations with mean mean and covariance vario at prediction_grid; shape (nsim, len(prediction_grid)). |
geolattice.geostatistics.order_relations |
Correct a CDF (or a batch of CDFs) for order-relation violations. |
geolattice.geostatistics.pgsim |
Plurigaussian simulation in one call. |
geolattice.geostatistics.residual_covariances |
Build a residual-covariance evaluator for K thresholds. |
geolattice.geostatistics.sasim |
Simulated annealing simulation in one call; see SimulatedAnnealing. |
geolattice.geostatistics.sgcosim |
Sequential Gaussian co-simulation with an exhaustive secondary, in one call. |
geolattice.geostatistics.sgcosim_hierarchical |
Joint co-simulation of two variables known only at the data. |
geolattice.geostatistics.sgsim |
Sequential Gaussian Simulation. |
geolattice.geostatistics.sgsim_gpu |
GPU-accelerated sequential Gaussian simulation. |
geolattice.geostatistics.sicosim |
Sequential indicator co-simulation in one call. |
geolattice.geostatistics.sis_local_means |
Sequential indicator simulation of a continuous variable with local priors. |
geolattice.geostatistics.sisim |
Sequential Indicator Simulation, for a continuous variable. |
geolattice.geostatistics.sk_correction |
Simple-kriging estimate of the K residuals at target. |
geolattice.geostatistics.sklm_cdf |
Local CDFs at points from priors plus data residuals (no sequential path). |
geolattice.geostatistics.tbsim |
Turning bands simulation, conditioned by simple or ordinary kriging. |
geolattice.geostatistics.tbsim_unconditional |
Unconditional turning bands realizations with mean mean and covariance vario at prediction_grid; shape (nsim, len(prediction_grid)). |
geolattice.geostatistics.mps
Multiple-point statistics simulation.
Classes
| Name | Description |
|---|---|
geolattice.geostatistics.DirectSampling |
Direct Sampling multiple-point simulator. Methods: fit, simulate, simulate_lattice. |
geolattice.geostatistics.SNESIM |
SNESIM multiple-point simulator for categorical variables. Methods: fit, simulate, simulate_lattice. |
Functions
| Name | Description |
|---|---|
geolattice.geostatistics.channel_training_image |
Synthetic binary training image of sinuous channels (1) in a background (0), running along axis 0 (x). |
geolattice.geostatistics.connectivity |
Connectivity function: probability that two cells of category a lag h = 1..max_lag cells apart along axis belong to the same connected (4-neighbour) body, given that both are category. |
geolattice.geostatistics.dssim |
Direct Sampling MPS simulation in one call. |
geolattice.geostatistics.pattern_histogram |
Multiple-point histogram: frequency of every size x size (or (sx, sy)) pattern of a categorical image, as {pattern: frequency}. |
geolattice.geostatistics.pattern_histogram_distance |
Total-variation distance between two pattern histograms (0 = identical, 1 = disjoint). |
geolattice.geostatistics.snesim |
SNESIM simulation in one call. |
geolattice.geostatistics.tau_model |
Combine training-image and soft probabilities with the tau model (Journel, 2002): with distances x = (1 - P) / P, |
geolattice.geostatistics.utils
Utilities: backend (CPU/GPU), anisotropy transformation.
Functions
| Name | Description |
|---|---|
geolattice.geostatistics.asarray |
Convert input to array on CPU or GPU. |
geolattice.geostatistics.resolve_torch_device |
Pick a usable torch device. |
geolattice.geostatistics.seed_torch |
Seed PyTorch for reproducible module fits. |
geolattice.geostatistics.to_numpy |
Convert CuPy array to NumPy; no-op if already NumPy. |
geolattice.geostatistics.transform_aniso |
Apply geometric anisotropy transformation. |
Spatial databases
One API for PostGIS, SpatiaLite, GeoPackage and DuckDB spatial.
import geolattice.geolatticedb
Functions and classes
Classes
| Name | Description |
|---|---|
geolattice.geolatticedb.SpatialDB |
A connection to a spatial database. Methods: buffer, close, columns, create_index, execute, explain, geometry_column, load, nearest, query, read_table, spatial_join, srid, tables, vacuum. |
Functions
| Name | Description |
|---|---|
geolattice.geolatticedb.buffer |
See SpatialDB.buffer. |
geolattice.geolatticedb.connect |
Connect to a spatial database. |
geolattice.geolatticedb.create_index |
See SpatialDB.create_index. |
geolattice.geolatticedb.execute |
See SpatialDB.execute. |
geolattice.geolatticedb.explain |
See SpatialDB.explain. |
geolattice.geolatticedb.load |
See SpatialDB.load. |
geolattice.geolatticedb.nearest |
See SpatialDB.nearest. |
geolattice.geolatticedb.query |
See SpatialDB.query. |
geolattice.geolatticedb.spatial_join |
See SpatialDB.spatial_join. |
Web and cloud GIS
Cloud-Optimized GeoTIFF, GeoParquet, XYZ tiles, tile and OGC API Features servers, and cloud storage access.
import geolattice.web
geolattice.web.cloud
Read geospatial files straight from cloud object storage and HTTP servers.
Functions
| Name | Description |
|---|---|
geolattice.web.cloud_env |
Context manager that applies cloud_options to GDAL while it is active. |
geolattice.web.cloud_options |
Build the GDAL configuration options for remote reads. |
geolattice.web.remote_info |
Ask a server about a remote file with a one-byte range request. |
geolattice.web.to_vsi_path |
Convert a URL or URI to the GDAL virtual-file-system path that reads it. |
geolattice.web.cog
Create and validate Cloud-Optimized GeoTIFFs (COGs).
Classes
| Name | Description |
|---|---|
geolattice.web.COGReport |
Result of validate_cog. |
Functions
| Name | Description |
|---|---|
geolattice.web.to_cog |
Convert any GDAL-readable raster to a Cloud-Optimized GeoTIFF. |
geolattice.web.validate_cog |
Check whether a GeoTIFF is cloud-optimized. |
geolattice.web.tiles
XYZ web-map tiles: tile math, on-the-fly rendering and static tile pyramids.
Classes
| Name | Description |
|---|---|
geolattice.web.Tile |
An XYZ tile index. |
Functions
| Name | Description |
|---|---|
geolattice.web.lonlat_to_tile |
Tile containing a longitude/latitude point at zoom. |
geolattice.web.make_xyz_tiles |
Write a static {z}/{x}/{y}.png tile pyramid of a raster. |
geolattice.web.raster_web_info |
Longitude/latitude bounds, centre, pixel size and suggested zoom range of a raster. |
geolattice.web.render_tile |
Render one XYZ tile of a raster as an image. |
geolattice.web.suggest_rescale |
Per-band display range from percentiles of a decimated read of the raster. |
geolattice.web.tile_bounds |
Bounds (west, south, east, north) of a tile. |
geolattice.web.tile_resolution |
Ground size of one pixel (metres) at zoom and latitude. |
geolattice.web.tilejson |
A TileJSON 3.0 document describing an XYZ tile layer. |
geolattice.web.tiles_for_bounds |
All tiles intersecting a longitude/latitude box at the given zoom level(s). |
geolattice.web.zoom_for_resolution |
Smallest zoom whose pixels are at least as fine as resolution_m metres. |
geolattice.web.server
A small web-GIS server: XYZ raster tiles, OGC API, Features and a map viewer.
Classes
| Name | Description |
|---|---|
geolattice.web.BackgroundServer |
An ASGI app served by uvicorn in a background thread; see start_server. Methods: stop, url. |
Functions
| Name | Description |
|---|---|
geolattice.web.create_app |
Build an ASGI app that serves raster tiles and vector features. |
geolattice.web.serve |
Run an ASGI app with uvicorn (blocking). |
geolattice.web.start_server |
Serve an ASGI app (create_app, FastAPI, Starlette) in a background thread and return at once. |
geolattice.web.viewer
A self-contained Leaflet page for raster tile layers and GeoJSON layers.
Functions
| Name | Description |
|---|---|
geolattice.web.leaflet_html |
Build an HTML page with a Leaflet map. |
geolattice.web.static
A static file server with HTTP range requests, for local testing of cloud-native files.
Classes
| Name | Description |
|---|---|
geolattice.web.StaticServer |
A running static_server; use it as a context manager or call stop. Methods: reset, stats, stop, url. |
geolattice.web.SubprocessStaticServer |
A StaticServer running in a child process (same url, stats, reset, stop). Methods: reset, stats, stop, url. |
Functions
| Name | Description |
|---|---|
geolattice.web.static_server |
Serve a folder over HTTP with range requests, CORS and transfer counters. |
Remote sensing
Data access, optical, SAR, InSAR, lidar, hyperspectral, UAV, time series, fusion, texture, super-resolution, classification, deep learning, surface energy balance and soil moisture.
import geolattice.rsense
geolattice.rsense.backend
CPU/GPU backend selection, array dispatch, memory and precision management.
Classes
| Name | Description |
|---|---|
geolattice.rsense.backend.Backend |
An active compute backend. Methods: array_gpu, is_gpu. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.backend.array_module |
Return the array module that owns arr (works for NumPy, CuPy and Dask chunks). |
geolattice.rsense.backend.as_compute_dtype |
Cast integer or mismatched float data to the compute dtype (no copy if already right). |
geolattice.rsense.autocast |
PyTorch mixed-precision context on the active backend. |
geolattice.rsense.available_backends |
Return the backends usable on this machine, e.g. |
geolattice.rsense.backend.clear_cache |
Release cached GPU memory held by CuPy’s pool and PyTorch’s allocator. |
geolattice.rsense.backend.compute_dtype |
dtype used for array math under the current policy. |
geolattice.rsense.device |
Temporarily switch backend:: |
geolattice.rsense.backend.fft |
Signature: fft(arr: 'Any | None' = None). |
geolattice.rsense.backend.free_gpu_memory_bytes |
Free memory on the active CUDA device, or None on CPU. |
geolattice.rsense.get_backend |
Return the currently active backend. |
geolattice.rsense.backend.get_precision |
Signature: get_precision() -> 'str'. |
geolattice.rsense.backend.get_xp |
Return the array module (numpy or cupy) for the backend. |
geolattice.rsense.info |
Report hardware and library availability, useful for bug reports. |
geolattice.rsense.backend.is_gpu_array |
Signature: is_gpu_array(arr: 'Any') -> 'bool'. |
geolattice.rsense.backend.memory_report |
Host and active-GPU memory usage in GB. |
geolattice.rsense.backend.ndimage |
scipy.ndimage on CPU, cupyx.scipy.ndimage on CUDA (chosen from arr if given). |
geolattice.rsense.backend.recommend_chunks |
Suggest Dask chunks: full extent on leading dims, square spatial chunks sized to ~target_mb (default 128 MB on CPU, 5% of free memory on GPU). |
geolattice.rsense.backend.scatter_reduce |
In-place unbuffered reduction target[index] = op(target[index], values). |
geolattice.rsense.set_backend |
Set the global compute backend and return it. |
geolattice.rsense.backend.set_precision |
Set the default floating dtype for array computations (float32 or float64). |
geolattice.rsense.to_cpu |
Move an array, DataArray or Dataset back to host (NumPy) memory. |
geolattice.rsense.to_device |
Move an array, DataArray or Dataset to the active (or given) backend. |
geolattice.rsense.core
Core: raster I/O and formats, RasterCube, PointCloud, CRS, tiling, mosaics, zonal stats.
Classes
| Name | Description |
|---|---|
geolattice.rsense.PointCloud |
Points as aligned 1-D arrays: x, y, z plus optional attributes. Methods: bbox, bounds, by_class, copy, crop, drop_noise, fields, filter, first_returns, from_arrays, from_dataframe, ground, to_cpu, to_dataframe, to_device, to_geodataframe, voxel_downsample, with_field, xp. |
geolattice.rsense.RasterCube |
A georeferenced image time series with one variable per band. Methods: apply, bands, crs, from_dataarray, from_files, from_zarr, resample, sel_period, shape, times, to_zarr, valid_fraction. |
geolattice.rsense.core.Window |
A tile: the core region it owns and the padded region it reads. Methods: inner. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.apply_tiled |
Apply func to the last two axes of data tile by tile on the active backend. |
geolattice.rsense.core.auto_tile_size |
Pick a square tile edge that fits in a fraction of free GPU memory (default on CPU). |
geolattice.rsense.clip |
Clip to geometries (a GeoDataFrame, GeoSeries or list of shapely/GeoJSON geometries). |
geolattice.rsense.core.ensure_crs |
Return obj with a CRS, writing crs if missing; raise if neither is available. |
geolattice.rsense.core.estimate_utm_crs |
UTM EPSG for the centre of a raster or GeoDataFrame. |
geolattice.rsense.core.iter_windows |
Yield non-overlapping core windows, each with a padded read window. |
geolattice.rsense.core.list_subdatasets |
GDAL subdataset paths of an HDF/NetCDF file (e.g. |
geolattice.rsense.core.map_to_pix |
Map (x, y) → fractional pixel (col, row). |
geolattice.rsense.mosaic |
Merge rasters onto one grid (reprojecting to the first raster’s CRS unless crs). |
geolattice.rsense.core.pix_to_map |
Affine pixel (col, row) → map (x, y), independent of the affine package version. |
geolattice.rsense.read |
Read a raster (GeoTIFF/COG/JP2/HDF subdataset/NetCDF) as a georeferenced DataArray. |
geolattice.rsense.core.read_hdf |
Read one layer of an HDF4/HDF5 file through GDAL. |
geolattice.rsense.core.read_netcdf |
Open NetCDF with spatial dims and CRS set for rioxarray (CF grid_mapping honored). |
geolattice.rsense.core.read_safe |
Index a Sentinel-1/2 .SAFE directory. |
geolattice.rsense.core.read_zarr |
Signature: read_zarr(store: 'str | PathLike', *, chunks: 'Any' = 'auto', consolidated: 'bool | None' = None). |
geolattice.rsense.reproject |
Reproject to dst_crs (EPSG code, WKT or pyproj CRS). |
geolattice.rsense.core.stack_times |
Concatenate same-grid DataArrays along a new time dimension. |
geolattice.rsense.core.transform_bounds |
Reproject a bounding box (minx, miny, maxx, maxy), densifying edges. |
geolattice.rsense.core.utm_epsg |
EPSG code of the WGS84 UTM zone containing a lon/lat point (Norway/Svalbard exceptions). |
geolattice.rsense.write |
Write a DataArray/Dataset to GeoTIFF, as a Cloud-Optimized GeoTIFF by default. |
geolattice.rsense.core.write_zarr |
Write to Zarr, keeping CRS (spatial_ref) so it round-trips with read_zarr. |
geolattice.rsense.zonal_stats |
Compute statistics of a single-band raster within each polygon. |
geolattice.rsense.access
Data discovery and access: STAC catalogs, NASA Earthdata, Copernicus CDSE, ASF, Earth Engine.
Functions
| Name | Description |
|---|---|
geolattice.rsense.access.aoi_to_geojson |
Normalize an AOI to a GeoJSON geometry in EPSG:4326. |
geolattice.rsense.access.asf_download |
Download search results using Earthdata credentials (arguments, or ~/.netrc with machine urs.earthdata.nasa.gov). |
geolattice.rsense.access.asf_search |
Search Sentinel-1 products. |
geolattice.rsense.access.baseline_stack |
Temporal/perpendicular baseline stack for InSAR pair selection. |
geolattice.rsense.access.cdse_download |
Download a full product (zipped SAFE) by STAC item, product name or CDSE UUID. |
geolattice.rsense.access.cdse_search |
Search CDSE STAC. |
geolattice.rsense.access.cdse_token |
Obtain an access token (valid ~10 minutes). |
geolattice.rsense.access.earthdata_download |
Download granules found by earthdata_search; returns local file paths. |
geolattice.rsense.access.earthdata_search |
Search NASA CMR for granules, e.g. |
geolattice.rsense.access.gee_image_to_xarray |
Single ee.Image → xarray Dataset (wrapped as a one-image collection). |
geolattice.rsense.access.gee_init |
Initialize Earth Engine (optionally running the browser authentication flow). |
geolattice.rsense.access.gee_to_xarray |
Open an ee.ImageCollection (object or asset id) lazily as an xarray Dataset via xee. |
geolattice.rsense.access.stac_load |
Load STAC items into a lazy, Dask-backed xarray.Dataset (one variable per band). |
geolattice.rsense.access.stac_search |
Search a STAC catalog and return a pystac.ItemCollection. |
geolattice.rsense.optical
Optical remote sensing: MODIS, Landsat, Sentinel-2, Sentinel-3 and HLS.
Functions
| Name | Description |
|---|---|
geolattice.rsense.optical.as_dataset |
Convert a DataArray with a band dim to a Dataset with one variable per band. |
geolattice.rsense.optical.brightness_temperature |
At-sensor brightness temperature (K): BT = K2 / ln(K1 / L + 1). |
geolattice.rsense.optical.cloud_mask |
Return the validity mask for obj using its sensor’s QA band. |
geolattice.rsense.optical.composite |
Composite a time series of (already cloud-masked) images. |
geolattice.rsense.optical.coregister |
Estimate (and optionally apply) the translation aligning target to reference. |
geolattice.rsense.optical.decode_bits |
Extract an integer field of length bits starting at bit start. |
geolattice.rsense.optical.dos1 |
Dark Object Subtraction (DOS1, Chavez 1996) on TOA reflectance. |
geolattice.rsense.optical.emissivity_ndvi |
NDVI threshold method (Sobrino et al. 2004) for land surface emissivity. |
geolattice.rsense.optical.endmembers_from_samples |
Mean spectrum per class at sample points (GeoDataFrame of points). |
geolattice.rsense.optical.fractional_vegetation |
Proportion of vegetation Pv = ((NDVI - NDVIs) / (NDVIv - NDVIs))^2, clipped 0-1. |
geolattice.rsense.optical.get_band |
Fetch canonical band from a Dataset (by variable) or DataArray (by band coord). |
geolattice.rsense.optical.guess_sensor |
Guess the sensor from attributes or band names; None if ambiguous. |
geolattice.rsense.optical.hls_fmask_mask |
Mask from the HLS v2.0 Fmask layer (bits 0-5 flags, bits 6-7 aerosol level 0-3). |
geolattice.rsense.optical.index |
Compute one or more spectral indices. |
geolattice.rsense.optical.landsat_lst |
End-to-end LST from a Landsat Level-1 thermal band and NDVI (MTL values for M, A, K1, K2). |
geolattice.rsense.optical.landsat_qa_mask |
Mask from Landsat Collection 2 QA_PIXEL. |
geolattice.rsense.optical.list_indices |
Return a DataFrame of registered indices, optionally filtered by domain. |
geolattice.rsense.optical.load_hls |
Load Harmonized Landsat Sentinel-2 (HLS v2.0) from NASA LP DAAC. |
geolattice.rsense.optical.load_landsat |
Search, load, scale and cloud-mask Landsat Collection 2 Level-2. |
geolattice.rsense.optical.load_modis |
Search, load, scale and cloud-mask MODIS 8-day surface reflectance (MOD09A1/MYD09A1). |
geolattice.rsense.optical.load_sentinel2 |
Search, load, scale to reflectance and cloud-mask Sentinel-2 L2A. |
geolattice.rsense.optical.lst_single_channel |
Single-channel emissivity correction (Artis & Carnahan 1982): LST = BT / (1 + (lambda * BT / rho) * ln(e)). |
geolattice.rsense.optical.mask_clouds |
Set cloudy/invalid pixels to NaN in every band. |
geolattice.rsense.optical.modis_state_mask |
Mask from MOD09 state_1km / sur_refl_state_500m. |
geolattice.rsense.optical.modis_vi_mask |
Mask from MOD13 VI Quality bits 0-1 (0 good, 1 check QA, 2 cloudy, 3 not produced). |
geolattice.rsense.optical.pansharpen |
Fuse coarse multispectral bands with a fine panchromatic band. |
geolattice.rsense.optical.parse_mtl |
Parse a Landsat *_MTL.txt metadata file into a flat dict of numbers/strings. |
geolattice.rsense.optical.radiance |
Level-1 DN to top-of-atmosphere spectral radiance: L = M * DN + A. |
geolattice.rsense.optical.register_index |
Register a spectral index. |
geolattice.rsense.optical.s2_scl_mask |
Mask from the Sentinel-2 L2A Scene Classification Layer. |
geolattice.rsense.optical.scale |
Scale surface-reflectance products to reflectance (0-1) and thermal bands to Kelvin. |
geolattice.rsense.optical.toa_reflectance |
Landsat Level-1 DN to TOA reflectance with sun-angle correction: rho = (M_rho * DN + A_rho) / sin(sun_elevation) (values from the MTL file). |
geolattice.rsense.optical.topographic_correction |
Remove terrain illumination effects from reflectance. |
geolattice.rsense.optical.unmix |
Linear spectral unmixing. |
geolattice.rsense.optical.lst
Land surface temperature (LST) retrieval from thermal infrared bands.
Functions
| Name | Description |
|---|---|
geolattice.rsense.optical.lst.surface_urban_heat_island |
SUHI intensity: mean LST over urban pixels minus mean over non-urban pixels. |
geolattice.rsense.optical.sensors.modis
MODIS Terra/Aqua: surface reflectance, vegetation index and LST products.
Functions
| Name | Description |
|---|---|
geolattice.rsense.optical.sensors.modis.scale_product |
Apply a product scale factor, e.g. |
geolattice.rsense.optical.sensors.sentinel2_burn_indices
Sentinel-2 burn indices for forest fire detection and severity assessment.
Functions
| Name | Description |
|---|---|
geolattice.rsense.optical.sensors.sentinel2_burn_indices.bai |
Burned Area Index (BAI). |
geolattice.rsense.optical.sensors.sentinel2_burn_indices.bais2 |
Burned Area Index for Sentinel-2 (BAIS2). |
geolattice.rsense.optical.sensors.sentinel2_burn_indices.dnbr |
Differenced Normalized Burn Ratio (dNBR). |
geolattice.rsense.optical.sensors.sentinel2_burn_indices.mirbi |
Mid-Infrared Burn Index (MIRBI). |
geolattice.rsense.optical.sensors.sentinel2_burn_indices.nbr |
Normalized Burn Ratio (NBR). |
geolattice.rsense.optical.sensors.sentinel2_burn_indices.nbr2 |
Normalized Burn Ratio 2 (NBR2). |
geolattice.rsense.optical.sensors.sentinel3
Sentinel-3: OLCI, SLSTR, SRAL and Synergy product processing.
Functions
| Name | Description |
|---|---|
geolattice.rsense.optical.sensors.sentinel3.aggregate_frp |
Aggregate frp_to_points output onto a regular grid cell FRP sum (default) or another statistic, for emissions estimates or hotspot density maps. |
geolattice.rsense.optical.sensors.sentinel3.decode_flags |
Every named bit of a Sentinel-3 flag variable, read from its own metadata. |
geolattice.rsense.optical.sensors.sentinel3.flag_mask |
Boolean validity mask (True = usable) excluding the named flags. |
geolattice.rsense.optical.sensors.sentinel3.frp_to_points |
FRP fire pixels as a geopandas.GeoDataFrame of points. |
geolattice.rsense.optical.sensors.sentinel3.kelvin_to_celsius |
Kelvin to degrees Celsius, keeping other attributes. |
geolattice.rsense.optical.sensors.sentinel3.log_to_linear |
Back-transform a log10-scaled variable (OLCI CHL, TSM): 10**da. |
geolattice.rsense.optical.sensors.sentinel3.olci_l1_mask |
Mask from OLCI L1 quality_flags (invalid, saturated, bright/cloud by default). |
geolattice.rsense.optical.sensors.sentinel3.olci_land_mask |
Mask from OLCI L2 land LQSF (cloud, water, snow/ice, invalid by default). |
geolattice.rsense.optical.sensors.sentinel3.olci_toa_reflectance |
OLCI L1 top-of-atmosphere reflectance: rho = pi * L / (F0 * cos(theta_s)). |
geolattice.rsense.optical.sensors.sentinel3.olci_water_mask |
Mask from OLCI L2 water WQSF. |
geolattice.rsense.optical.sensors.sentinel3.read_manifest |
Processing baseline and key attributes from a .SEN3 product’s xfdumanifest.xml. |
geolattice.rsense.optical.sensors.sentinel3.read_olci_l1 |
Read OLCI Level-1B radiances, solar flux and the full-resolution solar zenith angle. |
geolattice.rsense.optical.sensors.sentinel3.read_olci_land |
Read OLCI L2 land variables: FAPAR (gifapar), canopy chlorophyll (otci), integrated water vapour (iwv), rectified reflectance at 681/865 nm (rc681, rc865, both read from rc_gifapar.nc) and lqsf. |
geolattice.rsense.optical.sensors.sentinel3.read_olci_water |
Read OLCI L2 water (ocean colour) variables: chlorophyll, TSM, Kd490, CDOM, wqsf. |
geolattice.rsense.optical.sensors.sentinel3.read_slstr_frp |
Read SLSTR Level-2 Fire Radiative Power: one record per detected fire pixel. |
geolattice.rsense.optical.sensors.sentinel3.read_slstr_l1 |
Read SLSTR L1 radiance (S1-S6) and brightness temperature (S7-S9, F1-F2). |
geolattice.rsense.optical.sensors.sentinel3.read_slstr_lst |
Read SLSTR Level-2 Land Surface Temperature: LST, its uncertainty and flags. |
geolattice.rsense.optical.sensors.sentinel3.read_slstr_sst |
Read a SLSTR Level-2 SST product (one GHRSST L2P NetCDF file). |
geolattice.rsense.optical.sensors.sentinel3.read_sral_marine |
Read SRAL marine altimetry: standard_measurement.nc (1 Hz, resolution="01") or enhanced_measurement.nc (20 Hz, resolution="20", needed for coastal work). |
geolattice.rsense.optical.sensors.sentinel3.read_sral_virtual_station |
Water-level time series at a virtual station: every pass’s 20 Hz heights within buffer_m of point (lon, lat), across the multiple files in paths (one per satellite overpass, repeating roughly every 27 days). |
geolattice.rsense.optical.sensors.sentinel3.read_synergy |
Read SY_2_SYN surface reflectances (OLCI Syn_Oa##_reflectance bands plus the matching SLSTR bands) and Syn_AOT550. |
geolattice.rsense.optical.sensors.sentinel3.read_synergy_vgt |
Read SY_2_VGP/VG1/V10: already on a regular lat/lon grid, so no swath resampling is needed. |
geolattice.rsense.optical.sensors.sentinel3.slstr_flag_mask |
Mask from SLSTR flags_an/flags_in (cloud by default; also carries confidence, land/water and day/night bits accessible via decode_flags). |
geolattice.rsense.optical.sensors.sentinel3.slstr_lst_mask |
Mask from SLSTR LST flags, optionally also dropping pixels above max_uncertainty K (from the LST_uncertainty variable, when present). |
geolattice.rsense.optical.sensors.sentinel3.slstr_reflectance |
SLSTR VIS/SWIR radiance to reflectance, using the band’s own solar_irradiance attribute (set by read_slstr_l1) and the matching solar zenith angle. |
geolattice.rsense.optical.sensors.sentinel3.sral_marine_mask |
SRAL marine editing criteria: ocean surface type, no rain flag, range/SWH flagged valid, and SSHA within a plausible range (|SSHA| < 2 m). |
geolattice.rsense.optical.sensors.sentinel3.sst_bias_correct |
Bias-corrected SST: sea_surface_temperature - sses_bias. |
geolattice.rsense.optical.sensors.sentinel3.sst_quality_mask |
Mask from GHRSST quality_level (4 = acceptable, 5 = best; default keeps both). |
geolattice.rsense.optical.sensors.sentinel3.swath_to_grid |
Resample swath data (per-pixel lon/lat) onto a regular, georeferenced grid. |
geolattice.rsense.optical.sensors.sentinel3.synergy_mask |
Mask from SY_2_SYN flags (cloud and snow by default). |
geolattice.rsense.optical.sentinel2_biophysical
Sentinel-2 canopy biophysical variables via the BioPAR openEO service.
Classes
| Name | Description |
|---|---|
geolattice.rsense.optical.sentinel2_biophysical.BiophysicalVariable |
One BioPAR product and the units written by the service. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.optical.sentinel2_biophysical.as_spatial_extent |
Bounding box for the BioPAR spatial_extent parameter. |
geolattice.rsense.optical.sentinel2_biophysical.as_temporal_extent |
(start, end) or 'start/end' as the two-item interval the service expects. |
geolattice.rsense.optical.sentinel2_biophysical.biopar_cube |
openEO data cube for one BioPAR variable. |
geolattice.rsense.optical.sentinel2_biophysical.connect |
Connect to the Copernicus Data Space openEO backend. |
geolattice.rsense.optical.sentinel2_biophysical.estimate |
Estimate Sentinel-2 biophysical variables and download one GeoTIFF per date. |
geolattice.rsense.optical.sentinel2_biophysical.normalize_variable |
Return the BioPAR process name for name. |
geolattice.rsense.optical.sentinel2_biophysical.read |
Stack downloaded BioPAR GeoTIFFs into one xarray.DataArray along time. |
geolattice.rsense.atmosphere.sentinel_5p
Sentinel-5P: TROPOMI atmospheric composition products.
Functions
| Name | Description |
|---|---|
geolattice.rsense.atmosphere.sentinel_5p.apply_averaging_kernel |
AK-smoothed model NO2 column, for a fair comparison between a chemical transport model’s own profile and TROPOMI’s reported tropospheric column, which has its own vertical sensitivity baked in through the averaging kernel – comparing… |
geolattice.rsense.atmosphere.sentinel_5p.bin_to_grid |
Grid swath data onto a regular lat/lon grid by averaging the pixel centres that fall in each cell (binning, not interpolation) – fast, and the right choice for most cells at least about 0.05 degrees across. |
geolattice.rsense.atmosphere.sentinel_5p.ch4_enhancement |
CH4 enhancement above background: xch4 - background. |
geolattice.rsense.atmosphere.sentinel_5p.check_processing_consistency |
Flag processing differences across a list of product files that would bias a time series if ignored: a processor-version change (NO2 v2.x, for example, retrieves noticeably higher columns over polluted areas than v1.x – do not mix… |
geolattice.rsense.atmosphere.sentinel_5p.co_mixing_ratio |
Column-averaged CO dry-air mixing ratio (XCO, ppb): the retrieved CO column divided by the dry-air column implied by surface pressure (surface_pressure / (g * M_dry_air), mol/m²) – the same hydrostatic relation… |
geolattice.rsense.atmosphere.sentinel_5p.dobson_units |
Convert a total-column density in mol/m² (ozone’s native unit) to Dobson Units. |
geolattice.rsense.atmosphere.sentinel_5p.estimate_emission_rate |
Point-source emission rate from the Integrated Mass Enhancement method (Varon et al. 2018): Q = IME * U_eff / L, in kg/s. |
geolattice.rsense.atmosphere.sentinel_5p.integrated_mass_enhancement |
Integrated Mass Enhancement (IME; Varon et al. 2018): total excess CH4 mass in a plume, in kg. |
geolattice.rsense.atmosphere.sentinel_5p.molecules_per_cm2 |
Convert a mol/m² column density to molecules/cm², the unit most air-quality literature reports in, using the file’s own multiplication_factor_to_convert_to_molecules_percm2 attribute (never a hardcoded Avogadro’s-number calculation,… |
geolattice.rsense.atmosphere.sentinel_5p.oversample_to_grid |
Area-weighted oversampling: grid swath data by exact polygon overlap between each pixel’s four corners (from read_geolocation_bounds) and each destination grid cell, weighting by the fraction of the pixel’s area inside that cell. |
geolattice.rsense.atmosphere.sentinel_5p.qa_mask |
Boolean validity mask from qa_value (0 = no data, 1 = full quality). |
geolattice.rsense.atmosphere.sentinel_5p.read_aerosol_index |
Read Sentinel-5P UV Aerosol Index (354/388 nm, default), plus qa_value. |
geolattice.rsense.atmosphere.sentinel_5p.read_aerosol_layer_height |
Read Sentinel-5P Aerosol Layer Height: mid-layer height in metres (default), plus qa_value. |
geolattice.rsense.atmosphere.sentinel_5p.read_ch4 |
Read Sentinel-5P CH4: bias-corrected column-averaged dry-air mixing ratio (default, ppb), plus qa_value. |
geolattice.rsense.atmosphere.sentinel_5p.read_cloud |
Read Sentinel-5P CLOUD: fraction, top pressure, top height and optical thickness (default), plus qa_value. |
geolattice.rsense.atmosphere.sentinel_5p.read_co |
Read Sentinel-5P CO: total column (default), mol/m², plus qa_value. |
geolattice.rsense.atmosphere.sentinel_5p.read_geolocation_bounds |
Read each ground pixel’s four corner coordinates from PRODUCT/SUPPORT_DATA/GEOLOCATIONS (latitude_bounds, longitude_bounds, shape (scanline, ground_pixel, corner=4)). |
geolattice.rsense.atmosphere.sentinel_5p.read_hcho |
Read Sentinel-5P HCHO (formaldehyde): tropospheric vertical column (default), mol/m², plus qa_value. |
geolattice.rsense.atmosphere.sentinel_5p.read_metadata |
Global attributes of a Sentinel-5P product: time coverage, orbit, processing mode (NRTI/OFFL/RPRO), processor version. |
geolattice.rsense.atmosphere.sentinel_5p.read_no2 |
Read Sentinel-5P NO2: tropospheric vertical column (default), mol/m², plus qa_value. |
geolattice.rsense.atmosphere.sentinel_5p.read_o3 |
Read Sentinel-5P O3: total vertical column (default), mol/m², plus qa_value. |
geolattice.rsense.atmosphere.sentinel_5p.read_so2 |
Read Sentinel-5P SO2: total vertical column, mol/m², plus qa_value. |
geolattice.rsense.atmosphere.sentinel_5p.temporal_composite |
Accumulate several swaths into one time-composite grid – the standard way to build a monthly, seasonal or multi-orbit mean, since a single daily TROPOMI map is noisy and full of cloud gaps (monthly is the usual minimum for NO2 and… |
geolattice.rsense.atmosphere.sentinel_5p.tm5_pressure_levels |
TM5 hybrid sigma-pressure layer interfaces: p = a + b * p_surface, giving the lower and upper boundary pressure of each of NO2’s 34 TM5 layers. |
geolattice.rsense.spectral_index
Sensor-aware spectral indices for optical imagery.
Classes
| Name | Description |
|---|---|
geolattice.rsense.spectral_index.SensorProfile |
Static description of a sensor for spectral-index work. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.spectral_index.available |
Names of registered indices computable for sensor. |
geolattice.rsense.spectral_index.compute |
Compute one or more spectral indices with optional sensor validation. |
geolattice.rsense.spectral_index.describe |
Return the SensorProfile for sensor. |
geolattice.rsense.spectral_index.get_index |
Return the registered geolattice.rsense.optical.indices.SpectralIndex. |
geolattice.rsense.spectral_index.index_supported |
Return True if all bands required by name exist on sensor. |
geolattice.rsense.spectral_index.list_for_sensor |
DataFrame of indices available for sensor (same columns as list_indices). |
geolattice.rsense.spectral_index.missing_bands |
Canonical bands required by name that sensor does not provide. |
geolattice.rsense.spectral_index.normalize_sensor |
Return the canonical sensor key (e.g. |
geolattice.rsense.spectral_index.resolve_sensor |
Normalize sensor or guess it from obj; raise if neither works. |
geolattice.rsense.spectral_index.sensor_bands |
Canonical optical bands available for sensor (excludes QA). |
geolattice.rsense.spectral_index.sensors |
Canonical sensor keys that have band maps (same as optical.bands.SENSORS). |
geolattice.rsense.spectral_index.usgs_landsat_sr |
Compute the USGS Landsat Collection 2 Surface Reflectance-derived indices. |
geolattice.rsense.sar
Functions
| Name | Description |
|---|---|
geolattice.rsense.sar.ais_at_time |
One position per vessel at the SAR time t0: linear interpolation between the last report before and the first after t0 when both are within max_gap_s, else the nearest report within max_gap_s dead-reckoned with its SOG/COG. |
geolattice.rsense.sar.apply_offset |
Shift an image or (..., y, x) stack by whole pixels on its own grid (NaN where uncovered). |
geolattice.rsense.sar.apply_orbit_file |
Apply-Orbit-File: return a copy of ann (read_slc_annotation) whose orbit is replaced by the state vectors of a precise orbit (read_orbit_file dict or .EOF path) within margin_s seconds of the product’s bursts. |
geolattice.rsense.sar.azimuth_displacement_m |
Expected along-track image displacement (m) of moving vessels: R * v_r / V, with v_r the vessel velocity projected on the line of sight (right-looking, from SOG/COG). |
geolattice.rsense.sar.azimuth_sublooks |
Azimuth sub-looks of one IW SLC burst. |
geolattice.rsense.sar.back_geocode |
DEM-assisted co-registration (SNAP Back-Geocoding) of a secondary burst to a reference burst window, plus the geometry the interferogram needs. |
geolattice.rsense.sar.boxcar |
Moving-average (multilook-style) filter. |
geolattice.rsense.sar.burst_coordinates |
Fractional (line, sample) in a burst for zero-Doppler times and slant ranges from geo2rdr. |
geolattice.rsense.sar.burst_window |
Range-sample window (start, stop) of a burst covering lon/lat bounds (TOPS-Split to an AOI), from the annotation geolocation grid and orbit. |
geolattice.rsense.sar.calibrate |
sigma0 = (DN^2 - noise) / A^2, clipped at a small positive floor. |
geolattice.rsense.sar.calibrate_rcm |
RCM Level-1 GRD radiometric calibration: (DN^2 + offset) / gain. |
geolattice.rsense.sar.cfar |
Constant False Alarm Rate detector on linear intensity (bright targets, e.g. ships). |
geolattice.rsense.sar.cfar_tiled |
cfar over a large image in overlapping tiles (overlap = half the outer window), keeping only each tile’s interior, so memory stays bounded. |
geolattice.rsense.sar.change_map |
Two-date increase/decrease map from the log-ratio (Otsu on |ratio| if no threshold). |
geolattice.rsense.sar.coherence_at_points |
Maximum sub-look coherence near each lon/lat point (e.g. |
geolattice.rsense.sar.coherency_t3 |
Locally averaged 3x3 Pauli-basis coherency matrix T3 from quad-pol SLC channels. |
geolattice.rsense.sar.common_grid |
A north-up target grid (transform, width, height) in crs covering a lon/lat box, snapped to whole multiples of resolution so separate runs share pixel edges. |
geolattice.rsense.sar.compact_pol_mchi |
m-chi decomposition of RCM compact-pol data into surface, volume and double-bounce power. |
geolattice.rsense.sar.coregister_stack |
Co-register a stack of SLC acquisitions to one reference date (SNAP’s back-geocoding of a stack, ISCE’s topsStack), with Enhanced Spectral Diversity for each secondary. |
geolattice.rsense.sar.covariance_c2 |
Locally averaged 2×2 covariance matrix from complex SLC channels. |
geolattice.rsense.sar.create_stack |
Co-register GRD scenes into one (time, y, x) stack on a common map grid. |
geolattice.rsense.sar.crop_orbit |
State vectors of an orbit (read_orbit_file dict or .EOF path) between start and stop (default start) plus margin_s seconds either side. |
geolattice.rsense.sar.cross_pol_ratio |
Cross-pol ratio CR = VH / VV (linear). |
geolattice.rsense.sar.deburst |
TOPS-Deburst: join consecutive bursts (arrays on the same column window, lines from 0) into one continuous image, cutting each azimuth overlap at its middle and dropping invalid lines. |
geolattice.rsense.sar.detect_ships_grd |
CFAR ship detection on a Sentinel-1 IW GRDH AOI, in native radar geometry (10 m). |
geolattice.rsense.sar.detection_scores |
Precision, recall and F1 from a match_points result. |
geolattice.rsense.sar.detections_to_points |
Group a detection mask into objects → GeoDataFrame of centroids with size and peak. |
geolattice.rsense.sar.download_orbit |
Download the Sentinel-1 orbit file covering time from the open AWS s1-orbits bucket (no login): precise POEORB first (available about 20 days after acquisition), then restituted RESORB. |
geolattice.rsense.sar.dpsvi |
Dual-Polarization SAR Vegetation Index DPSVI = (VV+VH) / VV (linear inputs). |
geolattice.rsense.sar.dual_pol_features |
Intensity-only dual-pol features from GRD/RTC (linear power). |
geolattice.rsense.sar.dual_pol_indices |
All single-date VV/VH indices and derived metrics in one call. |
geolattice.rsense.sar.dual_pol_model_decomposition |
Eigen-decomposition model-based power decomposition for dual-pol data. |
geolattice.rsense.sar.enl_estimate |
Estimate ENL over a homogeneous area: mean^2 / var of linear intensity. |
geolattice.rsense.sar.esd_azimuth_shift |
Enhanced Spectral Diversity: the residual azimuth misregistration of the resampled secondary, from the burst overlaps. |
geolattice.rsense.sar.estimate_doppler_centroid |
Measured azimuth Doppler centroid (Hz) of an SLC in blocks of block lines, from the phase of the lag-one azimuth correlation sum(s[i+1] conj(s[i])) (Madsen 1989). |
geolattice.rsense.sar.estimate_enl |
Equivalent number of looks mean^2 / var of linear intensity, from the most homogeneous sea blocks (lowest coefficient of variation). |
geolattice.rsense.sar.estimate_offset |
Integer pixel offset (dy, dx) that best aligns moving with reference. |
geolattice.rsense.sar.extract_targets |
Connected components of a CFAR mask → one row per target. |
geolattice.rsense.sar.find_rcm_files |
Locate the files of one polarisation inside an unzipped RCM Level-1 product folder. |
geolattice.rsense.sar.fit_incidence_slope |
Least-squares slope of backscatter (dB) against incidence angle (degrees) over the pixels in mask (default: every finite pixel) – pick a large area of one surface type, e.g. uniform first-year ice, for the slope that… |
geolattice.rsense.sar.flag_azimuth_ambiguities |
True for targets that look like azimuth ghosts of a brighter target. |
geolattice.rsense.sar.flood_map |
Open-water flood extent from Sentinel-1 (VV or VH). |
geolattice.rsense.sar.from_db |
Decibels → linear power. |
geolattice.rsense.sar.gamma0_to_sigma0 |
RCM-ARD’s own terrain-corrected sigma0 = gamma0 * ratio. |
geolattice.rsense.sar.gamma_map |
Gamma-MAP filter (Lopes et al. 1990): homogeneous areas → mean, strong scatterers kept, textured areas → MAP estimate under a Gamma scene model. |
geolattice.rsense.sar.gcov_indices |
Calculate GCOV ratios and RVI from linear powers. |
geolattice.rsense.sar.geo2rdr |
Range-Doppler geocoding of ground points: the zero-Doppler azimuth time and slant range (m) at which the satellite on orbit sees each WGS84 point (lat, lon in degrees, height ellipsoidal in metres). |
geolattice.rsense.sar.geocode_l1 |
Quickly interpolate a Level-1 layer to a regular map grid from geolocation arrays. |
geolattice.rsense.sar.geocode_points |
Map coordinates of radar-geometry points (e.g. persistent scatterers), from the radar_row/radar_col layers of a terrain_correct result tc: the map position of each point is interpolated (linearly, between map cells) from where… |
geolattice.rsense.sar.gslc_interferogram |
Form a GSLC pair interferogram and local coherence on a shared map grid. |
geolattice.rsense.sar.h_alpha_classify |
Unsupervised H-α plane classification into Cloude-Pottier zones (codes 1-9). |
geolattice.rsense.sar.h_alpha_dual |
Dual-pol H/A/α decomposition (Cloude 2007) from C2 elements. |
geolattice.rsense.sar.h_alpha_quad |
Quad-pol Cloude-Pottier H/A/alpha decomposition (Cloude & Pottier 1997) from T3 elements (coherency_t3). |
geolattice.rsense.sar.hand |
Height Above Nearest Drainage (HAND; Nobre et al. 2011), in the units of dem. |
geolattice.rsense.sar.haversine_m |
Pairwise great-circle distances (m), shape (len(lat1), len(lat2)). |
geolattice.rsense.sar.incidence_angle_grid |
Full-resolution ellipsoid incidence angle (degrees), bilinearly interpolated from the annotation XML’s sparse geolocation grid – the incidence_deg sigma0_to_gamma0 and local_incidence_angle need. |
geolattice.rsense.sar.inspect_hdf5 |
List datasets below an HDF5 group with shape, dtype, and attributes. |
geolattice.rsense.sar.interpolate_lut |
Bilinear interpolation of a sparse (line, pixel) LUT onto an image grid. |
geolattice.rsense.sar.interpolate_orbit |
Interpolate read_orbit_file’s position/velocity to arbitrary times. |
geolattice.rsense.sar.interpolate_rcm_lut |
Interpolate a sparse RCM range-only gain LUT (read_rcm_lut) onto width columns, holding the edge value beyond the LUT’s own sampled range. |
geolattice.rsense.sar.interpolate_rcm_noise |
Stitch RCM per-beam noise-level segments (read_rcm_noise_levels) onto width columns (dB). |
geolattice.rsense.sar.land_mask_for_window |
Land mask (True = land or coastal buffer) for a GRD window in radar geometry. |
geolattice.rsense.sar.layover_shadow_mask |
Local layover/shadow classes on a projected DEM grid: 0 = fine, 1 = layover (terrain facing the radar steeper than the incidence angle), 2 = shadow (terrain facing away steeper than 90 deg minus the incidence angle). |
geolattice.rsense.sar.lee |
Lee (1980) adaptive filter: x = m + b (z - m), b = var_x / var_z. |
geolattice.rsense.sar.llh_to_ecef |
WGS84 latitude/longitude (degrees) and ellipsoidal height (m) to ECEF XYZ (m), shape (…, 3). |
geolattice.rsense.sar.load_rtc |
Load Planetary Computer sentinel-1-rtc (gamma0, terrain-corrected, linear power). |
geolattice.rsense.sar.local_incidence_angle |
Local incidence angle (degrees) from a DEM already resampled onto the SAR image grid. |
geolattice.rsense.sar.log_ratio |
Log-ratio change image 10 log10(after / before) (dB) or natural log if db=False. |
geolattice.rsense.sar.los_unit_vector |
Unit vector from ground points to the satellite (at each point’s zero-Doppler time), in local east/north/up components, shape (..., 3). |
geolattice.rsense.sar.m_chi_decomposition |
m-χ model-based power decomposition (Raney 2007) of a dual-pol C2 matrix. |
geolattice.rsense.sar.m_delta_decomposition |
m-δ model-based power decomposition (Raney 2007) of a dual-pol C2 matrix. |
geolattice.rsense.sar.mask_to_polygons |
Vectorize a boolean mask into polygons with pixel count and area. |
geolattice.rsense.sar.match_points |
One-to-one matching (Hungarian) of predictions to reference points within max_dist_m. |
geolattice.rsense.sar.median |
Median filter (NaN treated as missing by filling with the local mean first). |
geolattice.rsense.sar.multilook |
Block-average by (azimuth, range) looks. |
geolattice.rsense.sar.multitemporal |
Quegan & Yu (2001) multi-temporal filter. |
geolattice.rsense.sar.multitemporal_speckle_filter |
Quegan & Yu (2001) multi-temporal speckle filter for a co-registered stack. |
geolattice.rsense.sar.normalize_incidence |
Bring backscatter (dB) to a reference incidence angle with a linear slope: sigma0_norm = sigma0 - slope * (theta - ref_deg). |
geolattice.rsense.sar.oil_spill_detection |
Dark-spot detection for oil-slick candidates (VV). |
geolattice.rsense.sar.omnibus_test |
Likelihood-ratio test for change across k single-polarization intensity images (Conradsen et al. 2016, p=1 case). |
geolattice.rsense.sar.pairwise_change |
Sequential two-date LR tests between consecutive images: change map per interval, plus first change date and count of changes. |
geolattice.rsense.sar.polarimetric_rvi |
Polarimetric RVI PRVI = (1 - VV/(VH+VV)) * VH, algebraically VH^2/(VH+VV) (linear inputs). |
geolattice.rsense.sar.process_grd |
Process a Sentinel-1 GRD product to calibrated backscatter (linear units). |
geolattice.rsense.sar.process_offsets |
Quality-filter NISAR ROFF/GOFF offsets and derive ground-range and EN displacement. |
geolattice.rsense.sar.process_rifg |
Mask a RIFG by coherence and optionally multilook the complex interferogram. |
geolattice.rsense.sar.process_unwrapped_phase |
Quality-mask, reference, optionally correct ionosphere, and convert phase to LOS displacement. |
geolattice.rsense.sar.radar_forest_degradation_index |
Radar Forest Degradation Index RFDI = (VV-VH) / (VV+VH) (linear inputs). |
geolattice.rsense.sar.radar_vegetation_index |
Dual-pol Radar Vegetation Index RVI = 4*VH / (VV+VH) (linear inputs). |
geolattice.rsense.sar.range_sublooks |
Range sub-looks of an IW SLC burst (or deburst image): the range spectrum is not steered, so no deramping is needed. |
geolattice.rsense.sar.rcm_incidence_angle |
Per-column ellipsoid incidence angle (degrees) for width columns starting at scene column col0. |
geolattice.rsense.sar.read_ais_dma |
Read a Danish Maritime Authority daily AIS file (CSV or zipped CSV) and keep class A/B vessel reports inside bounds (lon/lat) within window_min minutes of t0 (the SAR acquisition time, UTC). |
geolattice.rsense.sar.read_calibration_lut |
Parse a calibration-*.xml file (local path or URL) → (lines, pixels, values). |
geolattice.rsense.sar.read_geolocation_grid |
Parse an annotation XML’s sparse geolocationGridPointList (an evenly spaced line x pixel grid, typically 21 x 10 points for IW GRDH) into line/pixel axes plus 2D {"latitude", "longitude", "height", "incidenceAngle",... | |geolattice.rsense.sar.read_grd_subset| Calibrated backscatter for a lon/lat box cut out of one GRD measurement image. | |geolattice.rsense.sar.read_identification| Read NISAR identification metadata and attributes without loading raster arrays. | |geolattice.rsense.sar.read_l2| Read a two-dimensional Level-2 raster layer and attach its map CRS. | |geolattice.rsense.sar.read_nisar| Read a NISAR layer into anxarray.DataArraywith product grid coordinates. | |geolattice.rsense.sar.read_noise_lut| Parse range noise vectors fromnoise-.xml(local path or URL; IPF >= 2.9 and older layouts). | |geolattice.rsense.sar.read_orbit_file| Parse a Sentinel-1 precise (POEORB) or restituted (RESORB) orbit file (.EOF) into its state vectors: UTCtime, ECEFposition(m) andvelocity(m/s), one row per orbit state vector (OSV, spaced about every 10 s). | |geolattice.rsense.sar.read_platform_heading| Platform flight-direction heading (degrees clockwise from north, 0-360) and the pass direction (“ASCENDING”/“DESCENDING”) from an annotation XML. | |geolattice.rsense.sar.read_prf| Pulse repetition frequencies (Hz) listed in a GRD or SLC annotation XML (downlinkInformation/prf; one per sub-swath in an IW GRD). | |geolattice.rsense.sar.read_processing_params| Range and azimuth processing bandwidth (Hz) and Hamming window coefficients from an IW SLC annotation XML (imageAnnotation/processingInformation/swathProcParamsList) -- whatrange_sublooksandazimuth_sublooksneed and... | |geolattice.rsense.sar.read_radar| Read a two-dimensional Level-1 radar-geometry layer. | |geolattice.rsense.sar.read_rcm_annotation| Parse what InSAR coregistration needs from an RCM Level-1 **Stripmap** SLCproduct.xml(one continuous image, not TOPS bursts -- beams such as3M,5M,16M,QPor the quad-polFQ/SQfamily; a ScanSAR beam, e.g. | |geolattice.rsense.sar.read_rcm_grd_subset| Calibrated, noise-corrected backscatter for a lon/lat box cut out of one polarisation of an RCM Level-1 GRD product folder (ScanSAR or Stripmap), still in radar geometry. | |geolattice.rsense.sar.read_rcm_incidence| Parse RCM'sincidenceAngles.xml: a range-only (per-column) ellipsoid incidence angle curve sampled atpixel_first + step i, in the same layout as the gain LUTs (stepmay be negative). | |geolattice.rsense.sar.read_rcm_lut| Parse an RCM Level-1lutSigma/lutBeta/lutGammacalibration XML (metadata/calibration/lutSigma_etc.). | |geolattice.rsense.sar.read_rcm_metadata| Scene facts from an RCMproduct.xmlthat a workflow should record before processing:satellite,beam_mode(e.g. | |geolattice.rsense.sar.read_rcm_noise_levels| Parse an RCM Level-1noiseLevels_file's per-beam NESZ segments. | |geolattice.rsense.sar.read_rcm_tie_points| Ground control points fromproduct.xml's geolocation grid (imageTiePoint: image line/pixel against geodetic latitude/longitude/height) asrasterioGCPs in EPSG:4326 -- the fallbackread_rcm_grd_subsetuses when the imagery... | |geolattice.rsense.sar.read_rslc_backscatter| Make multilooked RSLC beta0 and optional sigma0 backscatter quick looks. | |geolattice.rsense.sar.read_slc_annotation| Parse what TOPS interferometry needs from a Sentinel-1 IW SLC annotation XML (a SAFEannotation/.xmlfile or an ASF burst-extractor metadata file; local path, URL or parsed element). | |geolattice.rsense.sar.read_slc_burst| Read one burst of an IW SLC measurement GeoTIFF ascomplex64(TOPS-Split). | |geolattice.rsense.sar.refined_lee| Refined Lee filter (Lee 1981) with 7×7 edge-aligned windows. | |geolattice.rsense.sar.remove_border_noise| Mask likely GRD border-noise pixels near the left/right scene edges. | |geolattice.rsense.sar.resample_slc| Resample a secondary burstslc(lines from 0, columns fromcol0) at fractionalline/samplepositions (fromback_geocode), with TOPS deramping/reramping whenannis given. | |geolattice.rsense.sar.rhrv_to_stokes| Stokes parameters from an RH/RV compact-pol covariance matrix (Raney 2007), the inverse ofrrrl_to_rhrv'sc11 = (s0+s1)/2etc. mapping:s0 = <|RH|^2> + <|RV|^2>,s1 = <|RH|^2> - <|RV|^2>,s2 = 2Re<RH RV>,s3 = 2Im<RH RV>. | |geolattice.rsense.sar.rice_map| Paddy rice mapping from a VH time series using the transplanting flood signature. | |geolattice.rsense.sar.ring_stats| Mean, standard deviation and pixel count ofimgin the ring between a squareguardwindow and a squareouterwindow around every pixel (valid pixels only). | |geolattice.rsense.sar.rr_rl_to_stokes| RCM-ARD's circular-basis Stokes parameters from RR, RL and RRRL*. | |geolattice.rsense.sar.rrrl_to_rhrv| Losslessly convert RCM-ARD's circular (RR, RL, RRRL*) product to the linear RH/RV compact-pol covariance matrix (Charbonneau et al. 2010; NRCan/EODMSrrrl_to_rhrv.ipynb). | |geolattice.rsense.sar.rvi4s1| Sentinel-1 RVI4S1= sqrt(VV/(VV+VH)) 4VH/(VV+VH)(linear inputs). | |geolattice.rsense.sar.sentinel_normalized_index| Sentinel Normalized IndexSNI = (VH-VV) / (VH+VV)(linear inputs);SNI = -RFDI(seeradar_forest_degradation_index). | |geolattice.rsense.sar.ship_cfar| Constant false alarm rate detector on linear intensity (e.g. sigma0 VH). | |geolattice.rsense.sar.ship_detection| CFAR ship detection on linear intensity (VH or HV best). | |geolattice.rsense.sar.sigma0_to_gamma0| Ellipsoid normalisationgamma0 = sigma0 / cos(theta_inc)(no DEM). | |geolattice.rsense.sar.simulate_compact_pol| Simulate a right-circular-transmit, linear-receive (CTLR) compact-pol acquisition from quad-pol SLC channels -- what RCM's (or RISAT-1's) actual compact-pol hardware would have measured over the same scene, had it flown instead of a... | |geolattice.rsense.sar.split_rrrl| Real and imaginary bands of an RCM-ARDrrrlasset (the RR/RL* complex correlation). | |geolattice.rsense.sar.split_spectrum| Two sub-look images from the lower and upper halves of an SLC's (baseband) spectrum alongaxis. | |geolattice.rsense.sar.stokes_parameters| Stokes-vector parameters from a dual-pol C2 covariance matrix. | |geolattice.rsense.sar.sublook_coherence| Sub-look coherence|<s1 s2>| / sqrt(<|s1|2><|s2|2>)and the internal Hermitian product magnitude|<s1 s2*>|over a (lines, samples) boxwindow. | |geolattice.rsense.sar.temporal_change| Simple temporal differencex_t - x_t1of the same backscatter channel at two dates. | |geolattice.rsense.sar.temporal_ratio| Simple temporal ratiox_t / x_t1of the same backscatter channel at two dates. | |geolattice.rsense.sar.terrain_correct|Range-Doppler Terrain Correction: resample radar-geometry layers onto a DEM's map grid. | |geolattice.rsense.sar.terrain_flatten| Beta0 -> terrain-flattened gamma0:gamma0 = beta0 / cos(local incidence angle), using the DEM-derived local incidence angle fromlocal_incidence_anglerather thansigma0_to_gamma0's ellipsoid-only approximation. | |geolattice.rsense.sar.threshold| Global threshold of a change or backscatter image. | |geolattice.rsense.sar.to_db| Linear power → decibels. | |geolattice.rsense.sar.tops_deramp_phase| TOPS azimuth deramping phasephi(eta, tau)(radians) at burstlines/samples. | |geolattice.rsense.sar.tops_doppler_centroid| Doppler centroid (Hz) of each burst pixel:fdc + kt (eta - eta_ref)-- the frequency thatesd_azimuth_shiftuses to turn an overlap phase into an azimuth shift. | |geolattice.rsense.sar.un_spider_flood_mapping` |
geolattice.rsense.insar
Functions
| Name | Description |
|---|---|
geolattice.rsense.insar.amplitude_dispersion |
Amplitude dispersion index D_A = sigma_A / mu_A and mean amplitude of a stack (n_images, ...). |
geolattice.rsense.insar.atmospheric_filter |
Atmospheric phase screen of unwrapped point phase (n_dates, P): high-pass in time, low-pass in space (Ferretti et al. 2001). |
geolattice.rsense.insar.coherence_threshold |
Temporal coherence that pixels with random phase reach with ps_periodogram, at false-positive rate fpr – the threshold above which a point is unlikely to be noise. |
geolattice.rsense.insar.combine_heights |
Inverse-variance weighted mean of several height maps (e.g. one per interferometric pair) on the same grid, ignoring NaN. |
geolattice.rsense.insar.correct_unwrapping_errors |
Correct 2 pi unwrapping errors with phase closure (MintPy’s phase_closure method). |
geolattice.rsense.insar.decompose_asc_desc |
Combine ascending and descending LOS into vertical and east-west components. |
geolattice.rsense.insar.dem_error_correction |
DEM-error correction of an SBAS time series (Fattahi & Amelung 2013). |
geolattice.rsense.insar.dem_error_stats |
Accuracy of a DEM against reference heights on the same grid (or at the same points): n, bias (mean error), median, std, rmse, nmad (1.4826 x median absolute deviation: a robust standard deviation) and le90 (90th… |
geolattice.rsense.insar.detrend_heights |
Remove long-wavelength errors from an InSAR height map by fitting its difference from a reference DEM on the same grid and subtracting the fit. |
geolattice.rsense.insar.differential_interferogram |
reference * conj(secondary) * exp(-1j * topographic_phase(delta_range)) for two co-registered SLCs on the same grid. |
geolattice.rsense.insar.enu_to_los |
Project east/north/up displacements (e.g. |
geolattice.rsense.insar.era5_delay |
Slant tropospheric delay (as phase) from ERA5 using PyAPS (pip install pyaps3). |
geolattice.rsense.insar.fill_dem_voids |
Fill NaN voids of a DEM. |
geolattice.rsense.insar.flat_earth_phase |
Phase (rad) of a flat, ellipsoidal Earth from the secondary-minus-reference slant range difference on the ellipsoid (back_geocode(...)["flat_delta_range"]). |
geolattice.rsense.insar.gacos_correction |
Subtract the GACOS tropospheric delay difference from unwrapped phase. |
geolattice.rsense.insar.geoid_to_ellipsoid |
Convert heights above the geoid (orthometric, as in SRTM/NASADEM: EGM96; Copernicus DEM: EGM2008) to WGS84 ellipsoidal heights (inverse=True: the reverse). |
geolattice.rsense.insar.goldstein_filter |
Goldstein & Werner (1998) adaptive phase filter. |
geolattice.rsense.insar.height_of_ambiguity |
Height change (m) that produces one full fringe (2 pi): lambda R sin(theta) / (2 B_perp). |
geolattice.rsense.insar.height_std |
Height standard deviation (m) expected from phase noise: the Cramer-Rao bound sigma_phi = sqrt(1 - g^2) / (g sqrt(2 N)) scaled by \|h_a\| / (2 pi). |
geolattice.rsense.insar.interferogram |
Form a complex interferogram with coherence. |
geolattice.rsense.insar.interferogram_stack |
Form, deburst, multilook, filter and unwrap every interferogram of an SBAS network. |
geolattice.rsense.insar.loop_closure |
Phase closure u_ij + u_jk - u_ik of every triplet of interferograms in the network, (n_triplets, ...). |
geolattice.rsense.insar.los_to_vertical |
Project LOS displacement to vertical assuming purely vertical motion: d_v = d_los / cos(theta). |
geolattice.rsense.insar.multilook_complex |
Complex block averaging (azimuth, range looks) of an interferogram. |
geolattice.rsense.insar.network_components |
Connected subsets of an interferogram network (dates linked by at least one chain of pairs), each sorted, largest first. |
geolattice.rsense.insar.perpendicular_baseline |
Perpendicular and parallel baseline (m) of a pair at ground points. |
geolattice.rsense.insar.phase_to_height |
Convert flat-Earth-removed unwrapped phase (rad) to elevation (m) – SNAP’s Phase to Elevation. |
geolattice.rsense.insar.phase_to_los |
Unwrapped phase (rad) → line-of-sight displacement (m). |
geolattice.rsense.insar.point_velocity |
Least-squares linear rate (units per year) and residual RMSE of point time series (n_dates, P). |
geolattice.rsense.insar.ps_candidates |
Boolean mask of PS candidates: D_A < threshold (Ferretti: 0.25; StaMPS uses a looser 0.4 for candidates and selects on phase later). |
geolattice.rsense.insar.ps_periodogram |
Per-point grid search (periodogram) of the DEM error – and optionally a linear phase rate – that maximises the temporal coherence of wrapped phase (Ferretti et al. 2001). |
geolattice.rsense.insar.read_gacos |
Read a GACOS .ztd binary grid (with its .rsc header) as a DataArray in metres. |
geolattice.rsense.insar.reference_to_point |
Subtract the median of a window x window box around point (row, col) from every pixel; works on 2-D maps and on stacks with leading dimensions (e.g. |
geolattice.rsense.insar.remove_ramp |
Fit and subtract a planar (order 1) or quadratic (order 2) ramp from unwrapped phase. |
geolattice.rsense.insar.sbas_inversion |
Small-baseline network inversion (Berardino et al. 2002) to a displacement time series. |
geolattice.rsense.insar.sbas_network |
Choose small-baseline interferometric pairs (earlier, later) among dates. |
geolattice.rsense.insar.sbas_svd |
SBAS inversion of unwrapped interferograms ((n_pairs, ...), phase or displacement) by singular value decomposition (Berardino et al. 2002). |
geolattice.rsense.insar.select_reference_point |
Choose a reference pixel (row, col): the centre of the window x window neighbourhood with the highest mean coherence, among pixels allowed by mask (e.g. an area known to be stable, or the main unwrapped component). |
geolattice.rsense.insar.sparse_lowpass |
Gaussian low-pass of values known only at scattered points, evaluated at the same points. |
geolattice.rsense.insar.topographic_phase |
Phase (rad) a DEM predicts for a pair: 4 pi / lambda * (R_sec - R_ref) at the DEM surface, i.e. the flat-Earth and topographic phase together. |
geolattice.rsense.insar.unwrap |
Unwrap interferometric phase. |
geolattice.rsense.insar.unwrap_points |
Unwrap the wrapped phase of sparse points (n_ifg, P) (after DEM-error removal). |
geolattice.rsense.insar.unwrap_snaphu_topo |
Unwrap a topographic interferogram with SNAPHU in TOPO statistical-cost mode. |
geolattice.rsense.insar.velocity |
Per-pixel linear velocity (units per year) from a displacement time series by least squares, optionally with annual sine/cosine terms. |
geolattice.rsense.insar.wrap |
Wrap phase to (-pi, pi]. |
geolattice.rsense.insar.hyp3
ASF HyP3 on-demand processing (RTC, InSAR, burst InSAR). Needs hyp3_sdk and Earthdata login.
Functions
| Name | Description |
|---|---|
geolattice.rsense.insar.hyp3.submit_insar |
Submit a GAMMA InSAR job for a granule pair; returns the hyp3_sdk.Batch. |
geolattice.rsense.insar.hyp3.submit_insar_isce_burst |
Submit an ISCE2 burst InSAR job (burst granule ids). |
geolattice.rsense.insar.hyp3.submit_rtc |
Submit a radiometric terrain correction job; returns the hyp3_sdk.Batch. |
geolattice.rsense.insar.hyp3.submit_sbas_stack |
Submit one InSAR job per (reference, secondary) pair for an SBAS network. |
geolattice.rsense.insar.hyp3.wait_and_download |
Block until jobs finish, then download (and unzip) the products. |
geolattice.rsense.insar.isce
ISCE2 topsApp.py wrapper for Sentinel-1 TOPS interferometry (needs a conda ISCE2 install).
Functions
| Name | Description |
|---|---|
geolattice.rsense.insar.isce.read_topsapp_outputs |
Load filtered interferogram, coherence and unwrapped phase from merged/ via GDAL. |
geolattice.rsense.insar.isce.run_topsapp |
Run topsApp.py (steps e.g. |
geolattice.rsense.insar.isce.write_topsapp_xml |
Write a topsApp.xml. |
geolattice.rsense.insar.mintpy
MintPy smallbaselineApp.py wrapper for InSAR time-series analysis.
Functions
| Name | Description |
|---|---|
geolattice.rsense.insar.mintpy.read_timeseries |
Read MintPy’s displacement time series (m) as a DataArray (time, y, x). |
geolattice.rsense.insar.mintpy.read_velocity |
Read MintPy’s velocity (m/yr) as a DataArray (requires h5py). |
geolattice.rsense.insar.mintpy.run |
Run smallbaselineApp.py in the config’s directory. |
geolattice.rsense.insar.mintpy.write_config |
Write a MintPy config for interferograms from HyP3 (default), ISCE2 or others. |
geolattice.rsense.uav
UAV: flight planning and photogrammetry (ODM), frame/RGB+NIR I/O and co-registration,.
Classes
| Name | Description |
|---|---|
geolattice.rsense.uav.Camera |
Nadir camera geometry for flight planning (sensor size in mm, image size in pixels). |
geolattice.rsense.uav.FlattenResult |
Output of ransac_flatten. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.uav.as_image |
Wrap a (rows, cols) or (rows, cols, channels) array as a (band, y, x) DataArray. |
geolattice.rsense.uav.bare_soil_line |
Fit the minimum bare-soil line to red and near-infrared digital numbers. |
geolattice.rsense.uav.blur_score |
Variance of the Laplacian (higher = sharper). |
geolattice.rsense.uav.boxes_to_gdf |
Box polygons in the image’s coordinates (CRS kept for GeoTIFFs). |
geolattice.rsense.uav.build_catalog |
Index every image under root into a tidy table, one row per file. |
geolattice.rsense.uav.build_ricenet |
Build the RiceNet network: density + attention maps (gap=False) or the plant-size regressor (gap=True). |
geolattice.rsense.uav.camera_from_equivalent |
Build a Camera from a 35 mm-equivalent focal length (diagonal-based), for drones that publish only that. |
geolattice.rsense.uav.canopy_cover |
Binary vegetation mask and fractional cover from a vegetation index (e.g. |
geolattice.rsense.uav.chm_from_surfaces |
Canopy height = DSM - DTM. |
geolattice.rsense.uav.chromatic |
Chromatic coordinates r = R/(R+G+B) (likewise g, b): removes brightness differences between frames and flights before computing RGB indices. |
geolattice.rsense.uav.classify_senescence |
Label plant pixels green (1) or senescent (2); background stays 0. |
geolattice.rsense.uav.coregister |
Align a 2-D moving band (e.g. |
geolattice.rsense.uav.cosine_weight |
2-D raised-cosine (Hann) weight peaking at 1 in the tile centre. |
geolattice.rsense.uav.count_plants |
Detect individual plants (or trees) as local maxima of a CHM or vegetation index. |
geolattice.rsense.uav.count_summary |
Count, mean confidence and (with a GSD/CRS image or area_m2) objects per m². |
geolattice.rsense.uav.cover_layers |
Perpendicular vegetation index, ground cover and WDVI from red and NIR. |
geolattice.rsense.uav.cwsi |
Crop Water Stress Index (Tc - Twet) / (Tdry - Twet), clipped 0-1. |
geolattice.rsense.uav.density_count |
Count plants on a large RGB image with a density model, tile by tile. |
geolattice.rsense.uav.detect_stages |
Dates at which a fitted logistic curve reaches given fractions of its amplitude. |
geolattice.rsense.uav.detection_scores |
Precision, recall, F1 and count agreement of predicted vs reference boxes (greedy one-to-one matching at iou). |
geolattice.rsense.uav.doming_profile |
Median elevation along one axis: a quick look at doming before and after flattening. |
geolattice.rsense.uav.edge_agreement |
Correlation of the Sobel edge maps of two bands, away from NaN borders. |
geolattice.rsense.uav.empirical_line |
Empirical line method with 2+ targets of known reflectance (linear fit per band). |
geolattice.rsense.uav.estimate_homography |
3x3 homography mapping moving pixel coordinates onto reference. |
geolattice.rsense.uav.exg_plant_mask |
Model-free plant mask: Otsu threshold on ExG, then clean_mask. |
geolattice.rsense.uav.exposure_stats |
Mean brightness and the fractions of near-black and near-saturated pixels (0-1 scale). |
geolattice.rsense.uav.extract_frames |
Save every step-th frame of a flight video (the LUMS workflow keeps every 6th frame of 24 fps 4K video). |
geolattice.rsense.uav.fetch_weights |
Path to the cached weights for name, downloading them first if needed. |
geolattice.rsense.uav.fit_logistic |
Fit a 4-parameter logistic curve to a trait over time. |
geolattice.rsense.uav.flight_plan |
Ground sampling distance, image footprint and line/trigger spacing for a nadir survey. |
geolattice.rsense.uav.frame_quality |
Blur and exposure statistics for many frames (read at max_dim for speed). |
geolattice.rsense.uav.frame_traits |
Standard RGB(+NIR) traits of one frame, ready for trait_table. |
geolattice.rsense.uav.growth_rates |
Change in trait per day between consecutive flight dates (per by group). |
geolattice.rsense.uav.health_map |
Green / senescent map of a large RGB image, tile by tile (LUMS: 2048 px, 256 px overlap). |
geolattice.rsense.uav.health_summary |
Plant cover and green/senescent fractions, for the whole image or per zone label. |
geolattice.rsense.uav.hsv_filter |
Send “senescent” pixels that are grey (S < s_min) or dark (V < v_min) to background (shadow and water rather than yellow leaves). |
geolattice.rsense.uav.index_summary |
Flat dictionary of index statistics (optionally inside a vegetation mask), handy as one row of a multi-date trait table. |
geolattice.rsense.uav.list_weights |
Table of registered models and whether each is already cached. |
geolattice.rsense.uav.load_detector |
Return predict(tile_rgb_uint8, conf) -> (n, 6) [x1, y1, x2, y2, conf, cls]. |
geolattice.rsense.uav.load_outputs |
Load the orthomosaic, DSM and DTM of a photogrammetry project (whichever exist). |
geolattice.rsense.uav.load_pair |
Load an RGB frame and its NIR frame into one (band=[red, green, blue, nir], y, x) array. |
geolattice.rsense.uav.load_ricenet |
Load a RiceNet checkpoint (kind="count" density model or "size" regressor). |
geolattice.rsense.uav.load_segveg |
Load a SegVeg pickle (model_scikit, XGBoost, Necrosis.pkl). |
geolattice.rsense.uav.merge_boxes |
Greedy non-maximum suppression across tiles on columns x1, y1, x2, y2 and score. |
geolattice.rsense.uav.merge_points |
Merge points closer than radius (e.g. the same plant found in two tiles). |
geolattice.rsense.uav.pair_catalog |
Turn a build_catalog table into one row per frame with a path column per band. |
geolattice.rsense.uav.panel_calibration |
Single-panel calibration: reflectance = DN * (rho_panel / DN_panel) per band. |
geolattice.rsense.uav.panel_dn_from_image |
Mean DN per band inside a pixel box (row0, row1, col0, col1) covering the panel. |
geolattice.rsense.uav.parse_date |
Find a date in a folder name: 2025-08-22, 30072018 (DDMMYYYY) or 20250822. |
geolattice.rsense.uav.peaks_from_density |
Local maxima of a density map above threshold; returns (n, 2) (row, col). |
geolattice.rsense.uav.plants_per_area |
Plant density per polygon (count / area in area_unit m², e.g. 1e4 for per-hectare). |
geolattice.rsense.uav.predict_tiled |
Run fn on overlapping tiles of an (rows, cols, ...) image and stitch the output. |
geolattice.rsense.uav.ransac_flatten |
Remove a shared doming/tilt surface from one or more DEMs of the same field. |
geolattice.rsense.uav.raw_to_celsius |
Radiometric thermal camera raw counts to °C (FLIR/DJI R-JPEG style raw*gain + offset). |
geolattice.rsense.uav.read_frame |
Read a UAV frame or exported orthomosaic as a (band, y, x) DataArray. |
geolattice.rsense.uav.refine_ecc |
Enhanced Correlation Coefficient alignment. |
geolattice.rsense.uav.run_docker |
Run ODM in Docker on project_dir/images; outputs land in project_dir. |
geolattice.rsense.uav.run_nodeodm |
Process images on a NodeODM server (docker run -p 3000:3000 opendronemap/nodeodm). |
geolattice.rsense.uav.sam_plant_mask |
Binary plant mask (uint8 0/1) of an RGB tile with Segment Anything and ExG prompts. |
geolattice.rsense.uav.sam_segment |
Segment a GeoTIFF with SAM; writes a mask raster and optionally polygons. |
geolattice.rsense.uav.segveg_features |
The 14 SegVeg colour features per pixel for an (n, 3) or (rows, cols, 3) uint8 RGB. |
geolattice.rsense.uav.size_classes |
Label plants small / medium / large by size quartiles (LUMS colour classes). |
geolattice.rsense.uav.sliding_windows |
Yield (row0, col0, rows, cols) windows of size tile with overlap pixels. |
geolattice.rsense.uav.summarize_dates |
Mean, SD and count of each trait per flight date (and per by columns, e.g. crop). |
geolattice.rsense.uav.sunshine_normalize |
Normalize for changing illumination using a downwelling light sensor (DLS): DN * (E_ref / E_image) per band. |
geolattice.rsense.uav.synthetic_dem |
A GCP-free style DSM of a plot trial: crop canopy on a domed, tilted ground. |
geolattice.rsense.uav.tiled_detect |
Detect objects on a large RGB image window by window and merge the results. |
geolattice.rsense.uav.to_rgb_array |
(band, y, x) DataArray (or array) -> (rows, cols, 3) RGB array for OpenCV/torch. |
geolattice.rsense.uav.trait_table |
Run func(image) -> {trait: value} on each catalogue row and join the results. |
geolattice.rsense.uav.trend_surface |
Fit z = poly(col, row) of degree to a DEM with RANSAC; return surface and fit info. |
geolattice.rsense.uav.vegetation_indices |
Compute UAV vegetation indices from a (band, y, x) image or a Dataset of bands. |
geolattice.rsense.uav.write_dems |
Write corrected DEMs to GeoTIFF (georeferenced inputs keep their CRS). |
geolattice.rsense.uav.detect
Object detection (panicles, heads, fruit, weeds) on large UAV images with sliding windows.
Functions
| Name | Description |
|---|---|
geolattice.rsense.uav.detect.detection_windows |
Windows (row0, col0, rows, cols) with stride; the last row/column of windows is moved back to the image edge so borders are covered (the original script skipped them). |
geolattice.rsense.uav.health
Crop health from RGB: plant masks with SAM, then green vs senescent (yellow/brown) pixels.
Functions
| Name | Description |
|---|---|
geolattice.rsense.uav.health.clean_mask |
Morphological open (3x3) and close (7x7), then drop components smaller than min_area. |
geolattice.rsense.uav.health.colour_rule |
Model-free green probability per pixel: hue above hue_max degrees (green side of yellow) and positive ExG mean green; returns 0-1 scores. |
geolattice.rsense.uav.health.excess_green_norm |
ExG = 2G - R - B rescaled to 0-1 over the image. |
geolattice.rsense.uav.health.prompt_points |
Positive (vegetation) and negative (soil, water, glare) SAM prompts from colour alone. |
geolattice.rsense.uav.health.sample_points_spread |
Up to k (x, y) points inside mask, spread on a grid of cells. |
geolattice.rsense.uav.io
Reading UAV frames (PNG/JPG/TIFF), RGB + NIR pairs, video frames, quality checks and.
Functions
| Name | Description |
|---|---|
geolattice.rsense.uav.io.grid_coords |
North-up pixel-centre coordinates for a rows x cols image with pixel size res. |
geolattice.rsense.uav.phenology
Season-long UAV phenotyping: per-image traits across flight dates and growth curves.
Functions
| Name | Description |
|---|---|
geolattice.rsense.uav.phenology.logistic |
Signature: logistic(t: 'np.ndarray', base: 'float', amp: 'float', rate: 'float', t_mid: 'float') -> 'np.ndarray'. |
geolattice.rsense.uav.register
Co-registration of UAV bands taken by separate cameras (e.g. an RGB + NIR rig).
Functions
| Name | Description |
|---|---|
geolattice.rsense.uav.register.warp |
Warp moving with homography H onto a grid of shape (rows, cols). |
geolattice.rsense.uav.tiling
Overlapping tiles for very large UAV orthomosaics and merging of per-tile results.
Functions
| Name | Description |
|---|---|
geolattice.rsense.uav.tiling.box_iou |
IoU of one (x1, y1, x2, y2) box with an (n, 4) array of boxes. |
geolattice.rsense.uav.weights
Registry and cache for the pretrained models used by the UAV workflows.
Classes
| Name | Description |
|---|---|
geolattice.rsense.uav.weights.WeightSpec |
WeightSpec(name: ‘str’, url: ‘str’, filename: ‘str’, task: ‘str’, source: ‘str’, kind: ‘str’ = ‘file’, sha256: ‘str | None’ = None) |
Functions
| Name | Description |
|---|---|
geolattice.rsense.uav.weights.cache_dir |
Signature: cache_dir() -> 'Path'. |
geolattice.rsense.lidar
Lidar: point cloud I/O, cleaning, tiling, ground classification, surfaces, terrain and.
Classes
| Name | Description |
|---|---|
geolattice.rsense.lidar.Tile |
A tile: core bounds (no overlap between tiles) and buffered bounds. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.lidar.apply_transform |
Apply a 4×4 rigid transform. |
geolattice.rsense.lidar.aspect |
Aspect: compass direction of steepest descent, degrees clockwise from north. |
geolattice.rsense.lidar.assign_points_to_crowns |
Add tree_id to points by looking up the crown raster (0 = none). |
geolattice.rsense.lidar.building_footprints |
Building outlines from class-6 points → GeoDataFrame with area_m2, height_m (95th percentile of roof heights, when heights are available), z_max and n_points. |
geolattice.rsense.lidar.c2c_distance |
Cloud-to-cloud nearest-neighbour distance from each compared point to reference. |
geolattice.rsense.lidar.canopy_change |
Canopy loss and growth between two CHMs. |
geolattice.rsense.lidar.chm |
Canopy Height Model = DSM − DEM (clipped at min_height). |
geolattice.rsense.lidar.classify_buildings |
Separate buildings (6) from vegetation using local and object-level geometry. |
geolattice.rsense.lidar.classify_ground |
Dispatch to smrf, csf or geolattice.rsense.lidar.filters.pmf. |
geolattice.rsense.lidar.classify_vegetation |
ASPRS low (3), medium (4) and high (5) vegetation by height above ground. |
geolattice.rsense.lidar.clip_polygon |
Keep points inside (or outside, invert=True) a shapely geometry or GeoDataFrame (dissolved, reprojected to the cloud CRS). |
geolattice.rsense.lidar.colorize |
Colour points from co-registered imagery (e.g. |
geolattice.rsense.lidar.cross_section |
Points within width/2 of the line start → end, with a distance field (m along the line) and offset (signed distance from it). |
geolattice.rsense.lidar.csf |
Cloth Simulation Filter (Zhang et al. 2016), simplified. |
geolattice.rsense.lidar.curvature |
Total (Laplacian) curvature, 1/m: negative = convex (ridges), positive = concave. |
geolattice.rsense.lidar.dem |
Digital Elevation (terrain) Model from ground points (class 2), gaps interpolated. |
geolattice.rsense.lidar.dem_of_difference |
DEM of Difference (after − before) with a level of detection (Brasington et al. 2003). |
geolattice.rsense.lidar.density_map |
Points per m² on a res grid (a QC layer for coverage gaps). |
geolattice.rsense.lidar.detect_power_lines |
Wire conductors: elevated, strongly linear, near-horizontal points. |
geolattice.rsense.lidar.detect_stems |
Stem positions and diameter at breast height from TLS/MLS/dense UAV lidar. |
geolattice.rsense.lidar.detect_trees |
Treetops as local maxima of a CHM → GeoDataFrame (x, y, height). |
geolattice.rsense.lidar.dsm |
Digital Surface Model: highest (first-return) elevation per cell. |
geolattice.rsense.lidar.eigen_features |
Covariance (eigenvalue) features of each point’s k nearest neighbours. |
geolattice.rsense.lidar.euclidean_clusters |
Connected-component clustering: points closer than radius share a cluster. |
geolattice.rsense.lidar.fill_depressions |
Priority-flood depression filling (Barnes et al. 2014), with a small epsilon gradient so filled flats still drain. |
geolattice.rsense.lidar.fill_gaps |
Fill NaN cells: nearest, inverse-distance from the 8 nearest cells (idw) or Delaunay linear (TIN) interpolation. |
geolattice.rsense.lidar.fit_circle |
Algebraic (Kåsa) least-squares circle fit, optionally refined by Gauss-Newton iterations. |
geolattice.rsense.lidar.flatten_water |
Hydro-flatten water bodies: set each polygon (GeoDataFrame or shapely geometries) to a single elevation, the percentile of the DEM on a ring_cells-wide shoreline ring. |
geolattice.rsense.lidar.flow_accumulation |
D8 upslope contributing cells (including the cell itself). |
geolattice.rsense.lidar.flow_direction |
D8 flow direction as an index 0-7 (N, NE, E, SE, S, SW, W, NW); -1 for sinks/edges. |
geolattice.rsense.lidar.foliage_height_diversity |
Shannon diversity of returns across height layers above min_height (MacArthur 1961). |
geolattice.rsense.lidar.footprints_to_raster |
Grid footprint values onto a raster template (mean/median/count per cell). |
geolattice.rsense.lidar.geomorphons |
Geomorphon landforms (Jasiewicz & Stepinski 2013), classes 1-10 (see GEOMORPHON_CLASSES). |
geolattice.rsense.lidar.grid_metrics |
Area-based structure metrics per res cell from height-normalized points. |
geolattice.rsense.lidar.hand |
Height Above Nearest Drainage (Rennó et al. 2008): elevation above the stream cell each cell drains to along D8 flow paths. |
geolattice.rsense.lidar.height_profile |
Vertical profile of returns with gap fraction and leaf area density (MacArthur-Horn). |
geolattice.rsense.lidar.hillshade |
Analytical hillshade scaled 0-255. |
geolattice.rsense.lidar.icp |
Point-to-point Iterative Closest Point (Besl & McKay 1992). |
geolattice.rsense.lidar.illumination |
Cosine of the local solar incidence angle, cos(i), used for topographic correction. |
geolattice.rsense.lidar.inundation |
Flood extent and depth for a water level. |
geolattice.rsense.lidar.iter_tiles |
Yield (tile, buffered sub-cloud) for every tile holding min_points points. |
geolattice.rsense.lidar.las_info |
Header summary without reading the points: version, point format and dimensions, point count, points by return, scales/offsets, bounds, CRS and VLR descriptions. |
geolattice.rsense.lidar.m3c2 |
Multiscale Model-to-Model Cloud Comparison (Lague et al. 2013). |
geolattice.rsense.lidar.merge_pointclouds |
Concatenate point clouds (fields present in all of them are kept). |
geolattice.rsense.lidar.merge_rasters |
Mosaic tile rasters (first valid value wins) into one DataArray/Dataset. |
geolattice.rsense.lidar.normalize_heights |
Add height (z minus terrain, bilinear from dtm) to every point. |
geolattice.rsense.lidar.normals |
Upward-oriented unit surface normals (nx, ny, nz) from local PCA. |
geolattice.rsense.lidar.pdal_pipeline |
Run a PDAL pipeline (list of stage dicts or JSON string) and return the first output. |
geolattice.rsense.lidar.plot_classification |
Plan view coloured by ASPRS class (subsampled to max_points). |
geolattice.rsense.lidar.plot_cross_section |
Profile view (distance vs elevation). |
geolattice.rsense.lidar.plot_height_profile |
Plot a height_profile table (lad, fraction or gap_fraction). |
geolattice.rsense.lidar.plot_metrics |
Structure metrics for each field plot (the area-based approach for biomass models). |
geolattice.rsense.lidar.pmf |
Progressive Morphological Filter (Zhang et al. 2003). |
geolattice.rsense.lidar.point_feature_table |
Per-point feature table for supervised classification. |
geolattice.rsense.lidar.predict_point_classes |
Apply a model from train_point_classifier and write field. |
geolattice.rsense.lidar.process_files |
Apply func to each LAS/LAZ file (read with read_las) in parallel threads. |
geolattice.rsense.lidar.process_tiles |
Run func(sub_cloud) on every buffered tile and merge the trimmed results. |
geolattice.rsense.lidar.radius_outlier_removal |
Remove points with fewer than min_neighbors other points within radius (m). |
geolattice.rsense.lidar.ransac_plane |
Fit one plane by RANSAC (refined by least squares on the inliers). |
geolattice.rsense.lidar.rasterize |
Bin points onto a grid with a statistic, on the active backend (scatter reductions). |
geolattice.rsense.lidar.read_atl08 |
ICESat-2 ATL08 100 m land segments → canopy height (h_canopy), terrain (h_te_best_fit) and canopy cover. |
geolattice.rsense.lidar.read_gedi_l2a |
GEDI L2A footprints → GeoDataFrame with relative heights rhNN (m), ground elevation, sensitivity and quality. |
geolattice.rsense.lidar.read_gedi_l2b |
GEDI L2B canopy cover and vertical profile metrics per footprint. |
geolattice.rsense.lidar.read_gedi_l4a |
GEDI L4A aboveground biomass density (Mg/ha) with standard error per footprint. |
geolattice.rsense.lidar.read_las |
Read LAS/LAZ (or COPC with bounds/resolution for spatial/level-of-detail queries). |
geolattice.rsense.lidar.read_las_chunks |
Iterate over a large LAS/LAZ file in chunk_size point chunks (PointClouds). |
geolattice.rsense.lidar.read_pdal |
Read anything PDAL can (EPT URLs such as USGS 3DEP, E57, PLY, COPC…). |
geolattice.rsense.lidar.remove_outliers |
Dispatch to statistical_outlier_removal or radius_outlier_removal. |
geolattice.rsense.lidar.reproject |
Transform x/y (and z for compound CRSs with a vertical datum, e.g. |
geolattice.rsense.lidar.rigid_transform |
4×4 matrix from rotations about x, y, z (degrees, applied x→y→z) and a translation. |
geolattice.rsense.lidar.roughness |
Max minus min elevation in the 3×3 neighbourhood. |
geolattice.rsense.lidar.sample_raster |
Attach raster values (DTM, NDVI, land cover…) to every point as field name. |
geolattice.rsense.lidar.segment_crowns |
Marker-controlled watershed crown segmentation of a CHM. |
geolattice.rsense.lidar.segment_roof_planes |
Sequential RANSAC roof-plane segmentation of (building) points. |
geolattice.rsense.lidar.segment_trees_points |
Point-based individual tree segmentation from treetops (no CHM rasterisation). |
geolattice.rsense.lidar.slope |
Slope (Horn 1981) in degrees, radians or percent. |
geolattice.rsense.lidar.smrf |
Simple Morphological Filter (Pingel et al. 2013). |
geolattice.rsense.lidar.solar_potential |
Relative clear-sky insolation on a DSM: mean of cos(incidence) over sun positions, optionally with cast shadows (line-of-sight along each sun azimuth). |
geolattice.rsense.lidar.statistical_outlier_removal |
Statistical outlier removal (Rusu et al. 2008), as in PCL / PDAL filters.outlier. |
geolattice.rsense.lidar.structure_metrics |
Gridded vertical-structure metrics: foliage height diversity (fhd), effective lai (Beer-Lambert from the gap fraction below cover_height) and canopy relief ratio (crr). |
geolattice.rsense.lidar.summary |
Quick inspection: point count, bounds, area, density, spacing, and tables of classification and return-number counts. |
geolattice.rsense.lidar.sun_positions |
Solar azimuth/elevation (degrees) for day-of-year × local solar hour combinations (Spencer 1971 declination). |
geolattice.rsense.lidar.swath_overlap |
Inter-swath consistency: per cell, the elevation difference between flight lines (point_source_id) using the lowest point of each line. |
geolattice.rsense.lidar.thin |
Reduce point density: one point per size voxel, the lowest (grid_min) or highest (grid_max) point per size grid cell, or a random fraction of points. |
geolattice.rsense.lidar.tile_grid |
Regular tiles of size m covering bounds (minx, miny, maxx, maxy). |
geolattice.rsense.lidar.tpi |
Topographic Position Index: elevation minus the mean of a window×window neighbourhood. |
geolattice.rsense.lidar.train_point_classifier |
Fit a point classifier (rf, xgb, gbm…) on eigen + attribute features. |
geolattice.rsense.lidar.tri |
Terrain Ruggedness Index (Riley et al. 1999): sqrt of summed squared differences to 8 neighbours. |
geolattice.rsense.lidar.trim |
Clip a PointCloud or raster (DataArray/Dataset) back to the tile’s core bounds. |
geolattice.rsense.lidar.twi |
Topographic Wetness Index ln(a / tan β), with a = specific catchment area (m). |
geolattice.rsense.lidar.usgs_3dep_ept |
Find USGS 3DEP Entwine (EPT) dataset URLs intersecting a lon/lat bbox. |
geolattice.rsense.lidar.vertical_accuracy |
Compare a DTM with surveyed checkpoints (GeoDataFrame with z_col): RMSEz, mean error, NVA at 95% (1.96·RMSEz, ASPRS 2014) and the per-point residuals. |
geolattice.rsense.lidar.write_las |
Write a PointCloud to LAS/LAZ (.laz compresses with lazrs/laszip). |
geolattice.rsense.lidar.write_ply |
Write a PLY file (CloudCompare, MeshLab, Open3D). |
geolattice.rsense.lidar.write_tiles |
Split a point cloud into LAS/LAZ tiles {prefix}_{x0}_{y0}{ext} and return the paths. |
geolattice.rsense.lidar.spaceborne
Spaceborne lidar: GEDI (L2A heights, L2B cover/PAI/FHD, L4A biomass) and ICESat-2 ATL08.
Functions
| Name | Description |
|---|---|
geolattice.rsense.lidar.spaceborne.search |
Search NASA Earthdata for GEDI/ICESat-2 granules (product key from SHORT_NAMES). |
geolattice.rsense.hyperspectral
Hyperspectral image processing (imaging spectroscopy).
Classes
| Name | Description |
|---|---|
geolattice.rsense.hyperspectral.SpectralLibrary |
Spectra (rows) on a shared wavelength grid (nm), with names and optional metadata. Methods: plot, resample, subset, to_dict, to_frame. |
geolattice.rsense.hyperspectral.TraitModel |
A fitted spectra → trait model with its band grid and validation metrics. Methods: predict, predict_map. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.hyperspectral.ace |
Adaptive Cosine/Coherence Estimator (Kraut & Scharf 1999): squared cosine between the whitened pixel and whitened target, 0-1, invariant to pixel scaling. |
geolattice.rsense.hyperspectral.as_cube |
Standardise an array/DataArray/Dataset into a cube with a wavelength coordinate. |
geolattice.rsense.hyperspectral.atgp |
Automatic Target Generation Process (Ren & Chang 2003): repeatedly take the pixel with the largest norm in the orthogonal complement of the targets found so far. |
geolattice.rsense.hyperspectral.available_indices |
Indices whose wavelengths all have a band within tolerance nm. |
geolattice.rsense.hyperspectral.bad_bands |
Boolean mask of bands to drop: atmospheric absorption ranges (default water vapour near 1400, 1900 and >2450 nm), bands below min_wavelength, bands whose estimated SNR is below min_snr and bands that are mostly NaN or constant. |
geolattice.rsense.hyperspectral.band_at |
The band nearest nm, or the mean over nm ± width/2 when width is given. |
geolattice.rsense.hyperspectral.band_depth |
Absorption feature analysis on a local continuum between left and right nm. |
geolattice.rsense.hyperspectral.band_index |
Index of the band closest to nm; raises if it is farther than tolerance. |
geolattice.rsense.hyperspectral.band_stats |
Per-band statistics: wavelength, mean, std, min, max, NaN fraction and a simple SNR (mean / std of horizontal pixel differences / √2). |
geolattice.rsense.hyperspectral.cem |
Constrained Energy Minimisation (Harsanyi 1993): FIR filter with unit response to the target and minimum output energy, using the sample correlation matrix. |
geolattice.rsense.hyperspectral.classify_spectral |
Best-matching library spectrum per pixel. |
geolattice.rsense.hyperspectral.continuum_removal |
Convex-hull continuum removal (Clark & Roush 1984), optionally restricted to start-stop nm. |
geolattice.rsense.hyperspectral.derivative |
First or second spectral derivative (per nm), Savitzky-Golay smoothed. |
geolattice.rsense.hyperspectral.destripe |
Remove detector striping in pushbroom data by matching each column’s (axis="x") mean and standard deviation (moment matching) or median to the band’s global value. |
geolattice.rsense.hyperspectral.detection_roc |
ROC table (threshold, true positive rate, false alarm rate) and AUC in attrs. |
geolattice.rsense.hyperspectral.drop_bad_bands |
Remove the bands flagged by bad_bands. |
geolattice.rsense.hyperspectral.emission_rate |
Point-source rate Q = IME · U_eff / L (Varon et al. 2018), in kg/h (or kg/s). |
geolattice.rsense.hyperspectral.empirical_line |
Empirical line calibration to reflectance from two or more field targets. |
geolattice.rsense.hyperspectral.estimate_noise |
Per-band noise standard deviation. |
geolattice.rsense.hyperspectral.extract_endmembers |
Dispatch to ppi, atgp, nfindr or vca. |
geolattice.rsense.hyperspectral.fit_plsr |
Partial least squares regression with the number of components chosen by cross-validated RMSE (the smallest model within one standard error of the minimum). |
geolattice.rsense.hyperspectral.fit_regressor |
Any regressor on spectra: rf, gbm, svr, gpr (Gaussian process with an RBF + white-noise kernel; predict_map(return_std=True) gives uncertainty), ridge, or a scikit-learn estimator. |
geolattice.rsense.hyperspectral.flat_field |
Flat-field relative reflectance: divide by the mean spectrum of a bright, spectrally flat region (boolean mask or (row_slice, col_slice)). |
geolattice.rsense.hyperspectral.from_image |
Library of class spectra (mean or median) sampled at labelled points. |
geolattice.rsense.hyperspectral.gas_matched_filter |
Column-wise matched filter for CH₄ or CO₂ enhancement (Thompson et al. 2016; EMIT). |
geolattice.rsense.hyperspectral.glt_orthorectify |
Place a (band, line, sample) swath on a map grid with a geometry lookup table (1-based glt_x/glt_y, 0 = no data), as used by EMIT and AVIRIS-NG L1B/L2. |
geolattice.rsense.hyperspectral.hybrid_retrieval |
Hybrid retrieval (Verrelst et al. 2015): simulate a noisy PROSAIL LUT on the cube’s bands, train one regressor per trait (gpr, rf, gbm, …) on it and map the traits. |
geolattice.rsense.hyperspectral.hysime |
HySime signal-subspace identification (Bioucas-Dias & Nascimento 2008). |
geolattice.rsense.hyperspectral.iar_reflectance |
Internal Average Relative reflectance: divide every pixel by the scene mean spectrum. |
geolattice.rsense.hyperspectral.ica |
Independent components (scikit-learn FastICA). |
geolattice.rsense.hyperspectral.index |
Compute one index (DataArray) or several (Dataset). |
geolattice.rsense.hyperspectral.list_indices |
Signature: list_indices() -> 'list[str]'. |
geolattice.rsense.hyperspectral.matched_filter |
Clutter matched filter, normalised so a pure target pixel scores ≈ 1 and background ≈ 0 (the score approximates the target abundance). |
geolattice.rsense.hyperspectral.mean_spectrum |
Mean spectrum (optionally over a boolean mask of the spatial shape). |
geolattice.rsense.hyperspectral.merge_libraries |
Combine libraries onto one wavelength grid (default: the first library’s). |
geolattice.rsense.hyperspectral.mesma |
Multiple Endmember Spectral Mixture Analysis (Roberts et al. 1998). |
geolattice.rsense.hyperspectral.mnf |
Minimum Noise Fraction (Green et al. 1988): noise-whitened PCA. |
geolattice.rsense.hyperspectral.mnf_denoise |
Denoise by keeping the first n_components MNF components and inverting. |
geolattice.rsense.hyperspectral.nfindr |
N-FINDR (Winter 1999): find the pixels spanning the simplex of maximum volume in the (k−1)-dimensional PCA space. |
geolattice.rsense.hyperspectral.normalize |
Per-spectrum normalisation: unit L2 norm (vector), divide by mean (brightness), by maximum (max) or by the area under the curve (area). |
geolattice.rsense.hyperspectral.osp |
Orthogonal Subspace Projection (Harsanyi & Chang 1994): project out undesired signatures (k × bands) and match the target. |
geolattice.rsense.hyperspectral.pca |
Principal components of the spectra. |
geolattice.rsense.hyperspectral.plot_band_stats |
Mean ± std and SNR per band from .cube.band_stats. |
geolattice.rsense.hyperspectral.plot_rgb |
Signature: plot_rgb(cube: 'xr.DataArray', wavelengths_nm: 'Sequence[float] | str' = 'true_color', *, ax=None, ...). |
geolattice.rsense.hyperspectral.plot_spectra |
Plot spectra: a DataFrame (rows = spectra, columns = wavelengths, optional label column), a Series, a SpectralLibrary or an array with wavelengths_nm. |
geolattice.rsense.hyperspectral.plume_ime |
Integrated Mass Enhancement of one plume (kg) from a ppm·m enhancement map: IME = Σ ΔX · 10⁻⁶ · ρ_gas · A_pixel. |
geolattice.rsense.hyperspectral.plume_mask |
Segment plumes: pixels above threshold ppm·m (default: robust median + sigma × MAD), connected (8-neighbour), at least min_pixels. |
geolattice.rsense.hyperspectral.ppi |
Pixel Purity Index (Boardman et al. 1995): project the data on random unit vectors (“skewers”) and count how often each pixel is an extreme. |
geolattice.rsense.hyperspectral.prosail_lut |
Latin-hypercube PROSAIL look-up table convolved to a sensor (cube bands, or wavelengths_nm/fwhm). |
geolattice.rsense.hyperspectral.prosail_spectrum |
One PROSAIL (PROSPECT-D + 4SAIL) canopy reflectance spectrum, 400-2500 nm, interpolated to wavelengths_nm. |
geolattice.rsense.hyperspectral.quality_mask |
Simple reflectance-based masks: cloud (bright at 450 nm and spectrally flat in the visible; with cirrus set, also TOA reflectance above it at 1380 nm, e.g. 0.01 for L1 data), water (NDWI 560/860), shadow (dark NIR), saturated… |
geolattice.rsense.hyperspectral.read_aviris |
AVIRIS-Classic / AVIRIS-NG / AVIRIS-3 reflectance or radiance (ENVI files). |
geolattice.rsense.hyperspectral.read_ecostress |
ECOSTRESS / ASTER spectral library text files (header Name:, X Units: Wavelength (micrometers), Y Units: Reflectance (percent), then two columns). |
geolattice.rsense.hyperspectral.read_emit |
NASA EMIT L1B radiance / L2A reflectance NetCDF as a cube. |
geolattice.rsense.hyperspectral.read_enmap |
EnMAP L1C/L2A product: a folder (or its *SPECTRAL_IMAGE* raster) plus *METADATA.XML for band centres, FWHM, gains and offsets. |
geolattice.rsense.hyperspectral.read_envi |
Read an ENVI image (BSQ/BIL/BIP, any byte order) as a cube. |
geolattice.rsense.hyperspectral.read_envi_header |
Parse an ENVI .hdr into a dict (lists for {...} values, numbers converted). |
geolattice.rsense.hyperspectral.read_geotiff_cube |
Multiband GeoTIFF as a cube. |
geolattice.rsense.hyperspectral.read_hyperspectral |
Open any supported product by inspecting the path: ENVI (.hdr/.img/no extension), EMIT (EMIT_*.nc), PRISMA (.he5), Tanager (*_hdf5.h5 or any .h5 with an HDFEOS/.../HYP group), OHS (folder or band file *_B<n>*.tif of a… |
geolattice.rsense.hyperspectral.read_ohs |
Orbita OHS (Zhuhai-1) L1 scene stored as one GeoTIFF per band (*_B1_*.tif to *_B32_*.tif with RPCs) as a cube. |
geolattice.rsense.hyperspectral.read_prisma |
PRISMA L2B/L2C/L2D HE5 reflectance as one VNIR + SWIR cube (sorted by wavelength). |
geolattice.rsense.hyperspectral.read_tanager |
Planet Tanager HDF-EOS5 product (*_ortho_sr_hdf5.h5, *_ortho_radiance_hdf5.h5 or the unorthorectified *_basic_radiance_hdf5.h5) as a cube. |
geolattice.rsense.hyperspectral.read_tanager_ancillary |
All 2-D layers of a Tanager product (cloud, cirrus and no-data masks, aerosol optical depth, column water vapour, sun and sensor angles, path length, time) as a Dataset on the same grid (or swath) as read_tanager. |
geolattice.rsense.hyperspectral.read_usgs |
USGS Spectral Library v7 (splib07a/b ASCII). |
geolattice.rsense.hyperspectral.reconstruct |
Rebuild spectra from abundance maps (for residual and error analysis). |
geolattice.rsense.hyperspectral.red_edge_position |
Red-edge inflection point (nm): wavelength of the maximum first derivative between start and stop (refined by a parabola through the peak), or the 4-point linear method. |
geolattice.rsense.hyperspectral.register_index |
Add an index: formula receives one reflectance array per wavelength, in order. |
geolattice.rsense.hyperspectral.resample_spectral |
Convolve to new bands with Gaussian spectral response functions (FWHM), or linear interpolation when target_fwhm is None. |
geolattice.rsense.hyperspectral.resample_to_sensor |
Simulate a multispectral sensor (sentinel2, landsat89, modis, planetscope) as a Dataset with the canonical band names used by geolattice.rsense.optical, so ds.rs.index("NDVI") and the spectral-index module work. |
geolattice.rsense.hyperspectral.rgb |
RGB composite (0-1, dims rgb, y, x) from three wavelengths or a preset name (true_color, color_infrared, swir, geology, vegetation_stress, water), with a percentile stretch per channel. |
geolattice.rsense.hyperspectral.rx |
Reed-Xiaoli anomaly detector (Mahalanobis distance to the background). |
geolattice.rsense.hyperspectral.sam |
Spectral Angle Mapper angles (radians) to each library spectrum (Kruse et al. 1993). |
geolattice.rsense.hyperspectral.search |
Search NASA Earthdata (EMIT, AVIRIS-NG, PACE OCI…) with a short key from EARTHDATA_PRODUCTS or any CMR short name. |
geolattice.rsense.hyperspectral.sel_range |
Bands with start <= wavelength <= stop nm. |
geolattice.rsense.hyperspectral.select_bands |
Rank and pick n informative bands. |
geolattice.rsense.hyperspectral.sid |
Spectral Information Divergence to each library spectrum (Chang 2000). |
geolattice.rsense.hyperspectral.smooth |
Smooth spectra along wavelength (Savitzky-Golay, moving average or Gaussian). |
geolattice.rsense.hyperspectral.snv |
Standard normal variate: centre and scale each spectrum (removes brightness/scatter). |
geolattice.rsense.hyperspectral.solve_abundances |
Abundances (pixels, k) for spectra X (pixels × bands) and endmembers E (k × bands). |
geolattice.rsense.hyperspectral.sparse_unmix |
Sparse non-negative unmixing with a large library (SUnSAL-style, solved with FISTA): min ½‖Ef − x‖² + λ‖f‖₁, f ≥ 0. |
geolattice.rsense.hyperspectral.spectra_at |
Spectra at points (GeoDataFrame or list of (x, y)); rows = points, columns = wavelengths. |
geolattice.rsense.hyperspectral.spectral_similarity |
Dissimilarity of every pixel to every library spectrum (lower = closer). |
geolattice.rsense.hyperspectral.spectral_viewer |
Plotly figure: RGB composite (left) and spectra of the clicked/selected points (right). |
geolattice.rsense.hyperspectral.subset_file |
Cut a spatial/spectral subset out of a large ENVI file into a new ENVI file (a small, reproducible sample cube for tutorials and tests). |
geolattice.rsense.hyperspectral.swath_to_grid |
Nearest-neighbour gridding of a (band, line, sample) swath with per-pixel latitude/longitude (lat/lon coordinates or arrays), as in Tanager basic or PRISMA L2B/L2C products. |
geolattice.rsense.hyperspectral.synthetic_library |
Idealised spectra (green vegetation, dry vegetation, soil, water, kaolinite-like clay, calcite-like carbonate) built from Gaussian absorption features. |
geolattice.rsense.hyperspectral.unmix |
Linear unmixing of a cube. |
geolattice.rsense.hyperspectral.vca |
Vertex Component Analysis (Nascimento & Bioucas-Dias 2005). |
geolattice.rsense.hyperspectral.vip_scores |
Variable Importance in Projection for a fitted PLSRegression (VIP > 1 ≈ important). |
geolattice.rsense.hyperspectral.virtual_dimensionality |
Harsanyi-Farrand-Chang virtual dimensionality: number of correlation-matrix eigenvalues significantly larger than the covariance ones (Neyman-Pearson, alpha). |
geolattice.rsense.hyperspectral.wavelength_slider |
Plotly figure with a slider through the bands (every step-th band). |
geolattice.rsense.hyperspectral.wavelengths |
Band centres in nm. |
geolattice.rsense.hyperspectral.write_envi |
Write a cube as ENVI (path + .hdr); keeps wavelengths, FWHM, bad bands, map info and the CRS (WKT). |
geolattice.rsense.hyperspectral.cube
Hyperspectral cube conventions and helpers.
Functions
| Name | Description |
|---|---|
geolattice.rsense.hyperspectral.cube.apply_spectral |
Apply func((pixels, bands) array) -> (pixels, bands_out) to every valid pixel, in chunks, and rebuild a cube (with wavelengths_out if the band count changes). |
geolattice.rsense.hyperspectral.cube.from_matrix |
Inverse of to_matrix: put (valid_pixels, k) values back on the cube grid. |
geolattice.rsense.hyperspectral.cube.to_matrix |
(pixels, bands) float64 matrix of valid pixels and the flat valid mask. |
geolattice.rsense.hyperspectral.indices
Narrowband (hyperspectral) indices defined by wavelength, so they work on any sensor:.
Classes
| Name | Description |
|---|---|
geolattice.rsense.hyperspectral.indices.NarrowbandIndex |
NarrowbandIndex(name: ‘str’, formula: ‘Callable’, wavelengths: ‘tuple[float, …]’, description: ‘str’, reference: ‘str’ = ’’) |
geolattice.rsense.hyperspectral.library
Spectral libraries: a small container plus readers for USGS splib07, ECOSTRESS/ASTER and.
Functions
| Name | Description |
|---|---|
geolattice.rsense.hyperspectral.library.as_library |
Coerce a SpectralLibrary / dict / DataFrame (rows = spectra) to a library on the cube’s bands. |
geolattice.rsense.hyperspectral.library.from_dict |
Signature: from_dict(spectra: 'Mapping[str, Sequence[float]]', wavelengths: 'Sequence[float]') -> 'SpectralLibrary'. |
geolattice.rsense.hyperspectral.library.read_csv |
CSV with a wavelength column and one column per spectrum. |
geolattice.rsense.hyperspectral.preprocess
Hyperspectral preprocessing: bad bands, noise and destriping, quality masks, empirical-line,.
Functions
| Name | Description |
|---|---|
geolattice.rsense.hyperspectral.preprocess.resample_library |
Resample library spectra (n, src_bands) to the cube’s bands (Gaussian when the cube has FWHM, else interpolation). |
geolattice.rsense.hyperspectral.reduce
Dimensionality reduction and band selection: PCA, MNF (with denoising), ICA, HySime and.
Classes
| Name | Description |
|---|---|
geolattice.rsense.hyperspectral.reduce.Transform |
A fitted linear spectral transform (scores = (X - mean) @ components.T). Methods: explained_ratio, inverse_transform, transform. |
geolattice.rsense.hyperspectral.unmixing
Spectral unmixing: vectorised least squares (unconstrained, sum-to-one, non-negative, fully.
Functions
| Name | Description |
|---|---|
geolattice.rsense.hyperspectral.unmixing.project_simplex |
Euclidean projection of each column of V (k × N) onto the probability simplex. |
geolattice.rsense.timeseries
Time series: smoothing, harmonic models, phenology, breakpoints (BFAST-like, CCDC-lite), anomalies.
Functions
| Name | Description |
|---|---|
geolattice.rsense.timeseries.anomaly |
Departure from climatology: x - mean (absolute), (x - mean)/std (z-score) or 100 (x - mean)/mean (percent). |
geolattice.rsense.timeseries.bfast_monitor |
Detect the first disturbance after monitor_start (Verbesselt et al. 2012, simplified). |
geolattice.rsense.timeseries.ccdc |
Detect multiple land-cover breaks per pixel from a multi-band reflectance series. |
geolattice.rsense.timeseries.climatology |
Mean, std, min and max by calendar month / day-of-year / season over a base period. |
geolattice.rsense.timeseries.harmonic_fit |
Per-pixel harmonic regression (Fourier series + optional linear trend). |
geolattice.rsense.timeseries.interpolate |
Fill NaNs by linear interpolation in time (respecting actual acquisition dates). |
geolattice.rsense.timeseries.phenology |
Seasonal metrics by the amplitude-threshold method (Jönsson & Eklundh 2004, TIMESAT). |
geolattice.rsense.timeseries.savgol |
Savitzky-Golay filter along time. |
geolattice.rsense.timeseries.tci |
Temperature Condition Index: 100 (max - LST) / (max - min) (hot = stressed = low). |
geolattice.rsense.timeseries.vci |
Vegetation Condition Index (Kogan 1995): 100 (NDVI - min) / (max - min) per calendar period. 0 = worst observed condition, 100 = best. |
geolattice.rsense.timeseries.vhi |
Vegetation Health Index alpha * VCI + (1 - alpha) * TCI. |
geolattice.rsense.timeseries.whittaker |
Whittaker smoother (Eilers 2003): minimizes \|y - z\|^2 + lambda \|D^d z\|^2. |
geolattice.rsense.classify
Classification: unified CPU/GPU estimators, sampling, OBIA, accuracy (Olofsson), change detection,.
Classes
| Name | Description |
|---|---|
geolattice.rsense.classify.Classifier |
Pixel/object classifier or regressor with automatic CPU/GPU engine selection. Methods: feature_importance, fit, predict, predict_proba, predict_raster. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.classify.accuracy_report |
Overall accuracy, Cohen’s kappa, per-class user’s/producer’s accuracy and F1. |
geolattice.rsense.classify.cluster |
Unsupervised k-means classification of a feature Dataset (fit on a random sample). |
geolattice.rsense.classify.confusion_matrix |
Confusion matrix with rows = map (predicted) classes, columns = reference classes. |
geolattice.rsense.classify.cva |
Change Vector Analysis: magnitude and direction of spectral change. |
geolattice.rsense.classify.extract_samples |
Extract feature values at training samples. |
geolattice.rsense.classify.image_difference |
Difference image with changes flagged beyond k standard deviations of the difference. |
geolattice.rsense.classify.olofsson |
Area-adjusted accuracy and area estimation (Olofsson et al. 2014, stratified random sampling). |
geolattice.rsense.classify.post_classification |
From-to change analysis of two classified maps. |
geolattice.rsense.classify.segment |
Segment an image into objects (superpixels). |
geolattice.rsense.classify.segment_features |
Per-segment statistics (mean, std, min, max, median) for each band, plus shape descriptors (area in pixels, perimeter, compactness). |
geolattice.rsense.classify.segment_labels |
Majority label per segment from training points/polygons (for training an OBIA model). |
geolattice.rsense.classify.segments_to_raster |
Map per-segment values (indexed by segment id) back onto the segment raster. |
geolattice.rsense.classify.image_classification
Remote-sensing image classification and related vision tasks.
Classes
| Name | Description |
|---|---|
geolattice.rsense.classify.image_classification.ChipDataset |
Map-style dataset of image chips for chip classification or dense prediction. |
geolattice.rsense.classify.image_classification.Normalizer |
Per-band normalization fitted on training data only and saved with the run. Methods: fit, fit_transform, from_dict, to_dict, transform. |
geolattice.rsense.classify.image_classification.OverheadAugment |
Augmentation for nadir imagery, usable as ChipDataset transform. |
geolattice.rsense.classify.image_classification.PairChipDataset |
Bitemporal chips (N, C, H, W) × 2 with change masks, for change models. |
geolattice.rsense.classify.image_classification.RasterMeta |
Geospatial metadata carried alongside arrays so outputs never lose their georeference. Methods: from_dataarray, to_dict. |
geolattice.rsense.classify.image_classification.RunConfig |
Run selection: the orthogonal task, learning-mode and spatial-unit choices plus settings. Methods: to_dict. |
geolattice.rsense.classify.image_classification.Split |
Index arrays for train / validation / test plus the grouping used to make them. Methods: check, to_dict. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.classify.image_classification.active_learning_loop |
Pool-based active learning: train, score the pool, query the oracle, retrain. |
geolattice.rsense.classify.image_classification.adapt_input_channels |
Make the first convolution accept in_channels bands (multispectral / SAR stems). |
geolattice.rsense.classify.image_classification.as_band_array |
Dataset of bands → (band, y, x) DataArray (inverse of as_band_dataset). |
geolattice.rsense.classify.image_classification.as_band_dataset |
(band, y, x) DataArray → Dataset with one variable per band (feature table form). |
geolattice.rsense.classify.image_classification.as_loader |
torch.utils.data.DataLoader with a seeded generator (reproducible shuffling). |
geolattice.rsense.classify.image_classification.boundary_weight_map |
U-Net style pixel weights emphasizing gaps between touching objects. |
geolattice.rsense.classify.image_classification.box_iou |
Pairwise IoU of axis-aligned boxes (n, 4) × (m, 4) in x0, y0, x1, y1. |
geolattice.rsense.classify.image_classification.build_change_model |
Bitemporal change model with forward(t1, t2) → (N, K, H, W) logits. |
geolattice.rsense.classify.image_classification.build_cnn |
Chip/scene classifier for any number of bands. |
geolattice.rsense.classify.image_classification.build_fusion_model |
Middle-fusion optical + SAR chip classifier (forward(optical, sar)). |
geolattice.rsense.classify.image_classification.build_mae |
Convolutional masked autoencoder for masked-image-modeling pretraining. |
geolattice.rsense.classify.image_classification.build_object_detector |
Detector: two-stage faster_rcnn / mask_rcnn, one-stage retinanet / fcos (torchvision, num_classes includes background) or yolo (Ultralytics; pass a weights name such as yolov8n.pt or yolov8n-obb.pt for oriented boxes). |
geolattice.rsense.classify.image_classification.build_segmenter |
Semantic segmentation network returning (N, K, H, W) logits. |
geolattice.rsense.classify.image_classification.build_temporal_model |
Satellite image time-series model. |
geolattice.rsense.classify.image_classification.change_metrics |
Binary change accuracy: precision, recall, F1, IoU, overall accuracy and kappa. |
geolattice.rsense.classify.image_classification.change_vector_analysis |
Change vector analysis: magnitude, direction and an Otsu (or fixed) change mask. |
geolattice.rsense.classify.image_classification.check_coregistration |
Estimate the sub-pixel shift between two dates (phase cross-correlation). |
geolattice.rsense.classify.image_classification.check_geographic_overlap |
Distance from each test sample to the nearest training/pretraining sample. |
geolattice.rsense.classify.image_classification.check_split_isolation |
Raise if any two named id sets overlap (e.g. |
geolattice.rsense.classify.image_classification.chips_from_folder |
Tile paired image / mask files (e.g. |
geolattice.rsense.classify.image_classification.class_weights |
Class weights from label frequencies (normalized to mean 1) for imbalanced data. |
geolattice.rsense.classify.image_classification.classification_report |
Per-class precision / recall / F1 with support, confusion matrix, overall accuracy, Cohen’s kappa and macro F1; n_boot > 0 adds bootstrap confidence intervals. |
geolattice.rsense.classify.image_classification.clean_mask |
Remove small objects and fill small holes in a binary mask (optionally open first). |
geolattice.rsense.classify.image_classification.compare_transfer_modes |
Train the same pretrained model under several transfer modes and tabulate results. |
geolattice.rsense.classify.image_classification.compare_with_baselines |
Compare models with majority-class and stratified-random baselines on the same test set. |
geolattice.rsense.classify.image_classification.coral |
CORAL domain adaptation (Sun et al. 2016): re-color source features so their mean and covariance match the target domain (other region, season or sensor). |
geolattice.rsense.classify.image_classification.count_objects |
Count detections (e.g. trees, livestock) per zone polygon → zones with a count column. |
geolattice.rsense.classify.image_classification.count_parameters |
Signature: count_parameters(model, trainable_only: 'bool' = True) -> 'int'. |
geolattice.rsense.classify.image_classification.cutmix |
CutMix (Yun et al. 2019) on a batch. |
geolattice.rsense.classify.image_classification.detect_objects |
Sliced detection over a large image → GeoDataFrame of boxes in map coordinates. |
geolattice.rsense.classify.image_classification.detection_tiles |
Scale-aware tiling for small objects → (row, col, window_size) triplets. |
geolattice.rsense.classify.image_classification.embedding_search |
Nearest neighbors of query embeddings in index → (indices, scores) (k each). |
geolattice.rsense.classify.image_classification.error_map |
Map of agreement: 1 = correct, 0 = error, NaN = no reference or no prediction. |
geolattice.rsense.classify.image_classification.export_vectors |
Write vectors to GeoPackage (.gpkg), GeoJSON (.geojson/.json), Shapefile or GeoParquet (.parquet). |
geolattice.rsense.classify.image_classification.extract_chips |
Cut size×size chips centered on labeled points → (chips, labels, coords). |
geolattice.rsense.classify.image_classification.extract_embeddings |
Encoder features (N, D) for chips (array, dataset or loader). |
geolattice.rsense.classify.image_classification.few_shot_prototypes |
Prototype (nearest class-mean, cosine) few-shot classification of embeddings. |
geolattice.rsense.classify.image_classification.fixmatch_loss |
FixMatch (Sohn et al. 2020) loss: supervised CE plus consistency on confident weak-view pseudo-labels applied to strong views. |
geolattice.rsense.classify.image_classification.foundation_model_info |
Table of geospatial foundation models (bands, temporal support, loader, license note). |
geolattice.rsense.classify.image_classification.fuse_early |
Early fusion: stack optical and SAR bands into one (band, y, x) input. |
geolattice.rsense.classify.image_classification.fuse_late |
Late fusion: weighted average of per-sensor class probabilities. |
geolattice.rsense.classify.image_classification.geographic_holdout |
Hold out one region (xmin, ymin, xmax, ymax) as test. |
geolattice.rsense.classify.image_classification.get_loss |
Loss by name. |
geolattice.rsense.classify.image_classification.group_split |
Split by an explicit grouping such as scene id, tile id, field id or region. |
geolattice.rsense.classify.image_classification.histogram_match |
Per-band histogram matching of an image to a reference (radiometric domain alignment). |
geolattice.rsense.classify.image_classification.image_difference |
Difference image with ±k·σ change flags (see geolattice.rsense.classify). |
geolattice.rsense.classify.image_classification.image_ratio |
Ratio (or log-ratio, preferred for SAR) change image with ±k·σ change flags. |
geolattice.rsense.classify.image_classification.instances_from_detector |
Mask R-CNN output dict (masks, labels, scores) → georeferenced polygons. |
geolattice.rsense.classify.image_classification.instances_from_semantic |
Split a semantic mask into instances → (instance id raster, id → class table). |
geolattice.rsense.classify.image_classification.labels_from_table |
Point labels from a CSV/DataFrame with coordinate columns → GeoDataFrame. |
geolattice.rsense.classify.image_classification.linear_probe |
Logistic-regression probe on frozen embeddings (standard SSL evaluation). |
geolattice.rsense.classify.image_classification.load_checkpoint |
Load weights saved by train_model (or a raw state_dict) into model. |
geolattice.rsense.classify.image_classification.load_foundation_encoder |
Load a foundation-model encoder. |
geolattice.rsense.classify.image_classification.load_rs_backbone |
Backbone with remote-sensing pretrained weights (TorchGeo SSL4EO, Satlas, SeCo, …). |
geolattice.rsense.classify.image_classification.load_rs_clip |
Load RemoteCLIP / GeoRSCLIP (open_clip + Hugging Face Hub). |
geolattice.rsense.classify.image_classification.load_run |
Read a run record; normalizer is restored as a Normalizer. |
geolattice.rsense.classify.image_classification.load_stack |
Read a georeferenced image as a (band, y, x) DataArray with metadata kept. |
geolattice.rsense.classify.image_classification.main |
Command-line entry point. |
geolattice.rsense.classify.image_classification.make_encoder |
Backbone without its head (forward → (N, D) features) for SSL / embeddings. |
geolattice.rsense.classify.image_classification.mask_boundaries |
Binary boundary raster of a label/instance map (target for boundary-detection heads). |
geolattice.rsense.classify.image_classification.mean_average_precision |
Detection mAP (all-point interpolated AP, VOC/COCO style). |
geolattice.rsense.classify.image_classification.merge_detections |
Remove duplicate detections from overlapping tiles (polygon NMS in map units). |
geolattice.rsense.classify.image_classification.nms |
Greedy non-maximum suppression (class-wise when labels given) → kept indices. |
geolattice.rsense.classify.image_classification.nt_xent_loss |
SimCLR NT-Xent contrastive loss for two views (N, D) of the same batch. |
geolattice.rsense.classify.image_classification.obb_to_polygon |
Oriented box (center, size, rotation in degrees counter-clockwise) → shapely Polygon. |
geolattice.rsense.classify.image_classification.object_based_classify |
Object-based classification: segment, describe segments, label, classify, map back. |
geolattice.rsense.classify.image_classification.pansharpen |
Pansharpen (high-pass, intensity substitution, Brovey) at the pan resolution. |
geolattice.rsense.classify.image_classification.pansharpening_quality |
Spectral quality vs. a reference: RMSE, ERGAS, SAM (degrees) and mean correlation. |
geolattice.rsense.classify.image_classification.parse_args |
Parse workflow choices and data paths from the command line. |
geolattice.rsense.classify.image_classification.pca_change |
PCA change detection. |
geolattice.rsense.classify.image_classification.pixel_time_series |
Satellite image time series at points → (X (N, T, C), labels, dates). |
geolattice.rsense.classify.image_classification.polygon_iou |
Pairwise IoU of shapely polygons (e.g. oriented boxes) → (len(a), len(b)). |
geolattice.rsense.classify.image_classification.polygonize |
Vectorize a label/instance raster → GeoDataFrame in the raster CRS (never reprojected). |
geolattice.rsense.classify.image_classification.predict_chip_map |
Apply a chip classifier on a sliding grid → georeferenced class map. |
geolattice.rsense.classify.image_classification.predict_map |
Apply a fitted pixel classifier to every valid pixel; nodata stays -1 / NaN. |
geolattice.rsense.classify.image_classification.predict_proba_batches |
Softmax probabilities for chips (array (N, C, H, W), ChipDataset or DataLoader). |
geolattice.rsense.classify.image_classification.pretrain_contrastive |
Contrastive pretraining of encoder on unlabeled chips (SimCLR or MoCo v2-style). |
geolattice.rsense.classify.image_classification.pretrain_masked |
Masked-image-modeling pretraining of a build_mae model on unlabeled chips. |
geolattice.rsense.classify.image_classification.pseudo_label |
Confident pseudo-labels → (indices above threshold, their labels). |
geolattice.rsense.classify.image_classification.rasterize_labels |
Burn vector labels onto the image grid (class per pixel) → (label raster, codes). |
geolattice.rsense.classify.image_classification.read_class_dict |
name,r,g,b CSV → (class names, {index: (r, g, b)}). |
geolattice.rsense.classify.image_classification.receptive_field |
Theoretical receptive field of the conv/pool layers in registration order. |
geolattice.rsense.classify.image_classification.rgb_mask_to_index |
Color-coded mask (H, W, 3) → class index (H, W) (DeepGlobe/LandCover style). |
geolattice.rsense.classify.image_classification.run_workflow |
Run a classical end-to-end workflow selected by config and write its outputs. |
geolattice.rsense.classify.image_classification.sam_segment |
Segment Anything (SAM / SAM 2) on a GeoTIFF via segment-geospatial. |
geolattice.rsense.classify.image_classification.sample_pixels |
Spectral vectors at labeled points/polygons → (X, y, coords). |
geolattice.rsense.classify.image_classification.sar_assisted_gap_fill |
Fill cloudy (NaN) optical pixels from SAR, flagging every reconstructed value. |
geolattice.rsense.classify.image_classification.save_run |
Write everything needed to reproduce and interpret a run to one JSON file. |
geolattice.rsense.classify.image_classification.segmentation_metrics |
Per-class IoU, Dice/F1, precision, recall, support and mean IoU for masks. |
geolattice.rsense.classify.image_classification.select_for_labeling |
Pick n unlabeled samples for review: the most uncertain, kept diverse. |
geolattice.rsense.classify.image_classification.self_training |
Semi-supervised self-training with confidence-thresholded pseudo-labels. |
geolattice.rsense.classify.image_classification.set_seed |
Seed Python, NumPy and PyTorch (all devices) for reproducible runs. |
geolattice.rsense.classify.image_classification.set_trainable |
Freeze a pretrained encoder for transfer learning. |
geolattice.rsense.classify.image_classification.sliding_window_predict |
Large-image inference with overlapping windows and blended probabilities (no seams). |
geolattice.rsense.classify.image_classification.spatial_block_split |
Leakage-safe split by geography: whole spatial blocks go to train, val or test. |
geolattice.rsense.classify.image_classification.spatial_blocks |
Integer block id of each (x, y) on a square grid of block_size map units. |
geolattice.rsense.classify.image_classification.spatial_cross_validate |
Spatial block k-fold CV of any estimator with fit/predict → per-fold scores. |
geolattice.rsense.classify.image_classification.spatial_kfold |
Spatial block k-fold: yields (train_idx, test_idx) with whole blocks held out. |
geolattice.rsense.classify.image_classification.temporal_split |
Split by acquisition date. |
geolattice.rsense.classify.image_classification.tent_adapt |
TENT test-time adaptation (Wang et al. 2021): minimize prediction entropy on unlabeled target batches, updating only BatchNorm affine parameters (statistics re-estimated). |
geolattice.rsense.classify.image_classification.terratorch_config |
TerraTorch Lightning-CLI config (as a dict; dump with yaml.safe_dump) for fine-tuning a foundation model on flood, burn-scar or crop tasks (terratorch fit -c config.yaml). |
geolattice.rsense.classify.image_classification.text_prompt_segment |
Grounding DINO + SAM text-prompted segmentation (e.g. |
geolattice.rsense.classify.image_classification.train_fixmatch |
Semi-supervised training loop with fixmatch_loss; validation uses labels only. |
geolattice.rsense.classify.image_classification.train_model |
Explicit PyTorch training/validation loop for chip classification or segmentation. |
geolattice.rsense.classify.image_classification.train_pixel_classifier |
Fit a supervised pixel (or object) classifier, with spatial CV when coords are given. |
geolattice.rsense.classify.image_classification.uncertainty_scores |
Per-sample uncertainty from class probabilities (higher = more informative). |
geolattice.rsense.classify.image_classification.unsupervised_classify |
Unsupervised pixel classification (k-means, mini-batch k-means or Gaussian mixture). |
geolattice.rsense.classify.image_classification.vit_attention_rollout |
Attention rollout (Abnar & Zuidema 2020) for timm ViT/DeiT models → (N, gh, gw). |
geolattice.rsense.classify.image_classification.weak_labels_from_product |
Weak labels from a coarse map product (e.g. |
geolattice.rsense.classify.image_classification.write_class_map |
Write a class raster as a georeferenced GeoTIFF with class metadata. |
geolattice.rsense.classify.image_classification.zero_shot_classify |
Zero-shot scene classification with RemoteCLIP / GeoRSCLIP. |
geolattice.rsense.dl
Deep learning: tile datasets, segmentation/detection models, foundation models, training, inference,.
Classes
| Name | Description |
|---|---|
geolattice.rsense.dl.HSIPatchDataset |
Patches (1, bands, p, p) (or spectra (bands,) with patch=1, flat=True) centred on labelled pixels. Methods: bands, num_classes. |
geolattice.rsense.dl.PointBlockDataset |
Fixed-size point samples from square blocks of one or more PointClouds. Methods: in_channels, num_classes. |
geolattice.rsense.dl.RasterTileDataset |
Tiles from an image (band, y, x) and optional label raster (y, x) as a torch Dataset. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.dl.adapt_first_conv |
Return a copy of a nn.Conv2d accepting in_channels, reusing pretrained RGB weights. |
geolattice.rsense.dl.band_stats |
Per-band mean and std (from a random pixel sample) for normalization. |
geolattice.rsense.dl.block_split |
Split labelled pixels into train/test masks by whole spatial blocks of block pixels, so neighbouring (overlapping) patches never fall on both sides. |
geolattice.rsense.dl.build_detector |
Create a torchvision detector (num_classes includes background for R-CNNs). |
geolattice.rsense.dl.build_segmentation_model |
Create a segmentation network. |
geolattice.rsense.dl.CNN3D |
Compact 3-D CNN on (B, 1, bands, p, p) patches (joint spectral-spatial kernels). |
geolattice.rsense.dl.export_onnx |
Export a segmentation model to ONNX (dynamic batch/height/width) for CPU inference. |
geolattice.rsense.dl.from_torchgeo |
Instantiate a TorchGeo benchmark dataset by class name, e.g. |
geolattice.rsense.dl.grid_windows |
Top-left corners of a regular tile grid covering the image (last tiles snapped to the edge). |
geolattice.rsense.dl.HybridSN |
HybridSN (Roy et al. 2020): three 3-D convolutions followed by a 2-D convolution. |
geolattice.rsense.dl.labels_from_vectors |
Rasterize labelled polygons onto the image grid → (label raster, {class_name: code}). |
geolattice.rsense.dl.lightning_task |
Wrap a model in a LightningModule for multi-GPU / multi-node training:: |
geolattice.rsense.dl.make_loader |
Signature: make_loader(dataset, batch_size: 'int' = 8, shuffle: 'bool' = True, num_workers: 'int' = 0, **kw). |
geolattice.rsense.dl.PointNet2Seg |
PointNet++ single-scale-grouping segmentation network (Qi et al. 2017b). |
geolattice.rsense.dl.PointNetSeg |
Vanilla PointNet segmentation network (Qi et al. 2017a), without T-nets. |
geolattice.rsense.dl.predict_detection |
Sliced detection over a large image with global NMS → GeoDataFrame of boxes in map units. |
geolattice.rsense.dl.predict_hsi_map |
Classify every valid pixel of cube with the patch size, normalisation and class codes of dataset. |
geolattice.rsense.dl.predict_point_segmentation |
Label every point of pc by sweeping blocks (same size/features/statistics as the training dataset) and averaging softmax scores over overlapping blocks and votes random passes. |
geolattice.rsense.dl.predict_segmentation |
Run a segmentation model over an arbitrarily large image (band, y, x). |
geolattice.rsense.dl.random_flip_rotate |
Simple geometric augmentation: random flips and 90° rotations (image and mask together). |
geolattice.rsense.dl.SpectralCNN1D |
1-D CNN on single-pixel spectra (input (B, bands)). |
geolattice.rsense.dl.SpectralTransformer |
Transformer over groups of neighbouring bands (SpectralFormer-style group-wise embedding, Hong et al. 2022). |
geolattice.rsense.dl.train_detection |
Train a torchvision detector. |
geolattice.rsense.dl.train_hsi_classifier |
Cross-entropy training; keeps the weights with the best validation accuracy. |
geolattice.rsense.dl.train_point_segmentation |
Train a point segmentation model with cross-entropy (labels -100 are ignored). |
geolattice.rsense.dl.train_segmentation |
Train a segmentation model with cross-entropy (plain PyTorch, single device). |
geolattice.rsense.dl.UNet |
Built-in U-Net instance (no extra dependencies). |
geolattice.rsense.dl.hyperspectral
Deep learning for hyperspectral images: patch datasets with leakage-safe block splits,.
Functions
| Name | Description |
|---|---|
geolattice.rsense.dl.hyperspectral.evaluate |
(true, predicted) class indices over a loader. |
geolattice.rsense.dl.foundation
Adapters for geospatial foundation models: Prithvi, SatMAE, Clay and SAM.
Classes
| Name | Description |
|---|---|
geolattice.rsense.dl.foundation.Clay |
Clay foundation model (sensor-agnostic MAE). Methods: encode, to. |
geolattice.rsense.dl.foundation.Prithvi |
NASA/IBM Prithvi-EO-2.0 (HLS-pretrained ViT MAE). Methods: encode, segmentation_model, to. |
geolattice.rsense.dl.foundation.SAM |
Segment Anything for georeferenced rasters (delegates to geolattice.rsense.uav.sam_segment). Methods: segment, to. |
geolattice.rsense.dl.foundation.SatMAE |
SatMAE (Cong et al. 2022) ViT encoder from a checkpoint path or URL (timm required). Methods: encode, to. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.dl.foundation.list_foundation_models |
Signature: list_foundation_models(). |
geolattice.rsense.fusion
Data fusion: optical-SAR, STARFM spatiotemporal fusion, lidar-optical modelling, UAV→satellite upscaling.
Functions
| Name | Description |
|---|---|
geolattice.rsense.fusion.compare |
Agreement metrics between two co-registered rasters: R², RMSE, MAE, bias, n. |
geolattice.rsense.fusion.sar_gap_fill |
Fill cloudy (NaN) optical pixels from co-registered SAR features of the same date. |
geolattice.rsense.fusion.stack_features |
Align datasets to the grid of sources[reference] and merge their variables. |
geolattice.rsense.fusion.starfm |
Predict a fine-resolution image at t2 from a fine/coarse pair at t1 and coarse at t2. |
geolattice.rsense.fusion.train_wall_to_wall |
Model a sparse lidar/field variable (e.g. |
geolattice.rsense.fusion.upscale |
Aggregate a fine raster (e.g. |
geolattice.rsense.xai
Explainability and model reliability: SHAP, permutation importance, spatial CV, AOA, conformal.
Classes
| Name | Description |
|---|---|
geolattice.rsense.xai.BufferedKFold |
K-fold (random or block) where training samples within buffer (map units) of any test sample are removed (spatial leave-out with a dead zone; Le Rest et al. 2014). Methods: get_n_splits, split. |
geolattice.rsense.xai.ConformalClassifier |
Split-conformal prediction sets (LAC score 1 - p_true; Sadinle et al. 2019). Methods: fit, predict_raster, predict_sets. |
geolattice.rsense.xai.ConformalRegressor |
Split-conformal intervals (Lei et al. 2018), optionally normalized by a difficulty model. Methods: fit, predict_interval, predict_raster. |
geolattice.rsense.xai.SpatialBlockCV |
K-fold over square spatial blocks of side block_size (map units), assigned to folds at random. Methods: get_n_splits, split. |
geolattice.rsense.xai.SpatialClusterCV |
K-fold over k-means clusters of the sample coordinates (spatially contiguous folds). Methods: get_n_splits, split. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.xai.aoa |
Map the Dissimilarity Index and the Area of Applicability for a feature raster. |
geolattice.rsense.xai.coverage |
Empirical coverage of intervals. |
geolattice.rsense.xai.cross_validate_spatial |
Run cross-validation with a spatial splitter; returns per-fold scores and the mean. |
geolattice.rsense.xai.dissimilarity_index |
Dissimilarity Index of new data to training data, plus the AOA threshold. |
geolattice.rsense.xai.permutation_importance |
Drop in score when each feature (or feature groups, e.g. all S1 bands) is shuffled. |
geolattice.rsense.xai.shap_importance |
Mean |SHAP| per feature (averaged over classes for multiclass). |
geolattice.rsense.xai.shap_values |
SHAP explanation object (TreeExplainer for tree ensembles, else a model-agnostic explainer on a background sample). |
geolattice.rsense.viz
Visualization: stretches, RGB composites, raster/time-series plots, interactive maps, 3-D point clouds.
Functions
| Name | Description |
|---|---|
geolattice.rsense.viz.interactive_map |
Interactive web map with raster and vector layers (leafmap). |
geolattice.rsense.viz.plot_pointcloud |
3-D view of a PointCloud with PyVista (interactive) or matplotlib (fallback, subsampled). |
geolattice.rsense.viz.plot_raster |
Plot a single-band raster (continuous or categorical with {value: (label, color)}). |
geolattice.rsense.viz.plot_rgb |
Show an RGB composite with map coordinates. |
geolattice.rsense.viz.plot_timeseries |
Plot pixel time series at named (x, y) points, or the spatial agg if none given. |
geolattice.rsense.viz.rgb |
Build a display-ready RGB composite DataArray (y, x, rgb), each band stretched 0-1. |
geolattice.rsense.viz.stretch |
Scale an array to 0-1 for display (NaN preserved). |
geolattice.rsense.scale
Scaling out: Dask/Dask-CUDA clusters, Zarr cubes, STAC catalog export.
Functions
| Name | Description |
|---|---|
geolattice.rsense.scale.export_stac |
Create a self-contained STAC catalog with one item per raster file. |
geolattice.rsense.scale.open_cube |
Open a Zarr cube lazily with its native chunks and CRS. |
geolattice.rsense.scale.rechunk_for |
Rechunk a Dataset/DataArray for spatial-first (time=None → -1 keeps full time per chunk, good for pixel time series) processing. |
geolattice.rsense.scale.start_cluster |
Start a Dask Client. |
geolattice.rsense.scale.to_zarr_cube |
Write (or append along append_dim) a cube to Zarr with sensible chunks/compression. |
geolattice.rsense.apps
Dashboard templates (Streamlit + leafmap) you can copy, run and customize.
Functions
| Name | Description |
|---|---|
geolattice.rsense.apps.create_app |
Copy a template app to path; run it with streamlit run <file>. |
geolattice.rsense.apps.launch |
Copy a template to a temp dir and launch it with Streamlit. |
geolattice.rsense.apps.list_templates |
Signature: list_templates() -> 'dict[str, str]'. |
geolattice.rsense.get_images
Download Sentinel, Landsat, RCM, NAIP, NOAA, and USGS lidar from Python.
Classes
| Name | Description |
|---|---|
geolattice.rsense.get_images.Area |
Area of interest in EPSG:4326. Methods: wkt. |
geolattice.rsense.get_images.ImageResult |
Files written by get_images. |
geolattice.rsense.get_images.SearchResult |
Scenes returned by search_images, before any files are written. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.get_images.bands_for |
Band or variable names the Explorer offers for this collection. |
geolattice.rsense.get_images.default_bands |
Bands get_images downloads when bands is omitted. |
geolattice.rsense.get_images.get_images |
Search and download into out. |
geolattice.rsense.get_images.get_rcm_ard |
Download RADARSAT Constellation Mission (RCM) CEOS Analysis Ready Data. |
geolattice.rsense.get_images.list_collections |
Collection ids for one source, or a dict of every source. |
geolattice.rsense.get_images.load_aoi |
Build an EPSG:4326 area from a bounding box or a vector dataset. |
geolattice.rsense.get_images.naip_coverage |
USDA NAIP years on file for each state, the same table the Explorer draws. |
geolattice.rsense.get_images.search_images |
List scenes for an area. |
geolattice.rsense.get_images.search_rcm_ard |
List RADARSAT Constellation Mission (RCM) CEOS Analysis Ready Data scenes. |
geolattice.rsense.super_resolution
Classical and deep-learning super-resolution for multispectral imagery.
Functions
| Name | Description |
|---|---|
geolattice.rsense.super_resolution.build_diffusion_model |
Build a conditional DDPM for super-resolution. |
geolattice.rsense.super_resolution.build_sr_gan |
Build an SRGAN pair: a spectral-preserving generator and patch discriminator. |
geolattice.rsense.super_resolution.build_sr_model |
Build an SRCNN-, VDSR-, EDSR-, or RCAN-style multispectral CNN. |
geolattice.rsense.super_resolution.iterative_back_projection |
Classical iterative back-projection with a Gaussian blur/block-mean sensor model. |
geolattice.rsense.super_resolution.pansharpen |
Fuse a coarse multispectral cube with a higher-resolution pan band. |
geolattice.rsense.super_resolution.predict_super_resolution |
Run tiled, overlap-blended inference, returning data on the finer grid. |
geolattice.rsense.super_resolution.super_resolution_loss |
L1 + spectral-angle + optional area-downsample consistency loss. |
geolattice.rsense.super_resolution.train_super_resolution |
Train on (low_res, high_res) batches or dicts with those named tensors. |
geolattice.rsense.super_resolution.train_super_resolution_diffusion |
Train the conditional DDPM on (low_res, high_res) image pairs. |
geolattice.rsense.super_resolution.train_super_resolution_gan |
Train an SRGAN pair on (low_res, high_res) batches. |
geolattice.rsense.super_resolution.unsharp_mask |
Apply classical unsharp masking to a (y, x) or (band, y, x) array. |
geolattice.rsense.super_resolution.upsample |
Upsample a 2-D/3-D array or georeferenced xarray object. |
geolattice.rsense.texture
Texture analysis for optical and radar (SAR) imagery.
Functions
| Name | Description |
|---|---|
geolattice.rsense.texture.autoregressive_texture |
Model-based texture via a simplified isotropic autoregressive fit: regresses each pixel on the mean of its 4 nearest neighbours, x ~= rho * mean_4nn(x) + e, with rho and the residual found in closed form from local sums within a… |
geolattice.rsense.texture.deep_texture_features |
Deep-learning texture features from a pretrained CNN backbone (via timm): runs img through the backbone’s stem up to stage layer (0-indexed) and returns that stage’s feature-map channels as texture features, upsampled (bilinear)… |
geolattice.rsense.texture.edge_density |
Structural/syntactic texture: local density of Canny edges (Canny 1986) – the fraction of edge pixels inside a moving sizexsize window. |
geolattice.rsense.texture.first_order_stats |
First-order (histogram-based) texture: per-pixel moments and entropy in a moving window, with no spatial/co-occurrence relationship between pixels – the cheapest and least specific texture family, often used as a quick pre-filter… |
geolattice.rsense.texture.fourier_texture |
Transform-based texture via the 2-D Fourier power spectrum (Rosenfeld & Troy 1970): for each sizexsize tile (every step pixels), computes a Hann-windowed 2-D FFT power spectrum and bins it into n_rings radial frequency rings. |
geolattice.rsense.texture.fractal_dimension |
Model-based texture via the local fractal dimension, estimated per tile with differential box-counting (Sarkar & Chaudhuri 1994): treats the intensity surface as a 3-D relief (x, y, intensity) and counts how many boxes of side r are… |
geolattice.rsense.texture.gabor_texture |
Transform-based texture via a bank of Gabor filters (Gabor 1946; Jain & Farrokhnia 1991): each (frequency, orientation) filter responds to texture repeating at that spatial frequency and direction, and the local mean energy of its… |
geolattice.rsense.texture.glcm_texture |
Second-order statistical texture via the Gray-Level Co-occurrence Matrix (Haralick et al. 1973) – the most widely used texture method for satellite imagery, especially SAR, because it summarizes the spatial dependency between… |
geolattice.rsense.texture.glrlm_texture |
Gray-Level Run-Length Matrix texture: short/long-run emphasis and run percentage, sensitive to directional/linear patterns (furrowed fields, building rows, linear SAR layover/shadow streaks) that GLCM’s pairwise statistics do not… |
geolattice.rsense.texture.lacunarity |
Structural texture via gliding-box lacunarity (Plotnick et al. 1996): lambda(r) = Var(box mass) / Mean(box mass)^2 + 1 for box side r, computed over gliding boxes within a moving analysis window of size pixels (default 4 *... | |geolattice.rsense.texture.lbp_texture| Local Binary Pattern texture (Ojala, Pietikainen & Maenpaa 2002): each pixel is compared ton_pointsneighbours sampled on a circle ofradiuspixels, giving a micro-pattern code per pixel (rotation-invariant withmethod=“uniform”). | |geolattice.rsense.texture.mrf_texture_energy| Model-based texture via a Markov Random Field clique-energy proxy. | |geolattice.rsense.texture.wavelet_texture| Transform-based, multi-resolution texture via a 2-D Haar discrete wavelet transform (Mallat 1989), implemented directly in NumPy (no extra dependency needed beyondgeolattice[rsense]`). |
geolattice.rsense.image_processing
Standalone image processing for remote-sensing rasters.
Functions
| Name | Description |
|---|---|
geolattice.rsense.image_processing.add_noise |
Add synthetic noise to values scaled to [0, 1] (skimage.util.random_noise). |
geolattice.rsense.image_processing.adjust_brightness_contrast |
alpha * v + beta on values scaled to [0, 1] (cv2.convertScaleAbs style). |
geolattice.rsense.image_processing.adjust_gamma |
Gamma correction gain * v ** gamma on values scaled to [0, 1] (exposure.adjust_gamma). |
geolattice.rsense.image_processing.affine_transform |
Warp with a 3x3 (or 2x3) forward matrix in pixel (col, row) coordinates. |
geolattice.rsense.image_processing.bilateral_denoise |
Edge-preserving bilateral denoising on values scaled to [0, 1]; result is in that scale. |
geolattice.rsense.image_processing.convolve |
2-D convolution (correlation, as cv2.filter2D) with a kernel array or a name in KERNELS. |
geolattice.rsense.image_processing.crop |
Crop to window=(row0, row1, col0, col1) pixels, or to map bounds=(xmin, ymin, xmax, ymax). |
geolattice.rsense.image_processing.downscale_local_mean |
Block-mean downscale by integer factors=(fy, fx) (edges are padded with 0, as skimage). |
geolattice.rsense.image_processing.edges |
Edge detection per band. |
geolattice.rsense.image_processing.equalize_adapthist |
Contrast-limited adaptive histogram equalization (CLAHE), result in [0, 1]. |
geolattice.rsense.image_processing.equalize_hist |
Global histogram equalization per band, result in [0, 1] (cv2.equalizeHist). |
geolattice.rsense.image_processing.flip |
Flip horizontal (left-right), vertical (up-down) or both. |
geolattice.rsense.image_processing.gaussian_blur |
Gaussian blur with standard deviation sigma pixels (cv2.GaussianBlur). |
geolattice.rsense.image_processing.harris_corners |
Harris corner detector on one band. |
geolattice.rsense.image_processing.histogram |
Per-band histogram. |
geolattice.rsense.image_processing.hog_features |
Histogram of Oriented Gradients descriptor of one band (flat vector; visualize adds the image). |
geolattice.rsense.image_processing.hsv_to_rgb |
HSV (all in [0, 1], bands H, S, V) back to RGB in [0, 1]. |
geolattice.rsense.image_processing.image_info |
Shape, dtype, per-band min/max/mean and NaN count (OpenCV img.shape/dtype). |
geolattice.rsense.image_processing.match_histograms |
Match each band’s histogram to reference (same band count or a single band). |
geolattice.rsense.image_processing.mean_blur |
Box (mean) blur over size x size pixels (cv2.blur). |
geolattice.rsense.image_processing.median_blur |
Median filter, robust to salt-and-pepper noise and SAR speckle spikes (cv2.medianBlur). |
geolattice.rsense.image_processing.morphology |
Morphological operation on a binary or gray image. |
geolattice.rsense.image_processing.perspective_transform |
Perspective (homography) warp from four src_points to dst_points, (col, row) each. |
geolattice.rsense.image_processing.read_image |
Read an image or GeoTIFF as a (band, y, x) array. |
geolattice.rsense.image_processing.remove_small_objects |
Remove connected True regions smaller than min_size pixels from a binary mask. |
geolattice.rsense.image_processing.rescale |
Scale both sides by factor (skimage.transform.rescale / cv2.resize(fx, fy)). |
geolattice.rsense.image_processing.resize |
Resize to shape=(height, width) or by scale (skimage.transform.resize). |
geolattice.rsense.image_processing.rgb_to_hsv |
RGB to HSV; bands are returned as (H, S, V) all in [0, 1]. |
geolattice.rsense.image_processing.rgb_to_lab |
RGB to CIE Lab* (D65); bands are (L, a, b). |
geolattice.rsense.image_processing.rotate |
Rotate counter-clockwise by angle degrees (skimage.transform.rotate). |
geolattice.rsense.image_processing.sharpen |
Sharpen with the 3x3 Laplacian-based kernel, blended by strength (0 = unchanged). |
geolattice.rsense.image_processing.shift |
Translate by dx columns right and dy rows down (cv2.warpAffine translation). |
geolattice.rsense.image_processing.sobel_h |
Horizontal-edge Sobel response (gradient along rows), signed. |
geolattice.rsense.image_processing.sobel_v |
Vertical-edge Sobel response (gradient along columns), signed. |
geolattice.rsense.image_processing.stretch |
Linear contrast stretch between percentiles (skimage.exposure.rescale_intensity). |
geolattice.rsense.image_processing.threshold |
Binary threshold per band. |
geolattice.rsense.image_processing.to_gray |
RGB to gray (skimage.color.rgb2gray / cv2.COLOR_BGR2GRAY); first 3 bands are R, G, B. |
geolattice.rsense.image_processing.to_uint8 |
Scale to 0-255 uint8: dtype range for ints, min-max (or percentiles) otherwise. |
geolattice.rsense.image_processing.to_vector |
Flatten to a (n_pixels, n_bands) feature matrix (np.reshape of the image). |
geolattice.rsense.image_processing.tv_denoise |
Total-variation (Chambolle) denoising on values scaled to [0, 1]. |
geolattice.rsense.image_processing.unsharp_mask |
Unsharp masking: v + amount * (v - gaussian(v, radius)) per band. |
geolattice.rsense.image_processing.write_image |
Write an image to GeoTIFF (or any GDAL-writable format chosen by the extension). |
geolattice.rsense.edge_detectors
Agricultural field-boundary and field-instance detection.
Classes
| Name | Description |
|---|---|
geolattice.rsense.edge_detectors.FieldEdgeResult |
Field polygons, their boundaries, the boundary-probability raster, and instance labels. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.edge_detectors.available_models |
Return FC-DenseNet checkpoints and GeoLattice segmenter architectures supported here. |
geolattice.rsense.edge_detectors.boundary_to_instances |
Convert a predicted boundary-probability image to connected field-instance IDs. |
geolattice.rsense.edge_detectors.build_edge_model |
Build a field-edge segmentation model. |
geolattice.rsense.edge_detectors.classical_edges |
Classical edge detectors as a boundary score in [0, 1] (Roberts, Sobel, Prewitt, Scharr, Laplacian of Gaussian, Canny) for comparison with the networks. |
geolattice.rsense.edge_detectors.detect_delineate_anything |
Run an Ultralytics instance-segmentation checkpoint over overlapping RGB windows. |
geolattice.rsense.edge_detectors.detect_field_edges |
Infer field-boundary probabilities and return fields and boundary geometries. |
geolattice.rsense.edge_detectors.detect_field_edges_from_raster |
Read selected one-based bands (RGB by default, e.g. |
geolattice.rsense.edge_detectors.detect_fields_ftw |
FTW field polygons from the 8-band two-window stack (see ftw_stack). |
geolattice.rsense.edge_detectors.detect_sam2 |
Generate SAM 2 field-instance masks in overlapping RGB windows. |
geolattice.rsense.edge_detectors.dihedral_augment |
Rotate (and optionally flip) tiles: rotations are multiples of 90 degrees. |
geolattice.rsense.edge_detectors.edge_metrics |
Boundary and field (non-boundary) precision, recall and F1, plus ROC AUC. |
geolattice.rsense.edge_detectors.ftw_checkpoint |
Local path of an FTW checkpoint. |
geolattice.rsense.edge_detectors.ftw_models |
The FTW U-Net checkpoints known to GeoLattice as a table (name, version, licence, URL). |
geolattice.rsense.edge_detectors.ftw_stack |
Stack two Sentinel-2 windows into the 8-band FTW input B04, B03, B02, B08 (A, then B). |
geolattice.rsense.edge_detectors.load_delineate_anything |
Load a local Ultralytics segmentation checkpoint (e.g. |
geolattice.rsense.edge_detectors.load_edge_model |
Load a local FieldEdge FC-DenseNet or GeoLattice segmenter checkpoint. |
geolattice.rsense.edge_detectors.load_ftw_model |
Load an FTW U-Net checkpoint into a GeoLattice build_segmenter network. |
geolattice.rsense.edge_detectors.load_sam2 |
Load a SAM 2 checkpoint from its model hub ID. |
geolattice.rsense.edge_detectors.predict_boundary_probability |
Run tiled, overlap-blended inference and return the boundary probability in [0, 1]. |
geolattice.rsense.edge_detectors.predict_ftw |
FTW inference: per-class softmax probabilities (classes, H, W). |
geolattice.rsense.edge_detectors.rasterize_boundaries |
Boundary label raster from digitised field polygons (1 = boundary, 0 = field interior). |
geolattice.rsense.edge_detectors.select_threshold |
Pick the threshold that maximises boundary F1 on validation data. |
geolattice.rsense.edge_detectors.tile_pairs |
Cut an H×W×C image and its H×W label into size×size tiles (Yang et al. used 192). |
geolattice.rsense.edge_detectors.to_fiboa |
Add the fiboa core properties to a field GeoDataFrame (fiboa v0.3 / Vecorel). |
geolattice.rsense.foundation_models
Remote sensing foundation models: catalog, loaders, raster embeddings and probes.
Classes
| Name | Description |
|---|---|
geolattice.rsense.foundation_models.FoundationEncoder |
A loaded foundation model with one interface for every backend. Methods: dense_features, embed, embed_raster, encode, forward_features, to. |
geolattice.rsense.foundation_models.FoundationModel |
Catalog entry for one foundation model (or one released size of it). Methods: loadable, to_dict. |
Functions
| Name | Description |
|---|---|
geolattice.rsense.foundation_models.alphaearth_dequantize |
Convert the int8 values of the public AlphaEarth files to float embeddings. |
geolattice.rsense.foundation_models.alphaearth_image |
Annual AlphaEarth embedding image (64 bands, A00 to A63) for year as an ee.Image. |
geolattice.rsense.foundation_models.alphaearth_index |
Index of the AlphaEarth GeoTIFF tiles on Google Cloud Storage (path, year, UTM zone, bounds). |
geolattice.rsense.foundation_models.alphaearth_to_xarray |
AlphaEarth embeddings for a region as a (embedding, y, x) DataArray. |
geolattice.rsense.foundation_models.band_wavelengths |
Central wavelengths for band names ("red", "B04", "swir16", …). |
geolattice.rsense.foundation_models.benchmark_encoders |
Compare encoders on one labelled set of chips with linear and kNN probes. |
geolattice.rsense.foundation_models.chip_metadata |
Longitude, latitude, date and area of every chip, in the order of chip_raster. |
geolattice.rsense.foundation_models.chip_raster |
Cut a (band, y, x) raster, or a (time, band, y, x) series, into square chips. |
geolattice.rsense.foundation_models.cluster_embeddings |
Unsupervised map from embeddings: k-means or Gaussian mixture labels. |
geolattice.rsense.foundation_models.embedding_change |
Per-cell change between two embedding maps of the same grid: 1 - cosine similarity. |
geolattice.rsense.foundation_models.embedding_rgb |
Three-band (band, y, x) image in [0, 1] for viewing an embedding map. |
geolattice.rsense.foundation_models.embedding_search |
Nearest neighbours of query rows in index → (indices, scores). |
geolattice.rsense.foundation_models.embeddings_to_frame |
Flatten an (embedding, y, x) map to a table with y, x and one column per dim. |
geolattice.rsense.foundation_models.get_model_spec |
Catalog entry for name (case-insensitive; aliases such as "dofa" work). |
geolattice.rsense.foundation_models.input_spec |
The input contract of a model: band order, units, statistics and chip size. |
geolattice.rsense.foundation_models.knn_probe |
Cross-validated k-nearest-neighbour probe (accuracy for classes, R² otherwise). |
geolattice.rsense.foundation_models.linear_probe |
Cross-validated linear probe: how much the embeddings know about y. |
geolattice.rsense.foundation_models.list_models |
Table of the catalog, one row per model, optionally filtered. |
geolattice.rsense.foundation_models.load_model |
Build a foundation model and wrap it in a FoundationEncoder. |
geolattice.rsense.foundation_models.model_info |
All catalog fields for one model, as a dict. |
geolattice.rsense.foundation_models.normalize |
Normalize an image batch before it goes into a model. |
geolattice.rsense.foundation_models.pool_features |
Reduce model output to one vector per image. |
geolattice.rsense.foundation_models.prepare |
Turn a raster into the input a model expects: band order, scaling and normalization. |
geolattice.rsense.foundation_models.recommend |
Models to try first for task, best first. |
geolattice.rsense.foundation_models.sample_alphaearth |
AlphaEarth embeddings at point locations, columns A00 to A63 (one 10 m pixel each). |
geolattice.rsense.foundation_models.segmentation_model |
TerraTorch encoder-decoder for semantic segmentation on a catalog backbone. |
geolattice.rsense.foundation_models.similarity_map |
Similarity of every cell of an embedding map to query. |
geolattice.rsense.foundation_models.terratorch_config |
TerraTorch fine-tuning config; see geolattice.rsense.classify.image_classification.terratorch_config. |
geolattice.rsense.foundation_models.zero_shot_classify |
Zero-shot scene classification with a vision-language model (RemoteCLIP, GeoRSCLIP). |
geolattice.rsense.surface_energy_balance
Surface energy balance (SEB) models of evapotranspiration from satellite images.
Functions
| Name | Description |
|---|---|
geolattice.rsense.surface_energy_balance.actual_vapour_pressure |
Actual vapour pressure (kPa) from dew point (C), or from air temperature (C) and relative humidity (percent). |
geolattice.rsense.surface_energy_balance.aerodynamic_resistance |
Aerodynamic resistance to heat transport between heights z1 and z2 (s m-1): rah = (ln(z2 / z1) - psi_h(z2) + psi_h(z1)) / (u* k). |
geolattice.rsense.surface_energy_balance.aggregate_lst |
Aggregate LST by an integer factor (for example 30 m Landsat to 990 m). |
geolattice.rsense.surface_energy_balance.air_density |
Air density (kg m-3) from pressure (kPa) and air temperature (K). |
geolattice.rsense.surface_energy_balance.air_emissivity |
Effective atmospheric emissivity. |
geolattice.rsense.surface_energy_balance.albedo |
Broadband surface albedo from surface reflectance bands (0 to 1). |
geolattice.rsense.surface_energy_balance.albedo_from_toa |
Surface albedo from top of atmosphere broadband albedo (SEBAL): (alpha_toa - alpha_path) / tau_sw^2. |
geolattice.rsense.surface_energy_balance.anchor_at |
Anchor record for the pixel nearest to map coordinates (x, y) of DataArray ref. |
geolattice.rsense.surface_energy_balance.anchor_report |
Table of anchor pixels with any extra layers sampled at them (rn=, g=, …). |
geolattice.rsense.surface_energy_balance.asce_pm_daily |
ASCE standardized daily reference ET (mm d-1), ASCE-EWRI (2005). |
geolattice.rsense.surface_energy_balance.asce_pm_hourly |
ASCE standardized hourly reference ET (mm h-1), ASCE-EWRI (2005). |
geolattice.rsense.surface_energy_balance.broadband_transmissivity |
One-way broadband shortwave transmissivity of the atmosphere for clear sky. |
geolattice.rsense.surface_energy_balance.calibrate_dt |
Coefficients of the near-surface temperature difference dT = a + b Ts from the anchors: b = (dT_hot - dT_cold) / (Ts_hot - Ts_cold), a = dT_hot - b Ts_hot. |
geolattice.rsense.surface_energy_balance.calibration_history |
Iteration table of a SEBAL or METRIC run (anchor rah, dT, a, b, H, L per iteration). |
geolattice.rsense.surface_energy_balance.candidate_anchors |
Candidate cold and hot anchor pixels (Allen et al. 2013 percentile method). |
geolattice.rsense.surface_energy_balance.cold_reference_temperature |
SSEBop cold boundary temperature Tc = c Tmax (Senay et al. 2013). |
geolattice.rsense.surface_energy_balance.compare_to_tower |
Accuracy of predicted against observed values (ET in mm, or fluxes): count, mean of each, bias, mean absolute error, RMSE, relative RMSE, R2 (squared Pearson correlation), Nash-Sutcliffe efficiency and the ordinary least squares slope… |
geolattice.rsense.surface_energy_balance.cos_incidence |
Cosine of the solar incidence angle on a sloping surface (Duffie and Beckman; Allen 2006). |
geolattice.rsense.surface_energy_balance.daily_net_radiation |
Daily (24 h mean) net radiation (W m-2) from daily shortwave rs24 (W m-2) with the de Bruin (1987) / Bastiaanssen (2000) longwave term: (1 - albedo) Rs24 - a tau24. |
geolattice.rsense.surface_energy_balance.datum_temperature |
Surface temperature moved to a common elevation (METRIC Ts_datum): Ts + lapse_rate (z - z_ref). |
geolattice.rsense.surface_energy_balance.day_of_year |
Day of the year (1 to 366) of a date, datetime or string. |
geolattice.rsense.surface_energy_balance.dt_from_climate |
SSEBop temperature difference between the hot and cold boundaries (K): dT = Rn rah / (rho cp), with clear-sky daily net radiation (W m-2) and a fixed aerodynamic resistance of 110 s m-1 for bare dry soil. |
geolattice.rsense.surface_energy_balance.energy_closure |
Energy balance closure of fluxes (tower or model): ratio sum(H + LE) / sum(Rn - G), mean residual Rn - G - H - LE (W m-2) and the slope of H + LE against Rn - G. |
geolattice.rsense.surface_energy_balance.equation_of_time |
Seasonal correction for solar time (hours), FAO-56 eq. 32. |
geolattice.rsense.surface_energy_balance.etrf |
Reference ET fraction ETrF = ET_inst / ETr_inst (METRIC), the satellite crop coefficient relative to alfalfa. |
geolattice.rsense.surface_energy_balance.evaporative_fraction |
Evaporative fraction EF = LE / (Rn - G). |
geolattice.rsense.surface_energy_balance.extraterrestrial_radiation_daily |
Daily extraterrestrial radiation Ra (MJ m-2 d-1), FAO-56 eq. 21. |
geolattice.rsense.surface_energy_balance.extraterrestrial_radiation_hourly |
Extraterrestrial radiation Ra (MJ m-2 per period) for a period centred on UTC when, FAO-56 eq. 28. |
geolattice.rsense.surface_energy_balance.fao56_eto |
FAO-56 Penman-Monteith grass reference ET (mm d-1); the same as the ASCE short reference. |
geolattice.rsense.surface_energy_balance.fractional_cover |
Fractional vegetation cover ((NDVI - NDVIs) / (NDVIv - NDVIs))^power, clipped 0 to 1. |
geolattice.rsense.surface_energy_balance.friction_velocity |
Friction velocity (m s-1): u* = k u / (ln(z / zom) - psi_m). |
geolattice.rsense.surface_energy_balance.hour_angle |
Solar hour angle (rad) at UTC time when and longitude lon (degrees, east positive). |
geolattice.rsense.surface_energy_balance.incoming_longwave |
Incoming longwave radiation (W m-2): eps_a sigma Ta^4. |
geolattice.rsense.surface_energy_balance.incoming_shortwave |
Incoming shortwave radiation at the surface (W m-2) for clear sky: Rs_in = Gsc cos(theta) dr tau_sw. |
geolattice.rsense.surface_energy_balance.instantaneous_et |
Instantaneous ET (mm h-1) from LE (W m-2): 3600 LE / lambda; lambda from lst_k when given, else 2.45 MJ kg-1. |
geolattice.rsense.surface_energy_balance.instantaneous_to_daily |
Daily ET (mm d-1) from an instantaneous fraction held constant over the day. |
geolattice.rsense.surface_energy_balance.interpolate_etrf |
Daily ETrF (or ETf) between clear satellite dates by linear interpolation in time. |
geolattice.rsense.surface_energy_balance.interpolate_weather |
Linearly interpolate an hourly weather table (DatetimeIndex, UTC) to the overpass time. |
geolattice.rsense.surface_energy_balance.inverse_relative_distance |
Inverse relative Earth-Sun distance dr = 1 + 0.033 cos(2 pi J / 365) (FAO-56 eq. 23). |
geolattice.rsense.surface_energy_balance.latent_heat_flux |
Latent heat flux as the energy balance residual (W m-2): LE = Rn - G - H. |
geolattice.rsense.surface_energy_balance.latent_heat_of_vaporization |
Latent heat of vaporization (J kg-1) at temperature t_k (K): lambda = (2.501 - 0.00236 (T - 273.15)) 1e6. |
geolattice.rsense.surface_energy_balance.leaf_area_index |
Leaf area index from SAVI (Allen et al. 2002, METRIC): LAI = -ln((0.69 - SAVI) / 0.59) / 0.91, capped at max_lai, zero below SAVI 0.1. |
geolattice.rsense.surface_energy_balance.momentum_roughness |
Momentum roughness length zom (m). |
geolattice.rsense.surface_energy_balance.monin_obukhov_length |
Monin-Obukhov length (m): L = -rho cp u*^3 T / (k g H). |
geolattice.rsense.surface_energy_balance.monte_carlo_anchors |
Spread of a model result over many anchor pairs drawn from the candidate pools. |
geolattice.rsense.surface_energy_balance.ndvi |
Normalized difference vegetation index (nir - red) / (nir + red). |
geolattice.rsense.surface_energy_balance.net_radiation |
All wave net radiation (W m-2): Rn = (1 - albedo) Rs_in + RL_in - RL_out - (1 - eps_0) RL_in. |
geolattice.rsense.surface_energy_balance.outgoing_longwave |
Outgoing longwave radiation (W m-2): eps_0 sigma Ts^4. |
geolattice.rsense.surface_energy_balance.partition_et |
Transpiration fraction T / ET = LE_c / (LE_c + LE_s). |
geolattice.rsense.surface_energy_balance.precipitable_water |
Precipitable water in the atmosphere (mm), ASCE (2005): W = 0.14 ea P + 2.1. |
geolattice.rsense.surface_energy_balance.pressure_from_elevation |
Atmospheric pressure (kPa) from elevation (m): 101.3 ((293 - 0.0065 z) / 293)^5.26. |
geolattice.rsense.surface_energy_balance.priestley_taylor_jpl |
PT-JPL (Fisher et al. 2008): Priestley-Taylor ET reduced by ecophysiological constraints. |
geolattice.rsense.surface_energy_balance.psychrometric_constant |
Psychrometric constant (kPa C-1): 0.000665 P. |
geolattice.rsense.surface_energy_balance.run_metric |
METRIC (Allen et al. 2007): SEBAL style H calibrated so that the cold anchor has ET = etrf_cold ETr and the hot anchor ET = etrf_hot ETr. |
geolattice.rsense.surface_energy_balance.run_sebal |
SEBAL (Bastiaanssen et al. 1998): H from hot and cold anchors (no ET at the hot pixel, no H at the cold pixel), LE as the residual, the evaporative fraction and, with daily net radiation rn24 (W m-2, daily_net_radiation), daily ET… |
geolattice.rsense.surface_energy_balance.run_ssebop |
SSEBop (Senay et al. 2013): ETf = (Th - Ts) / dT with Th = Tc + dT, clipped to 0 and max_etf, and actual ET ETa = ETf k ETo (eto in mm d-1; k scales the reference, 1 for the reference used to calibrate, about 1.25 to move… |
geolattice.rsense.surface_energy_balance.saturation_vapour_pressure |
Saturation vapour pressure (kPa) at air temperature t_c (C), FAO-56 eq. 11. |
geolattice.rsense.surface_energy_balance.savi |
Soil adjusted vegetation index (1 + L)(nir - red) / (L + nir + red). |
geolattice.rsense.surface_energy_balance.scene_geometry |
Overpass time and sun angles from a Landsat MTL dict or a STAC item’s properties. |
geolattice.rsense.surface_energy_balance.seasonal_et |
Seasonal (or monthly with freq="MS") ET totals (mm): the sum over days of the daily fraction times daily reference ET. |
geolattice.rsense.surface_energy_balance.select_anchors |
Pick one cold and one hot anchor pixel. |
geolattice.rsense.surface_energy_balance.sensible_heat_iterative |
Sensible heat flux H by the SEBAL / METRIC internal calibration with stability iteration. |
geolattice.rsense.surface_energy_balance.sensitivity |
One at a time sensitivity of a model output. |
geolattice.rsense.surface_energy_balance.slope_aspect |
Slope and aspect (degrees, aspect clockwise from north) of a projected DEM in metres. |
geolattice.rsense.surface_energy_balance.slope_vapour_pressure_curve |
Slope of the saturation vapour pressure curve (kPa C-1), FAO-56 eq. 13. |
geolattice.rsense.surface_energy_balance.soil_heat_flux |
Soil heat flux G (W m-2). |
geolattice.rsense.surface_energy_balance.solar_declination |
Solar declination (rad), FAO-56 eq. 24: 0.409 sin(2 pi J / 365 - 1.39). |
geolattice.rsense.surface_energy_balance.solar_position |
Sun zenith and azimuth (degrees, azimuth clockwise from north) at UTC time when. |
geolattice.rsense.surface_energy_balance.ssebi |
S-SEBI (Roerink et al. 2000): evaporative fraction from the albedo and LST scatter. |
geolattice.rsense.surface_energy_balance.stability_corrections |
Stability corrections (psi_m, psi_h) at height z for Monin-Obukhov length L. |
geolattice.rsense.surface_energy_balance.sunset_hour_angle |
Sunset hour angle ws = arccos(-tan(lat) tan(dec)) (rad), FAO-56 eq. 25. |
geolattice.rsense.surface_energy_balance.surface_emissivity |
Surface emissivity from LAI (Tasumi 2003, METRIC). |
geolattice.rsense.surface_energy_balance.thermal_sharpen |
Sharpen coarse LST with fine resolution reflectance (data mining sharpener, Gao et al. 2012). |
geolattice.rsense.surface_energy_balance.triangle_method |
Ts and vegetation triangle (Jiang and Islam 2001) with a Priestley-Taylor parameter. |
geolattice.rsense.surface_energy_balance.tseb_pt |
Two-source energy balance with the Priestley-Taylor start (TSEB-PT, Norman et al. 1995), parallel resistance network. |
geolattice.rsense.surface_energy_balance.weather_open_meteo |
Hourly (and optional daily) ERA5 based weather from the free Open-Meteo archive API. |
geolattice.rsense.surface_energy_balance.wind_2m |
Wind speed at 2 m from wind at height z (FAO-56 eq. 47): u2 = uz 4.87 / ln(67.8 z - 5.42). |
geolattice.rsense.surface_energy_balance.wind_at_blending_height |
Wind speed at the blending height (m s-1) from a weather station measurement. |
geolattice.rsense.surface_energy_balance.zonal_et |
ET statistics per zone (mm) and water volume (m3). |
geolattice.rsense.soil_moisture
Satellite soil moisture: physics, products, SAR retrieval, downscaling, validation, applications.
Functions
| Name | Description |
|---|---|
geolattice.rsense.soil_moisture.antecedent_moisture |
Planned (raises NotImplementedError). Pre-event soil moisture (mean of the days before each storm). [Module 25] |
geolattice.rsense.soil_moisture.bucket_model |
Planned (raises NotImplementedError). Single-layer bucket water balance (mm) for root-zone soil moisture. [Module 22] |
geolattice.rsense.soil_moisture.calibrate_wcm |
Planned (raises NotImplementedError). Fit WCM parameters with scipy.optimize.least_squares, optionally per crop or stage. [Module 12] |
geolattice.rsense.soil_moisture.change_detection |
Planned (raises NotImplementedError). Relative surface soil moisture (0 to 1) = (sigma0 - dry) / (wet - dry). [Module 11] |
geolattice.rsense.soil_moisture.change_detection_references |
Planned (raises NotImplementedError). Per-pixel dry and wet reference backscatter for TU Wien change detection. [Module 11] |
geolattice.rsense.soil_moisture.crop_stage_features |
Planned (raises NotImplementedError). Zonal soil moisture features per district and crop stage, for yield models. [Module 24] |
geolattice.rsense.soil_moisture.daily_cube |
Planned (raises NotImplementedError). Stack granules into a regular daily time, y, x cube. [Module 5] |
geolattice.rsense.soil_moisture.decode_flags |
Planned (raises NotImplementedError). Expand a bit-packed quality layer into named boolean layers. [Modules 5, 14] |
geolattice.rsense.soil_moisture.degree_of_saturation |
Degree of saturation theta / porosity (0 to 1). [Modules 1, 8] |
geolattice.rsense.soil_moisture.dispatch |
Planned (raises NotImplementedError). DisPATCh downscaling of coarse soil moisture with fine SEE (Merlin et al. 2012). [Module 16] |
geolattice.rsense.soil_moisture.dobson_dielectric |
Complex soil permittivity from the Dobson et al. |
geolattice.rsense.soil_moisture.download_product |
Planned (raises NotImplementedError). Download granules into a per-product cache, skipping files already present. [Module 4] |
geolattice.rsense.soil_moisture.drought_class |
Planned (raises NotImplementedError). Map percentiles to D0 to D4 classes (USDM style thresholds). [Module 23] |
geolattice.rsense.soil_moisture.drought_events |
Planned (raises NotImplementedError). Run theory events: onset, termination, duration, severity and peak intensity. [Module 23] |
geolattice.rsense.soil_moisture.dubois_model |
Planned (raises NotImplementedError). Dubois et al. |
geolattice.rsense.soil_moisture.ease2_grid |
Planned (raises NotImplementedError). EASE-Grid 2.0 coordinates (x, y in EPSG:6933, lat, lon) for a grid or its AOI subset. [Module 4] |
geolattice.rsense.soil_moisture.ease2_index |
Planned (raises NotImplementedError). Row and column of EASE-Grid 2.0 cells containing the given points. [Modules 4, 19] |
geolattice.rsense.soil_moisture.enkf_assimilate |
Planned (raises NotImplementedError). Ensemble Kalman Filter assimilation of surface retrievals into a bucket model. [Module 22] |
geolattice.rsense.soil_moisture.event_response |
Planned (raises NotImplementedError). Peak flow, runoff ratio and their relation to antecedent moisture per event. [Module 25] |
geolattice.rsense.soil_moisture.explain_downscaling |
Planned (raises NotImplementedError). SHAP values and partial dependence for a fitted downscaling model. [Module 17] |
geolattice.rsense.soil_moisture.exponential_filter |
Planned (raises NotImplementedError). Soil Water Index by the recursive exponential filter (Albergel et al. 2008). [Modules 8, 22] |
geolattice.rsense.soil_moisture.extract_at_stations |
Planned (raises NotImplementedError). Pixel time series at matched stations, as a tidy station, time, value table. [Module 19] |
geolattice.rsense.soil_moisture.fill_climatology_anomaly |
Planned (raises NotImplementedError). Interpolate anomalies in time and add the climatology back. [Module 18] |
geolattice.rsense.soil_moisture.fill_dineof |
Planned (raises NotImplementedError). DINEOF-style iterative EOF reconstruction of missing values. [Module 18] |
geolattice.rsense.soil_moisture.fill_gp |
Planned (raises NotImplementedError). Gaussian process gap filling with predictive standard deviation. [Module 18] |
geolattice.rsense.soil_moisture.free_water_dielectric |
Complex permittivity of free water from the Debye model (Ulaby and Long 2014). [Module 2] |
geolattice.rsense.soil_moisture.fresnel_reflectivity |
Smooth surface Fresnel power reflectivity (0 to 1) at horizontal or vertical polarization. [Module 2] |
geolattice.rsense.soil_moisture.gap_fraction |
Planned (raises NotImplementedError). Share of missing days per pixel and missing pixels per day. [Module 18] |
geolattice.rsense.soil_moisture.harmonize |
Planned (raises NotImplementedError). Put several products on one grid and calendar (one variable per product). [Modules 4, 6, 9] |
geolattice.rsense.soil_moisture.hazard_indicator |
Planned (raises NotImplementedError). Simple flood potential, landslide or fire-risk moisture indicator. [Module 25] |
geolattice.rsense.soil_moisture.iem_lut |
Planned (raises NotImplementedError). Look-up table of IEM backscatter over theta, roughness and incidence. [Module 12] |
geolattice.rsense.soil_moisture.invert_lut |
Planned (raises NotImplementedError). Invert backscatter against a look-up table (nearest or interpolated cost minimum). [Module 12] |
geolattice.rsense.soil_moisture.invert_tau_omega |
Single channel algorithm: retrieve theta (m3 m-3) by inverting tau_omega. [Module 2] |
geolattice.rsense.soil_moisture.invert_wcm |
Planned (raises NotImplementedError). Invert the calibrated WCM to soil moisture maps. [Module 12] |
geolattice.rsense.soil_moisture.irrigation_events |
Planned (raises NotImplementedError). Field irrigation events: moisture jumps without matching rainfall (Sentinel-1 based). [Module 24] |
geolattice.rsense.soil_moisture.irrigation_signal |
Planned (raises NotImplementedError). Satellite minus model divergence and seasonal irrigation score (e.g. |
geolattice.rsense.soil_moisture.lagged_correlation |
Planned (raises NotImplementedError). Correlation and best lag between soil moisture and SPI/SPEI or NDVI/VCI. [Module 23] |
geolattice.rsense.soil_moisture.load_soilgrids |
Planned (raises NotImplementedError). Read SoilGrids 2.0 properties for an AOI from the ISRIC WCS/COGs. [Modules 1, 11, 15] |
geolattice.rsense.soil_moisture.mask_quality |
Planned (raises NotImplementedError). Mask retrievals with product-specific quality bits and surface flags. [Modules 5, 6, 14] |
geolattice.rsense.soil_moisture.match_stations |
Planned (raises NotImplementedError). Map each station to the containing (or nearest) pixel of each product. [Module 19] |
geolattice.rsense.soil_moisture.merge_products |
Planned (raises NotImplementedError). Weighted merge of rescaled products; weights from triple collocation errors. [Modules 18, 21] |
geolattice.rsense.soil_moisture.mironov_dielectric |
Complex soil permittivity from the Mironov et al. |
geolattice.rsense.soil_moisture.ml_downscale |
Planned (raises NotImplementedError). Train on coarse-aggregated predictors and predict at fine scale. [Module 17] |
geolattice.rsense.soil_moisture.normalize_incidence |
Planned (raises NotImplementedError). Normalize backscatter to a reference angle; fits the slope if not given. [Module 10] |
geolattice.rsense.soil_moisture.oh_model |
Planned (raises NotImplementedError). Oh semi-empirical surface backscatter (VV, HH, HV in dB). [Module 12] |
geolattice.rsense.soil_moisture.open_product |
Planned (raises NotImplementedError). One call that searches, downloads (or streams) and reads a product as a tidy cube. [Module 4] |
geolattice.rsense.soil_moisture.optimize_t |
Planned (raises NotImplementedError). Score each characteristic time against deep sensors; pick the best T. [Module 22] |
geolattice.rsense.soil_moisture.optram |
Planned (raises NotImplementedError). OPTRAM normalized moisture (0 to 1) from STR, NDVI and fitted edges. [Modules 2, 15] |
geolattice.rsense.soil_moisture.optram_edges |
Planned (raises NotImplementedError). Fit OPTRAM wet and dry edges in STR-NDVI space (Sadeghi et al. 2017). [Module 15] |
geolattice.rsense.soil_moisture.penetration_depth |
Power penetration depth (cm) 1 / (2 alpha) of a lossy medium. [Module 2] |
geolattice.rsense.soil_moisture.plot_validation |
Planned (raises NotImplementedError). Time series, scatter with 1:1 line or Taylor diagram for a validation table. [Module 20] |
geolattice.rsense.soil_moisture.porosity_from_bulk_density |
Total porosity 1 - rho_b / rho_s (m3 m-3). [Module 1] |
geolattice.rsense.soil_moisture.porosity_from_texture |
Saturated water content (m3 m-3) from texture with Saxton and Rawls (2006). [Modules 1, 8, 11] |
geolattice.rsense.soil_moisture.predict_unet |
Planned (raises NotImplementedError). Apply a trained U-Net tile by tile (wraps rsense.core.apply_tiled). [Module 17] |
geolattice.rsense.soil_moisture.predictor_stack |
Planned (raises NotImplementedError). 1 km predictors aligned to the coarse grid: MODIS/VIIRS LST, NDVI, SoilGrids, slope, TWI. [Module 15] |
geolattice.rsense.soil_moisture.product_info |
Planned (raises NotImplementedError). Registry entry for a product in PRODUCTS (case-insensitive name). [Module 3] |
geolattice.rsense.soil_moisture.product_table |
Planned (raises NotImplementedError). Comparison table of products: band, resolution, revisit, period, access, latency. [Module 3] |
geolattice.rsense.soil_moisture.read_amsr2_lprm |
Planned (raises NotImplementedError). Read AMSR2 LPRM soil moisture and VOD for one band. [Module 7] |
geolattice.rsense.soil_moisture.read_ascat |
Planned (raises NotImplementedError). Read H SAF ASCAT SSM time series (ascat package) or the SWI grid. [Modules 8, 22] |
geolattice.rsense.soil_moisture.read_clms_ssm |
Planned (raises NotImplementedError). Read Copernicus Land 1 km surface soil moisture (Sentinel-1, Europe). [Module 13] |
geolattice.rsense.soil_moisture.read_era5_land |
Planned (raises NotImplementedError). ERA5-Land volumetric soil water (swvl1 to swvl4) from CDS or a local file. [Modules 9, 21, 24] |
geolattice.rsense.soil_moisture.read_esa_cci |
Planned (raises NotImplementedError). Read ESA CCI SM daily files with uncertainty, flag, sensor and frequency layers. [Module 9] |
geolattice.rsense.soil_moisture.read_ismn |
Planned (raises NotImplementedError). Read ISMN downloads with the ismn reader. [Module 19] |
geolattice.rsense.soil_moisture.read_network |
Planned (raises NotImplementedError). Read a regional network directly from its provider. [Module 19] |
geolattice.rsense.soil_moisture.read_nisar_sm |
Planned (raises NotImplementedError). Read a NISAR L3 soil moisture HDF5 with its retrieval flags. [Module 14] |
geolattice.rsense.soil_moisture.read_smap |
Planned (raises NotImplementedError). Read a SMAP HDF5 granule onto its EASE-Grid 2.0 grid with h5py. [Modules 5, 13] |
geolattice.rsense.soil_moisture.read_smos |
Planned (raises NotImplementedError). Read SMOS CATDS L3 or ESA L2 NetCDF, keeping RFI probability and DQX. [Module 6] |
geolattice.rsense.soil_moisture.relative_to_volumetric |
Planned (raises NotImplementedError). Scale relative moisture to m3 m-3 with porosity (e.g. from SoilGrids). [Module 11] |
geolattice.rsense.soil_moisture.representativeness |
Planned (raises NotImplementedError). Spatial representativeness error of points within coarse cells. [Module 19] |
geolattice.rsense.soil_moisture.rescale |
Planned (raises NotImplementedError). Rescale a series or cube to the reference climatology, e.g. |
geolattice.rsense.soil_moisture.rough_reflectivity |
H-Q-N roughness correction (Wang and Choudhury 1981). [Module 2] |
geolattice.rsense.soil_moisture.s1_soil_moisture_cube |
Planned (raises NotImplementedError). Analysis-ready Sentinel-1 VV/VH cube for soil moisture. [Module 10] |
geolattice.rsense.soil_moisture.sar_masks |
Planned (raises NotImplementedError). Boolean masks for open water, urban, frozen soil, steep slopes, layover and shadow. [Module 10] |
geolattice.rsense.soil_moisture.saturation_to_volumetric |
Degree of saturation (0 to 1, or % above 1.5) to m3 m-3, e.g. |
geolattice.rsense.soil_moisture.saxton_rawls |
Saxton and Rawls (2006) pedotransfer functions. [Module 1] |
geolattice.rsense.soil_moisture.search_product |
Planned (raises NotImplementedError). Find granules of a registry product with the right backend. [Module 4] |
geolattice.rsense.soil_moisture.short_term_change_detection |
Planned (raises NotImplementedError). Short-term change detection (Balenzano et al. 2011) scaled by a coarse product. [Modules 11, 13] |
geolattice.rsense.soil_moisture.sm_anomaly |
Planned (raises NotImplementedError). Anomaly from a climatology (wraps rsense.timeseries.anomaly). [Modules 9, 20] |
geolattice.rsense.soil_moisture.sm_climatology |
Planned (raises NotImplementedError). Smoothed day-of-year or monthly climatology (wraps rsense.timeseries.climatology). [Modules 5, 9] |
geolattice.rsense.soil_moisture.sm_percentile |
Planned (raises NotImplementedError). Day-of-year percentile of soil moisture against its own record. [Module 23] |
geolattice.rsense.soil_moisture.smapi |
Planned (raises NotImplementedError). Soil Moisture Anomaly Percentage Index, 100 * (theta - mean) / mean. [Module 23] |
geolattice.rsense.soil_moisture.soil_evaporative_efficiency |
Planned (raises NotImplementedError). Soil evaporative efficiency SEE from the soil temperature end-members (DisPATCh). [Modules 15, 16] |
geolattice.rsense.soil_moisture.soil_water_status |
Relative available water (theta - WP) / (FC - WP), clipped to 0 to 1. [Modules 1, 23] |
geolattice.rsense.soil_moisture.spatial_blocks |
Planned (raises NotImplementedError). Fold labels on spatial blocks for leakage-free cross-validation. [Modules 17, 24] |
geolattice.rsense.soil_moisture.ssi |
Planned (raises NotImplementedError). Standardized Soil moisture Index on monthly aggregates. [Module 23] |
geolattice.rsense.soil_moisture.str_transform |
Planned (raises NotImplementedError). SWIR transformed reflectance STR = (1 - R)^2 / (2 R). [Modules 2, 15] |
geolattice.rsense.soil_moisture.swdi |
Planned (raises NotImplementedError). Soil Water Deficit Index 10 * (theta - FC) / (FC - WP) (Martinez-Fernandez et al. 2015). [Module 23] |
geolattice.rsense.soil_moisture.tau_omega |
Zeroth-order tau-omega brightness temperature Tb (K) of a vegetated soil. [Module 2] |
geolattice.rsense.soil_moisture.tb_sensitivity |
Tidy table of Tb and dTb/dtheta under rising VOD, for the Notebook 2.1 plot. [Module 2] |
geolattice.rsense.soil_moisture.tc_weights |
Planned (raises NotImplementedError). Least-squares merging weights from triple collocation error variances. [Modules 18, 21] |
geolattice.rsense.soil_moisture.temporal_match |
Planned (raises NotImplementedError). Nearest-in-time matching of satellite series to a reference (pytesmo style). [Module 20] |
geolattice.rsense.soil_moisture.thermal_inertia_downscale |
Planned (raises NotImplementedError). Thermal inertia (diurnal LST amplitude) downscaling. [Module 16] |
geolattice.rsense.soil_moisture.to_cache |
Planned (raises NotImplementedError). Write a cube to Zarr or Cloud-Optimized GeoTIFFs (wraps rsense.core.write). [Module 4] |
geolattice.rsense.soil_moisture.topp |
Topp et al. |
geolattice.rsense.soil_moisture.topp_inverse |
Apparent permittivity from theta, inverse of topp (Newton’s method). [Module 2] |
geolattice.rsense.soil_moisture.trend |
Planned (raises NotImplementedError). Mann-Kendall test and Sen’s slope per pixel on aggregated values. [Module 9] |
geolattice.rsense.soil_moisture.triple_collocation |
Planned (raises NotImplementedError). Error standard deviations, SNR and data-truth correlations of three products. [Module 21] |
geolattice.rsense.soil_moisture.triple_collocation_map |
Planned (raises NotImplementedError). Per-pixel triple collocation error maps (e.g. |
geolattice.rsense.soil_moisture.ts_vi_edges |
Planned (raises NotImplementedError). Dry and wet edges of the LST-NDVI triangle. [Module 15] |
geolattice.rsense.soil_moisture.tvdi |
Planned (raises NotImplementedError). Temperature-Vegetation Dryness Index (Sandholt et al. 2002). [Modules 2, 15] |
geolattice.rsense.soil_moisture.unet_downscale |
Planned (raises NotImplementedError). Train a PyTorch U-Net super-resolution model on coarse/fine pairs (GPU, CPU fallback). [Module 17] |
geolattice.rsense.soil_moisture.validation_metrics |
Planned (raises NotImplementedError). bias, RMSE, ubRMSE, Pearson and Spearman R, anomaly R and n, with bootstrap CIs. [Module 20] |
geolattice.rsense.soil_moisture.validation_report |
Planned (raises NotImplementedError). Metrics per product and stratum (land cover, VOD class, aridity, season). [Module 20] |
geolattice.rsense.soil_moisture.vod_from_vwc |
Nadir vegetation optical depth tau = b VWC; VWC in kg m-2 (Jackson and Schmugge 1991). [Modules 2, 7] |
geolattice.rsense.soil_moisture.volumetric_from_gravimetric |
Volumetric water content theta = w rho_b / rho_w (m3 m-3). [Module 1] |
geolattice.rsense.soil_moisture.vwc_from_ndvi |
Vegetation water content (kg m-2) from NDVI, as in the SMAP ancillary (Chan et al. 2013). [Modules 2, 12] |
geolattice.rsense.soil_moisture.water_cloud_model |
Planned (raises NotImplementedError). Forward Water Cloud Model (Attema and Ulaby 1978) with a linear soil term C + D theta. [Module 12] |
Visualization
Static maps, choropleths, raster displays and interactive maps.
import geolattice.viz
geolattice.viz._imports
Lazy imports for optional visualization libraries.
Classes
| Name | Description |
|---|---|
geolattice.viz.VisualizationError |
Raised when a spatial dataset cannot be drawn. |
geolattice.viz.style
Map colors and axes styling.
Functions
| Name | Description |
|---|---|
geolattice.viz.apply_map_style |
Apply the tutorial Matplotlib theme for static maps and charts. |
geolattice.viz.style_axes |
Style one map axes the way the vector tutorial draws its figures. |
geolattice.viz.vector
Static maps for vector layers.
Functions
| Name | Description |
|---|---|
geolattice.viz.animate_map |
Animate one map frame for each distinct value of time. |
geolattice.viz.plot_boundary |
Draw polygon boundaries with an empty interior. |
geolattice.viz.plot_categorical |
Color features by a category such as a name or a land-use code. |
geolattice.viz.plot_choropleth |
Color each feature by an attribute. |
geolattice.viz.plot_layer |
Draw one polygon, line, or point layer. |
geolattice.viz.plot_layers |
Overlay several layers on one axes. |
geolattice.viz.plot_pair |
Draw two layers side by side. |
geolattice.viz.plot_points |
Scatter point coordinates. |
geolattice.viz.save_map |
Write a Matplotlib figure to an image file and return the path. |
geolattice.viz.basemap
Web-map tiles under a Matplotlib axes.
Functions
| Name | Description |
|---|---|
geolattice.viz.add_basemap |
Draw XYZ tiles behind geometries already plotted on ax. |
geolattice.viz.raster
Raster and gridded-data maps.
Functions
| Name | Description |
|---|---|
geolattice.viz.adjust_image |
Adjust brightness [0, 1], contrast [-1, 1], saturation [-1, 1]. |
geolattice.viz.infer_raster_kind |
Infer general, unique, or rgb from the raster values. |
geolattice.viz.normalize_band |
Normalize a band to [0, 1] for RGB composites. |
geolattice.viz.plot_contours |
Draw contour lines, or filled contours, for a 2-D grid. |
geolattice.viz.plot_false_color |
Draw a false-color composite (default NIR-Red-Green). |
geolattice.viz.plot_gridded |
Draw a longitude/latitude grid on a Cartopy projection. |
geolattice.viz.plot_raster |
Draw a raster as a general, unique-value, or RGB layer. |
geolattice.viz.plot_raster_bands |
Plot selected bands side by side (Python GIS multi-band layout). |
geolattice.viz.plot_raster_facet |
Facet a multiband or time-series raster (ggplot facet_wrap style). |
geolattice.viz.plot_raster_histogram |
Plot value histograms for one or more bands. |
geolattice.viz.plot_rasters |
Draw several rasters in one figure, one panel each. |
geolattice.viz.plot_rgb |
Draw a true-color RGB composite from three bands. |
geolattice.viz.plot_unique_raster |
Draw a unique-value / classified raster with a categorical legend. |
geolattice.viz.interactive
Interactive Leaflet maps through Folium and GeoPandas.
Functions
| Name | Description |
|---|---|
geolattice.viz.add_choropleth |
Add a choropleth to an existing map. |
geolattice.viz.add_geojson |
Add GeoJSON, or a GeoDataFrame converted to GeoJSON, as one layer. |
geolattice.viz.add_layer_control |
Add a Folium layer control if the map does not already have one. |
geolattice.viz.add_markers |
Add one circle marker for each point. |
geolattice.viz.add_vector_layer |
Add a GeoDataFrame to an existing Folium map. |
geolattice.viz.interactive_map |
Open a Folium map, optionally drawing data on it. |
geolattice.viz.annotate
Labels, a north arrow, and a scale bar for a static map.
Functions
| Name | Description |
|---|---|
geolattice.viz.add_labels |
Write one attribute at each feature’s representative point. |
geolattice.viz.add_north_arrow |
Draw a north arrow in axes coordinates so it stays put while zooming the data. |
geolattice.viz.add_scale_bar |
Draw a scale bar using the axes coordinates. |
geolattice.viz.cartographic_elements |
Add a north arrow and a scale bar to a map that was already drawn. |
geolattice.viz.charts
Attribute charts that sit next to a map.
Functions
| Name | Description |
|---|---|
geolattice.viz.plot_bar |
Bar chart of one numeric column, summed when labels groups the rows. |
geolattice.viz.plot_histogram |
Histogram of one numeric column. |
geolattice.viz.plot_pie |
Pie chart of one numeric column. |
geolattice.viz.plot_scatter |
Scatter two attribute columns, optionally colored by a third. |
Distributed and GPU computing
One API for vector and raster processing, spatial statistics, networks, hydrology and machine learning on all CPU cores, a Dask cluster (local, multi-GPU, SLURM, PBS, Kubernetes), Spark with Apache Sedona, or CUDA GPUs.
import geolattice.distributed
geolattice.distributed._session
Dask cluster lifecycle for :mod:geolattice.distributed.
Classes
| Name | Description |
|---|---|
geolattice.distributed.Session |
An active cluster and client. Methods: adapt, close, dashboard_link, is_gpu, scale, status. |
Functions
| Name | Description |
|---|---|
geolattice.distributed.dashboard_link |
Signature: dashboard_link() -> 'str | None'. |
geolattice.distributed.get_session |
The active session, or None (Dask then uses its local threaded scheduler). |
geolattice.distributed.shutdown |
Close the active session, if any. |
geolattice.distributed.start |
Start (or connect to) a Dask cluster and make it the active session. |
geolattice.distributed.status |
Status of the active session, or a note that the local scheduler is in use. |
geolattice.distributed.diagnostics
Benchmarking, CPU-vs-GPU equivalence checks, dispatch explanations, memory and profiling.
Classes
| Name | Description |
|---|---|
geolattice.distributed.diagnostics.EquivalenceReport |
Outcome of check_equivalence; details lists every compared part. |
Functions
| Name | Description |
|---|---|
geolattice.distributed.benchmark |
Time func(*args, compute=c, **kwargs) for each c in computes. |
geolattice.distributed.check_equivalence |
Run func with each compute target and compare the results to the first one. |
geolattice.distributed.explain |
Which implementation op would use for compute and why. |
geolattice.distributed.memory_report |
Host, process, GPU (CuPy pool) and cluster-worker memory, in GB. |
geolattice.distributed.profile |
Run func and record where the time went. |
geolattice.distributed._backend
Capability detection and compute resolution for :mod:geolattice.distributed.
Functions
| Name | Description |
|---|---|
geolattice.distributed.capabilities |
Report which optional engines are importable and how many CUDA GPUs are visible. |
geolattice.distributed.compute |
dask.compute that returns a single object when given one. |
geolattice.distributed.get_defaults |
Signature: get_defaults() -> 'Defaults'. |
geolattice.distributed.is_gpu |
True if obj (array, Dask array or DataArray) holds CuPy data. |
geolattice.distributed.is_lazy |
True for Dask collections (including Dask-backed DataArrays and dask-geopandas frames). |
geolattice.distributed.persist |
dask.persist: keep results in cluster memory, returning still-lazy handles. |
geolattice.distributed.resolve_compute |
Resolve compute to "cpu" or "gpu". |
geolattice.distributed.set_defaults |
Set defaults used when a function is called without compute/chunks/npartitions. |
geolattice.distributed.to_cpu |
Move a CuPy/Dask-CuPy array or DataArray back to host memory. |
geolattice.distributed.to_gpu |
Move a NumPy/Dask array or DataArray to CUDA (Dask stays lazy, chunk by chunk). |
geolattice.distributed._registry
Operation registry: maps an operation name to its CPU and GPU implementations.
Functions
| Name | Description |
|---|---|
geolattice.distributed.dispatch |
Return (implementation, "cpu" \| "gpu") for op. |
geolattice.distributed.list_ops |
Registered operations and the compute targets each supports. |
geolattice.distributed.register |
Decorator registering fn as the compute ("cpu" or "gpu") version of op. |
geolattice.distributed.bridge
Raster and vector together: rasterize, zonal statistics, point extraction, polygonize.
Functions
| Name | Description |
|---|---|
geolattice.distributed.extract_values |
Sample raster at point locations. |
geolattice.distributed.polygonize |
Vectorize a (y, x) raster into polygons of equal value. |
geolattice.distributed.rasterize |
Burn features onto the grid of like (a DataArray; its last two dims are y, x). |
geolattice.distributed.zonal_stats |
Statistics of raster cells inside each zone polygon. |
geolattice.distributed._partition
Spatial partitioning for vector data and chunk planning for rasters.
Functions
| Name | Description |
|---|---|
geolattice.distributed.partition_bounds |
(n, 4) array of minx, miny, maxx, maxy for each partition. |
geolattice.distributed.plan_chunks |
Dask chunks for a raster: full leading dims, square spatial chunks. |
geolattice.distributed.spatial_partition |
Split a GeoDataFrame into npartitions spatially compact GeoDataFrames. |
geolattice.distributed.io
Parallel and chunked readers and writers for vector and raster data.
Functions
| Name | Description |
|---|---|
geolattice.distributed.read_raster |
Open a raster lazily as a Dask-backed DataArray (rioxarray.open_rasterio). |
geolattice.distributed.read_stac |
Load STAC items lazily into an xarray.Dataset with odc.stac.load. |
geolattice.distributed.read_vector |
Read vector data in parallel. |
geolattice.distributed.read_zarr |
Open a Zarr store lazily as an xarray.Dataset (chunks default to the store’s). |
geolattice.distributed.write_raster |
Write a DataArray/Dataset, computing chunks in parallel. |
geolattice.distributed.write_vector |
Write a partitioned GeoParquet dataset (one file per partition, written in parallel). |
geolattice.distributed.raster
Chunked raster processing on CPU (NumPy) or GPU (CuPy), locally or on a Dask cluster.
Functions
| Name | Description |
|---|---|
geolattice.distributed.raster.aspect |
Aspect: direction of steepest descent, degrees clockwise from north (flat where level). |
geolattice.distributed.raster.calc |
Raster calculator over named layers. |
geolattice.distributed.raster.convolve |
Convolve with a 2-D kernel (odd shape; edges use nearest values). |
geolattice.distributed.raster.curvature |
Total (Laplacian) curvature, 1/m: negative on ridges, positive in hollows. |
geolattice.distributed.raster.focal |
Moving-window statistic over a size x size window (edges use nearest values). |
geolattice.distributed.raster.hillshade |
Analytical hillshade scaled 0-255. |
geolattice.distributed.raster.map_tiles |
Apply func(block, xp) chunk by chunk, with overlap halo pixels. |
geolattice.distributed.raster.normalize |
Rescale to 0-1 (minmax) or to zero mean and unit variance (zscore), ignoring NaN. |
geolattice.distributed.raster.normalized_difference |
(a - b) / (a + b), e.g. |
geolattice.distributed.raster.reclassify |
Reclassify cell values. |
geolattice.distributed.raster.roughness |
Maximum minus minimum elevation in the 3x3 neighbourhood. |
geolattice.distributed.raster.slope |
Slope (Horn 1981). |
geolattice.distributed.raster.tpi |
Topographic Position Index: elevation minus the window x window mean. |
geolattice.distributed.raster.tri |
Terrain Ruggedness Index (Riley et al. 1999). |
geolattice.distributed.raster.where |
Element-wise a where cond is true, else b (a/b may be scalars). |
geolattice.distributed.vector
Partition-parallel vector processing.
Functions
| Name | Description |
|---|---|
geolattice.distributed.vector.area |
Area of each geometry (CRS units squared), as a Series aligned to the input index. |
geolattice.distributed.vector.bounds |
minx, miny, maxx, maxy of each geometry, as a DataFrame. |
geolattice.distributed.vector.buffer |
Buffer each geometry by distance (CRS units). |
geolattice.distributed.vector.centroid |
Replace each geometry by its centroid. |
geolattice.distributed.vector.clip |
Clip features to mask (a geometry, GeoSeries/GeoDataFrame or (minx, miny, maxx, maxy)). |
geolattice.distributed.vector.knn |
k nearest right points for every left point (Euclidean, CRS units). |
geolattice.distributed.vector.length |
Length or perimeter of each geometry, as a Series aligned to the input index. |
geolattice.distributed.vector.make_valid |
Repair invalid geometries (shapely.make_valid). |
geolattice.distributed.vector.simplify |
Douglas-Peucker simplification of each geometry. |
geolattice.distributed.vector.sjoin |
Spatial join, parallel over spatially partitioned left. |
geolattice.distributed.vector.to_crs |
Reproject to crs. |
geolattice.distributed.analysis
Spatial statistics and clustering at scale, on CPU (NumPy/SciPy) or GPU (CuPy/cuML).
Classes
| Name | Description |
|---|---|
geolattice.distributed.analysis.GlobalResult |
A global autocorrelation statistic with normal-approximation and permutation inference. |
geolattice.distributed.analysis.Weights |
Sparse spatial weights: sparse is an (n, n) SciPy CSR matrix (row i lists the neighbours of observation i), ids the matching index labels. Methods: binary, cardinalities, islands, n, row_standardize, to_gpu, to_libpysal. |
Functions
| Name | Description |
|---|---|
geolattice.distributed.analysis.dbscan |
DBSCAN clusters (-1 = noise) for point geometries or an (n, d) array. |
geolattice.distributed.analysis.gearys_c |
Geary’s C (expected value 1; below 1 means positive autocorrelation). |
geolattice.distributed.analysis.getis_ord_local |
Local Getis-Ord G (star=False) or G* (star=True) hot-spot statistic. |
geolattice.distributed.analysis.hdbscan |
HDBSCAN clusters (-1 = noise) for point geometries or an (n, d) array. |
geolattice.distributed.analysis.kde |
Kernel density (points per unit area, optionally weighted) on the grid of like. |
geolattice.distributed.analysis.kmeans |
K-means; returns (labels, centers). |
geolattice.distributed.analysis.local_morans |
Local Moran’s I (LISA). |
geolattice.distributed.analysis.morans_i |
Global Moran’s I with normal-approximation and permutation (p_sim) inference. |
geolattice.distributed.analysis.weights |
Spatial weights for the rows of gdf. |
geolattice.distributed.network
Network analysis on line data: cuGraph on GPU, SciPy / NetworkX on CPU.
Classes
| Name | Description |
|---|---|
geolattice.distributed.network.Graph |
Nodes xy (n, 2); edges src, dst, weight; edge_ids are the source line labels. Methods: n_edges, n_nodes, nodes_gdf, to_cugraph, to_networkx, to_scipy. |
Functions
| Name | Description |
|---|---|
geolattice.distributed.network.centrality |
Node centrality. |
geolattice.distributed.network.components |
(Weakly) connected component label per node, numbered from 0. |
geolattice.distributed.network.graph_from_lines |
Build a Graph from (multi)line geometries. |
geolattice.distributed.network.max_shortest_path_count |
Largest number of equal-hop shortest paths from two far-apart nodes (a cheap probe of whether cuGraph’s int64 path counters can overflow). |
geolattice.distributed.network.nearest_nodes |
Node id nearest to each point (Euclidean). |
geolattice.distributed.network.shortest_path |
Cheapest route: {"nodes": [...], "cost": float, "geometry": LineString} through node positions (nodes is empty and cost inf if unreachable). |
geolattice.distributed.network.shortest_path_lengths |
Cost from each source node to every node, (len(sources), n_nodes); inf where unreachable or beyond cutoff. |
geolattice.distributed.hydrology
Hydrology on DEMs.
Functions
| Name | Description |
|---|---|
geolattice.distributed.hydrology.fill_depressions |
Priority-flood depression filling (Barnes et al. 2014), in memory on CPU. |
geolattice.distributed.hydrology.flow_accumulation |
D8 contributing cells (or summed weights), solved as one sparse linear system in memory on CPU. |
geolattice.distributed.hydrology.flow_direction |
D8 flow direction 0-7 (N, NE, E, SE, S, SW, W, NW), -1 for pits, flats draining nowhere lower and cells whose steepest descent leaves the DEM. |
geolattice.distributed.ml
Machine learning on spatial data at scale: training, raster prediction, tiled deep.
Functions
| Name | Description |
|---|---|
geolattice.distributed.ml.ddp_model |
Move model to this rank’s device and wrap it in DistributedDataParallel. |
geolattice.distributed.ml.fit |
Fit model (a name or an estimator) and return the fitted estimator. |
geolattice.distributed.ml.predict_raster |
Predict every pixel of stack ((band, y, x) DataArray, or a Dataset whose variables are the bands, in the order the model was trained on). |
geolattice.distributed.ml.predict_tiles |
Run a PyTorch model ((N, C, h, w) -> (N, K, h, w)) over a (C, H, W) image in overlapping tiles. |
geolattice.distributed.ml.train_ddp |
Run fn(rank, world_size, *args) in nprocs processes with torch.distributed initialised, and return each rank’s return value. |
geolattice.distributed.sedona
Apache Sedona (Spark) engine for spatial joins that outgrow one machine.
Functions
| Name | Description |
|---|---|
geolattice.distributed.sedona.is_spark |
Signature: is_spark(obj: 'Any') -> 'bool'. |
geolattice.distributed.sedona.packages |
Maven coordinates for the installed Sedona and Spark versions. |
geolattice.distributed.sedona.sjoin |
Spatial join with Sedona; see the module docstring for inputs and outputs. |
geolattice.distributed.sedona.spark |
Start or reuse a Sedona-enabled Spark session (SedonaContext). |
geolattice.distributed.sedona.stop |
Stop the Spark session started by spark. |
geolattice.distributed.sedona.to_geopandas |
Spark DataFrame with a geometry column back to a GeoDataFrame. |
geolattice.distributed.sedona.to_spark |
GeoDataFrame to a Spark DataFrame (GeoArrow transfer when available). |
Compute backends
CPU and GPU execution backends.
import geolattice.compute
geolattice.compute.backend
Compute backend abstraction for GeoLattice.
Classes
| Name | Description |
|---|---|
geolattice.compute.BackendManager |
Manager for compute backends. Methods: cpu_backend, current_backend, get_backend_info, gpu_backend, initialize_gpu, set_backend. |
geolattice.compute.ComputeBackend |
Abstract base class for compute backends. Methods: allocate_memory, available, device_info, execute, free_memory, transfer_from_device, transfer_to_device. |
geolattice.compute.CPUBackend |
CPU-based compute backend. Methods: allocate_memory, available, device_info, execute, free_memory, num_workers, set_num_workers, transfer_from_device, transfer_to_device. |
geolattice.compute.GPUBackend |
GPU-based compute backend. Methods: allocate_memory, available, device_info, execute, free_memory, set_device, transfer_from_device, transfer_to_device. |
Functions
| Name | Description |
|---|---|
geolattice.compute.get_backend_manager |
Get the global backend manager instance. |
WhiteboxTools
Terrain and hydrology tools through WhiteboxTools.
import geolattice.whitebox
Functions and classes
Functions
| Name | Description |
|---|---|
geolattice.whitebox.aspect |
Calculate aspect from DEM using WhiteboxTools. |
geolattice.whitebox.breach_depressions |
Breach depressions in DEM using WhiteboxTools. |
geolattice.whitebox.d8_flow_accumulation |
Calculate D8 flow accumulation using WhiteboxTools. |
geolattice.whitebox.get_whitebox_tools |
Get the global WhiteboxTools instance. |
geolattice.whitebox.hillshade |
Calculate hillshade from DEM using WhiteboxTools. |
geolattice.whitebox.lidar_ground_point_filter |
Filter ground points from LiDAR data using WhiteboxTools. |
geolattice.whitebox.lidar_tin_gridding |
Generate raster from LiDAR points using TIN gridding with WhiteboxTools. |
geolattice.whitebox.slope |
Calculate slope from DEM using WhiteboxTools. |
geolattice.whitebox.watershed |
Delineate watersheds using WhiteboxTools. |
Networks, point clouds and STAC
Small helper modules.
Functions and classes
Functions
| Name | Description |
|---|---|
geolattice.network.is_online |
Return True when url answers within timeout seconds. |
Functions and classes
Functions
| Name | Description |
|---|---|
geolattice.stac.get_clearest_item |
Return the scene with the lowest eo:cloud_cover that covers aoi. |
geolattice.stac.search_stac |
Search collection over aoi and dates. |
Installation options
The six installation options and install hints for optional dependencies.
import geolattice.install_options
Functions and classes
Functions
| Name | Description |
|---|---|
geolattice.install_options.install_hint |
pip install text for one extra, naming the installation option that includes it. |
geolattice.install_options.option_for |
The smallest installation option that installs extra, or None if no option does. |
Aliases
These namespaces repeat objects listed above and are not listed again.
| Namespace | Same as |
|---|---|
geolattice.analysis |
alias of geolattice.spatial_analysis (also re-exports geostatistics and spatial statistics) |
geolattice.spatial_bd |
the package that holds geolattice.geolatticedb; geolattice.spatial_bd.geolatticedb and geolattice.geolatticedb are the same module |
geolattice.spatialcausal |
deprecated alias of geolattice.spatial_analysis.spatialcausal (emits a DeprecationWarning) |
geolattice.geostatistics.pygstat |
former name of geolattice.geostatistics, kept as an attribute alias |