API reference¶
An upstream river basin and everything open that can be clipped to it.
Create one from an outlet coordinate and every layer method afterwards is masked to the polygon, not to its bounding box::
import basinkit as bk
basin = bk.Basin.from_point(26.87, 87.15) # Sapta Koshi at Chatara
basin.area_km2
dem = basin.dem() # xarray, clipped + masked
lc = basin.landcover()
rain = basin.precipitation(2000, 2024) # basin-mean monthly series
basin.download_all("koshi/") # the whole default stack
Attributes:
| Name | Type | Description |
|---|---|---|
geometry |
shapely geometry
|
Basin polygon in EPSG:4326. |
provenance |
dict
|
Which backend and which dataset version produced the polygon. This travels with the basin so that a result is always attributable, and it is written into every export. |
Source code in basinkit/basin.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 | |
area_km2
property
¶
Basin area via an equal-area projection centred on the basin itself.
bbox_efficiency
property
¶
Basin area as a fraction of its bounding-box area.
This is the number that justifies polygon clipping. A compact basin scores near 0.7; a long dendritic one can drop below 0.25, meaning a bbox-based download wastes three quarters of everything it transfers and biases every basin average with a neighbour's pixels.
acquisitions()
¶
Every layer fetched on this basin, in the order it was fetched.
This is the row set a batch run should keep beside each basin: rerun the same outlet in six months and a diff over these records says whether the inputs moved.
Source code in basinkit/basin.py
217 218 219 220 221 222 223 224 | |
aspect(*, dem=None, **kwargs)
¶
Which way each slope faces, clockwise from north. Flat is NaN.
Source code in basinkit/basin.py
458 459 460 461 462 | |
attributes(prefixes=None, **kwargs)
¶
281 pre-computed BasinATLAS attributes for this basin.
The row returned belongs to the outlet's HydroBASINS unit, and its
_u columns are already aggregated over everything upstream -- so
this characterises the whole catchment without touching a raster.
Costs one 2.7 GB download the first time, then nothing.
Source code in basinkit/basin.py
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | |
available_water_capacity(depth='0-5cm')
¶
Plant-available water capacity (field capacity minus wilting point).
Source code in basinkit/basin.py
270 271 272 273 274 | |
check_license(key, *, commercial=False, redistribute=False)
staticmethod
¶
Raise if a dataset's licence forbids the intended use.
Source code in basinkit/basin.py
863 864 865 866 867 868 869 870 871 872 873 874 875 876 | |
concentration_time(*, morphometry=None, **kwargs)
¶
How long the basin takes to respond to rain, by several formulas.
t = basin.concentration_time()
t["estimates"]["kirpich_min"]
t["spread_factor"]
Time of concentration is not measured; every value is an empirical
formula fitted to a particular landscape, and on one basin they
routinely disagree by a factor of two. All of them are returned, with
what each was fitted to, so the choice stays with the person making
it. Pass morphometry= the dict you already have to avoid
recomputing it.
Source code in basinkit/basin.py
734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 | |
curvature(*, dem=None, **kwargs)
¶
Profile curvature: positive where the ground sheds, negative where it collects.
Source code in basinkit/basin.py
472 473 474 475 476 477 | |
curve_number(*, cn_table=None, **kwargs)
¶
The SCS curve number, composed from this basin's cover and soil.
cn = basin.curve_number()
cn["composite_cn"], cn["cn_amc_iii_wet"]
Nothing new is downloaded: the land cover and the soil texture are the
ones this package already fetches. Two judgements go into it -- the
hydrologic soil group from texture rather than a soil survey, and ESA
WorldCover classes matched to TR-55 cover types -- and both are
returned in assumptions and cover_mapping so the number can be
reproduced or disagreed with.
Source code in basinkit/basin.py
717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 | |
data_quality(**kwargs)
¶
A quality indicator for every layer, each against something independent.
The elevation grade split by terrain class; two independently produced land cover maps compared; SoilGrids' own 90 per cent interval; CHIRPS against TerraClimate; permanent against seasonal water; and the checks that exist for the boundary. Each entry carries the measurement, the threshold it was judged against, and what was compared with what.
Source code in basinkit/basin.py
563 564 565 566 567 568 569 570 571 572 573 574 | |
dem(product='cop30', **kwargs)
¶
Elevation, clipped and masked to the basin.
Source code in basinkit/basin.py
227 228 229 230 231 232 233 234 235 236 237 238 | |
dem_suitability(*, dem=None, support_map=False, **kwargs)
¶
Whether the elevation model supports terrain analysis in this basin.
Five measured tests -- depression filling, the slope noise floor,
relief against the model's vertical error, level water surfaces and
missing coverage -- combined into HIGH, MODERATE or
LIMITED. It grades the terrain products, not the basin boundary.
Source code in basinkit/basin.py
576 577 578 579 580 581 582 583 584 585 586 587 | |
download_all(outdir, layers=('dem', 'landcover', 'soil', 'surface_water', 'precipitation', 'rivers'), *, start=2000, end=None, progress=True)
¶
Fetch the default stack and write it to outdir.
This is the "give me everything" button. Each layer is attempted independently, so one failing source (a polar basin with no CHIRPS, say) does not abort the rest -- failures are recorded in the manifest alongside the successes.
Source code in basinkit/basin.py
893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 | |
drainage_density(*, dem=None, thresholds=None, chosen_km2=None, **kwargs)
¶
Drainage density across the range of defensible thresholds.
Not one number: the density moves by a large factor across channel initiation thresholds that are all defensible, so the curve and the threshold used are what make the figure comparable with anyone else's.
Source code in basinkit/basin.py
522 523 524 525 526 527 528 529 530 531 532 533 | |
explore(**kwargs)
¶
Interactive map of the basin. Needs pip install 'basinkit[viz]'.
Source code in basinkit/basin.py
1014 1015 1016 1017 1018 | |
export_3d(path, **kwargs)
¶
Write an interactive 3D page for this basin: terrain, imagery, rivers.
One self-contained HTML file with everything embedded, so it opens with
no network. See :func:basinkit.viz3d.export_3d for the options.
basin.export_3d("koshi.html")
basin.export_3d("koshi.html", texture=None) # elevation only, small
This is a way of looking at the layers this package fetches. It makes no claim the other methods do not already make.
Source code in basinkit/basin.py
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 | |
flow_accumulation(*, dem=None, **kwargs)
¶
Cells draining through each cell, routed over this basin's own DEM.
Source code in basinkit/basin.py
479 480 481 482 483 | |
from_file(path)
classmethod
¶
Load a basin from any vector file geopandas can read.
Source code in basinkit/basin.py
104 105 106 107 108 109 110 111 112 | |
from_geometry(geometry, provenance=None, crs=None)
classmethod
¶
Wrap a polygon you already have (a gauge basin, an official boundary).
crs is the CRS the geometry arrives in. Anything other than
EPSG:4326 is reprojected, because every step downstream of here works
in lon/lat. Leaving it out keeps the old behaviour and takes the
geometry as EPSG:4326 already, so existing callers are unaffected.
Source code in basinkit/basin.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
from_point(lat, lon, *, backend='auto', **kwargs)
classmethod
¶
Delineate the basin upstream of an outlet coordinate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
backend
|
str
|
|
'auto'
|
Source code in basinkit/basin.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
hand(*, dem=None, min_area_km2=1.0, **kwargs)
¶
Height above the nearest drainage: the terrain layer flood work wants.
Source code in basinkit/basin.py
491 492 493 494 495 496 | |
hillshade(*, dem=None, azimuth=315.0, altitude=45.0, z_factor=1.0, **kwargs)
¶
Shaded relief, 0 to 1, for a figure that reads as terrain.
Source code in basinkit/basin.py
464 465 466 467 468 469 470 | |
lakes(min_area_km2=0.0, **kwargs)
¶
HydroLAKES water bodies inside the basin.
Source code in basinkit/basin.py
393 394 395 396 397 398 | |
landcover(year=None, source='worldcover', **kwargs)
¶
Land cover, as a 2-D array with its class legend in .attrs.
worldcover is ESA WorldCover at 10 m (2020 or 2021); esri is the
ESRI / Impact Observatory annual series. Both return the same shape of
object, and each carries its own legend -- the two number their classes
differently, and code 10 is tree cover in one and cloud in the other.
year=None means 2021 for WorldCover and the latest year published
for this location for ESRI.
Source code in basinkit/basin.py
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | |
landcover_change(start, end, *, source='esri', **kwargs)
¶
What became what, between two years, in square kilometres.
Only the ESRI annual series carries a year for every year, so that is
the default here even though landcover() defaults to WorldCover.
The diagonal is the ground that did not change; everything off it is a
transition, and the table is the honest form of a deforestation or
urban-growth figure because it shows what the loss became.
Source code in basinkit/basin.py
628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 | |
landform(*, dem=None, window=11, **kwargs)
¶
Six slope-position classes: valley, slopes, flat, ridge.
Source code in basinkit/basin.py
516 517 518 519 520 | |
landsat(start, end, *, cloud_cover=20, bands=None, composite='median', **kwargs)
¶
Landsat Collection 2 Level-2 over the basin (1982 to present).
Source code in basinkit/basin.py
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | |
license_report(layers=None)
¶
Attribution and licence text for the layers you used.
Print this into your methods section. Every layer basinkit fetches by default is CC BY 4.0 or more permissive, which means it can be redistributed and used commercially -- but only if it is attributed.
Source code in basinkit/basin.py
837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 | |
morphometry(**kwargs)
¶
The classical Horton-Strahler-Schumm morphometric parameters.
m = basin.morphometry()
m["areal"]["drainage_density_km_per_km2"]
m["network"] # one row per Strahler order
Counts Strahler streams, not the reaches a river dataset splits them into, and measures area, perimeter and every length in one equal-area projection. Both matter: on the Koshi, counting reaches turns the bifurcation ratios into values that are not physically possible.
See :mod:basinkit.morphometry for what each parameter is and for what
the numbers can and cannot be compared against.
Source code in basinkit/basin.py
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 | |
plot(**kwargs)
¶
Static matplotlib figure: hypsometry, boundary and river network.
Source code in basinkit/basin.py
1020 1021 1022 1023 1024 | |
precipitation(start=2000, end=None, source='chirps', **kwargs)
¶
Basin-mean rainfall time series. chirps, persiann or terraclimate.
Every source returns the same kind of object: a named
xarray.DataArray of precipitation indexed by time. It did not used
to -- terraclimate handed back a whole Dataset, so code that
worked on one source raised an attribute error on another, and the
function's own name promised one quantity while returning thirteen.
For the rest of the TerraClimate variables call
:meth:water_balance, or sources.climate.terraclimate directly.
Source code in basinkit/basin.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | |
precipitation_trend(*, start=1985, end=None, alpha=0.05, **kwargs)
¶
Is rainfall over this basin trending, and by how much a year.
Source code in basinkit/basin.py
671 672 673 674 675 676 677 678 679 680 681 682 | |
report(path, *, title=None, dem=None, rivers=None, **kwargs)
¶
Write the eight-page PDF report for this basin.
Cover with the elevation data suitability grade, elevation and hypsometry, slope and aspect, the shape of the ground, the channel network and Horton's laws, the morphometric table with symbols and references, what the answer rests on, and a methods page.
max_pixels= sets the pixel budget for the elevation grid the
report is built from; the cover states the resolution it worked out
to. The default is :data:basinkit.report.REPORT_MAX_PIXELS and not
the package-wide one, because every page derives arrays of its own
from this grid.
Source code in basinkit/basin.py
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 | |
rivers(min_order=0, **kwargs)
¶
HydroRIVERS reaches inside the basin, with discharge and stream order.
Source code in basinkit/basin.py
386 387 388 389 390 391 | |
roughness(*, dem=None, **kwargs)
¶
Local relief within each cell's 3x3 neighbourhood.
Source code in basinkit/basin.py
510 511 512 513 514 | |
sentinel1(start, end, *, bands=None, composite='median', **kwargs)
¶
Sentinel-1 RTC: terrain-corrected radar, so it works through cloud.
Source code in basinkit/basin.py
432 433 434 435 436 437 438 439 440 441 442 443 444 | |
sentinel2(start, end, *, cloud_cover=20, bands=None, composite='median', **kwargs)
¶
Sentinel-2 L2A over the basin, cloud-filtered and optionally composited.
Source code in basinkit/basin.py
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 | |
slope(*, dem=None, degrees=True, **kwargs)
¶
Steepest descent at every cell, in degrees by default.
Source code in basinkit/basin.py
452 453 454 455 456 | |
soil(prop='clay', depth='0-5cm', **kwargs)
¶
A SoilGrids property. See :data:basinkit.sources.soil.PROPERTIES.
Source code in basinkit/basin.py
262 263 264 265 266 267 268 | |
spi(*, scale=3, start=1985, end=None, **kwargs)
¶
Standardized Precipitation Index over this basin, month by month.
Source code in basinkit/basin.py
684 685 686 687 688 689 690 691 | |
streams(*, dem=None, min_area_km2=1.0, **kwargs)
¶
The channel network routed from this basin's own elevation.
Source code in basinkit/basin.py
606 607 608 609 610 611 | |
subbasins(**kwargs)
¶
The sub-catchments this basin is assembled from, with their routing.
delineate dissolves the HydroBASINS units it walked into a single
polygon. This hands back the pieces instead, each with NEXT_DOWN,
which is the routing graph itself: every distributed model wants
sub-catchments and the links between them, and nothing here has to be
inferred from geometry afterwards.
Available for the hydrobasins backend, which is the default.
Source code in basinkit/basin.py
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 | |
summary(*, terrain=True, landcover=True)
¶
A one-call characterisation of the basin.
Source code in basinkit/basin.py
813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 | |
surface_water(layer='occurrence', **kwargs)
¶
JRC Global Surface Water: a pre-reduced 37-year Landsat water stack.
Source code in basinkit/basin.py
321 322 323 324 325 326 327 | |
terrain_stats(*, dem=None, **kwargs)
¶
Elevation, relief and mean slope: the standard morphometry.
Pass dem= the elevation you already hold. Fetching a second one
here is not only wasteful: if the first was coarsened to a pixel
budget and this one is not, the two disagree about the highest point
of the same basin, and a report that prints both looks wrong whichever
number the reader believes.
Source code in basinkit/basin.py
753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 | |
tpi(*, dem=None, window=11, **kwargs)
¶
Topographic position index: height above the surrounding ground.
Source code in basinkit/basin.py
498 499 500 501 502 | |
tri(*, dem=None, **kwargs)
¶
Terrain ruggedness index: how far a cell sits from its neighbours.
Source code in basinkit/basin.py
504 505 506 507 508 | |
twi(*, dem=None, **kwargs)
¶
Topographic wetness index: where water gathers and ground saturates.
Source code in basinkit/basin.py
485 486 487 488 489 | |
validation_envelope(*, suitability=None)
¶
Which part of the validation set this basin belongs to.
The accuracy figures published with basinkit are medians over 2,740 delineations at 2,550 gauges, and they differ by two orders of magnitude between the largest and the smallest band. This reports the error that was measured at this basin's size, and names the conditions the validation never covered, so that a figure which does not apply here is not quoted as though it did.
Reads only the area, so it downloads nothing. Pass a
:meth:dem_suitability result to compare the terrain descriptors too.
Source code in basinkit/basin.py
589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 | |
water_balance(start=2000, end=None)
¶
Monthly P / AET / PET / Q / soil-moisture balance from TerraClimate.
Source code in basinkit/basin.py
315 316 317 318 319 | |
zonal(values, zones=None, *, bins=None, labels=None, **kwargs)
¶
Summarise one layer inside the classes of another.
basin.zonal(basin.precipitation_grid, basin.landcover()) answers
how much rain falls on each land-cover class; passing bins cuts a
continuous layer such as elevation into bands instead. Area is summed
from the true size of every cell, so a basin spanning several degrees
of latitude is not weighted towards its southern edge.
Source code in basinkit/basin.py
613 614 615 616 617 618 619 620 621 622 623 624 625 626 | |
Upstream basin delineation backends.
Three backends, because no single one is right for every basin:
hydrobasins
Graph traversal over HydroBASINS level-12 sub-basins. Global, CC BY 4.0,
offline once cached, and fast at any basin size because upstream
aggregation is a walk over the NEXT_DOWN field rather than a raster
fill.
**Base grid: 15 arc-seconds, about 460 m, from February 2000 SRTM.**
HydroBASINS is extracted from the HydroSHEDS core layers at that
resolution, so this backend inherits it. Two consequences worth stating
plainly: the resolution floor is the level-12 unit (~130 km2 median), and
the flow network is a quarter-century-old DEM. For most basins that is
fine. For a small or heavily modified catchment it is not, and the other
two backends exist for exactly that case.
dem
D8 flow routing with pyflwdir over a freshly downloaded Copernicus DEM
window. Base grid: 1 arc-second, about 30 m, from 2011-2015 radar.
Fifteen times finer than the default and a decade newer, so it is the right
instrument for small catchments; its working range reaches about
10,000 km2, since cost grows with basin area and the window has to contain
the whole basin.
api
The public Global Watersheds service, backed by MERIT-Hydro.
Base grid: 3 arc-seconds, about 90 m, multi-error-removed. Five times
finer than the default and hydrologically conditioned rather than raw SRTM.
No download at all, so it is the fastest first look -- but it is one
research group's server and MERIT-Hydro's licence is non-commercial, so
basinkit never makes it the default and records both facts in provenance.
auto picks between them from the drainage area implied by the outlet.
Base resolution, side by side:
=============== ================= ================== ====================
backend grid source conditioned
=============== ================= ================== ====================
hydrobasins 15 arc-sec, 460 m SRTM, Feb 2000 HydroSHEDS
api 3 arc-sec, 90 m MERIT-Hydro yes, error-removed
dem 1 arc-sec, 30 m Copernicus, 2011-15 no, routed on the fly
=============== ================= ================== ====================
delineate(lat, lon, backend='auto', **kwargs)
¶
Delineate the upstream basin of (lat, lon).
Returns:
| Type | Description |
|---|---|
(geometry, dict)
|
The basin polygon in EPSG:4326 and a provenance dict recording which backend and dataset version produced it. The provenance travels with the basin so a result is always attributable. |
Source code in basinkit/delineate/__init__.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
delineate_api(lat, lon, *, precision='high', **_)
¶
Fetch an upstream basin polygon from the Global Watersheds service.
No local data is downloaded, which makes this the quickest way to look at a basin. The service auto-downgrades to low precision above ~50,000 km2.
This is a courtesy endpoint run by one research group, not managed
infrastructure. basinkit therefore never selects it automatically, and
stamps backend='api' into provenance so a downstream reader can tell
that the geometry did not come from a versioned dataset.
Source code in basinkit/delineate/api.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
delineate_dem(lat, lon, *, window_deg=0.5, product='cop30', snap_px=12, min_uparea_km2=1.0, max_window_deg=4.0, max_memory_gb=DEFAULT_MAX_MEMORY_GB, streams=None, burn_depth_m=20.0, progress=True, **_)
¶
Delineate the upstream basin by D8 routing on a Copernicus DEM window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window_deg
|
float
|
Half-width of the initial DEM window in degrees. Grown automatically if the basin reaches the edge. |
0.5
|
snap_px
|
int
|
Radius, in pixels, of the search for the true channel cell. |
12
|
streams
|
Lines to force the flow along, in EPSG:4326: a vector file path, a GeoDataFrame, or shapely geometries. Use it where the elevation model cannot see the channel -- a culverted urban stream, a canal across a divide, a valley the model dams with a road embankment. The flow path is then the one supplied rather than the one found, which is recorded in the provenance because it changes what the answer means. |
None
|
|
burn_depth_m
|
float
|
How far the burned cells are lowered. Deeper than the relief it has to beat, shallower than a trench the flow cannot leave. |
20.0
|
max_window_deg
|
float
|
Stop growing at this half-width and raise instead of silently downloading the continent. |
4.0
|
max_memory_gb
|
float
|
Refuse, with the figure named, rather than attempt a routing window whose estimated peak memory exceeds this. Above roughly 10,000 km2 the window needed is large enough for that estimate to matter; below it, this never comes up. |
DEFAULT_MAX_MEMORY_GB
|
Source code in basinkit/delineate/dem.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | |
delineate_hydrobasins(lat, lon, *, level=12, snap_km=5.0, river_snap_km=1.0, river_snap_ratio=10.0, progress=True, **_)
¶
Delineate the upstream basin from HydroBASINS level-12 units.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
int
|
Pfafstetter level of the source file. 12 is finest and the default. |
12
|
snap_km
|
float
|
If the outlet is not inside any unit at all, snap to the nearest one within this distance. Coastal outlets often sit just offshore. |
5.0
|
river_snap_km
|
float
|
Guard against the bank-of-a-big-river problem: if a unit within
|
1.0
|
river_snap_ratio
|
float
|
Guard against the bank-of-a-big-river problem: if a unit within
|
1.0
|
Source code in basinkit/delineate/hydrobasins.py
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | |
delineate_tdx(lat, lon, *, snap_km=2.0, progress=True, **_)
¶
Delineate the upstream basin from TDX-Hydro unit catchments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snap_km
|
float
|
How far the outlet may sit from the nearest mapped reach. The network is dense at 12 m, so the default is tighter than the HydroBASINS one: a point two kilometres from any reach is more likely to be off the river than to be a reach that is missing. |
2.0
|
Source code in basinkit/delineate/tdx.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | |
Whether the elevation model supports the terrain analysis asked of it.
Every terrain product in basinkit -- slope, aspect, curvature, the wetness
index, height above drainage, the hypsometric integral, every relief parameter
in :func:~basinkit.morphometry.morphometry -- is computed from one elevation
raster. Whether those numbers mean anything depends on whether the raster can
resolve the terrain in this particular basin, which is a different question in
a Himalayan gorge and on a coastal plain.
The accuracy tables published with basinkit answer the first half of that: across thousands of gauges, at this catchment size, this is the error to expect. That is a population figure. It cannot say whether this basin is one of the good cases. This module answers the second half by measuring the basin in front of it.
Five tests, each a measurement against a stated threshold:
filling
How much of the surface depression filling had to invent. A basin where a
fifth of the cells were raised is one where the drainage network is partly
the conditioning algorithm's own work.
slope
The noise floor of the model, arctan(vertical error / cell size), and
how many of the basin's slopes fall below it. Below that angle a slope
value is the model's error expressed as a gradient.
relief
Total relief against the model's vertical error. A 40 m basin measured
with a 4 m error carries a tenth of its own signal as uncertainty.
water
The largest level surface inside the basin. Standing water has no
gradient, so slope, aspect, curvature and the wetness index over it are
not measurements of anything.
coverage
Cells inside the basin with no elevation at all. Global models have
withheld tiles and voids, and a missing fifth of a basin biases every
statistic computed over it.
The grade is HIGH when every test passes, MODERATE when one is close
to its threshold, and LIMITED when one is past it. It is deliberately
about the terrain products and not about the basin boundary: the boundary
comes from the delineation backend, which is measured separately in the
verification page.
suitability(basin, *, dem=None, product=None, support_map=False)
¶
Grade how well the elevation model supports terrain analysis here.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
basin
|
A :class: |
required | |
dem
|
An already-fetched elevation raster, to avoid downloading it twice. |
None
|
|
product
|
str | None
|
The elevation product, used to pick the vertical error. Taken from the raster's own attributes when it is not given, and assumed to be the least accurate of the four when it cannot be determined. |
None
|
support_map
|
bool
|
Also return |
False
|
Returns:
| Type | Description |
|---|---|
dict
|
|
Source code in basinkit/suitability.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 | |
Whether this basin is one the accuracy figures were measured on.
Every accuracy number published with basinkit is a population figure. The blind validation drew 2,740 delineations at 2,550 gauges in 99 countries and reported the median area error per size band, and that table is the honest answer to "how accurate is it" -- for the population. It is not an answer about the basin in front of you.
The difference is not academic. The headline figures, the ones worth quoting, belong to large catchments: 0.3% above 100,000 km2, 1.3% from 10,000 to 100,000, 1.7% from 2,000 to 10,000. Below 500 km2 the same validation measured 30%, and below 100 km2 it measured 181%. A basin of 60 km2 is inside the validated population and nowhere near the quoted accuracy, and until this module existed nothing in the output said so. The user saw an area, a boundary and a verdict on the outlet, and had no way to know that at this size the measurement behind the software is four figures worse than the one on the front page.
So this module answers a narrower question than "is it accurate". It answers: of the basins that were measured, which ones does this one resemble, and what was the error there -- and, where this basin resembles nothing that was measured, it says that instead of quoting a number that does not apply.
Three kinds of answer come out of it:
inside
This basin sits where the validation measured a median area error at or
below :data:INSIDE_MEDIAN_PCT. The published figure applies to it.
edge
Measured, but where the error was several times the headline figure, or
with a descriptor out in the tail of what was validated. The number
applies, and it is not the number most people have in mind.
outside
Either the measured error here was above :data:EDGE_MEDIAN_PCT, or a
descriptor falls beyond anything in the validation set. No published
figure describes this case, and the envelope says so rather than
interpolating one.
It is deliberately about the basin boundary, which is what the validation
measured. :func:~basinkit.suitability.suitability grades the elevation
model's support for the terrain products, which is the other half and a
different question. The two share their measurements: the four terrain axes
below are the same four numbers suitability already computes, compared
against the range they covered in the validation rather than against a
threshold, so passing a suitability result in costs nothing.
"Envelope" here is the statistical sense -- the region of descriptor
space the measurements cover -- and not the geometric one. A basin's bounding
box is :attr:~basinkit.basin.Basin.bounds. The function is called
:func:validation_envelope so that the two cannot be confused at a call site.
Not everything is characterised. Aridity, flow regulation and karst are each
known to matter and none of them was recorded in the validation set, so this
module names them as uncharacterised instead of implying coverage it does not
have. :data:NOT_CHARACTERISED carries the list and how to measure each one.
validation_envelope(basin=None, *, area_km2=None, suitability=None)
¶
Say which part of the validation set this basin belongs to.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
basin
|
A :class: |
None
|
|
area_km2
|
float | None
|
The basin area, when there is no |
None
|
suitability
|
dict[str, Any] | None
|
A :func: |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
|
Examples:
>>> validation_envelope(area_km2=61.0)["position"]
'outside'
>>> validation_envelope(area_km2=61.0)["size"]["median_error_pct"]
181.0
Source code in basinkit/envelope.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | |
A quality indicator for every layer, not only for the elevation model.
:func:~basinkit.suitability.suitability grades the elevation raster, because
every terrain product is derived from it. The other layers arrive with no such
statement: a land cover map, a soil raster and a rainfall series all come back
looking equally authoritative, and nothing in the output says which of them can
carry the weight a study puts on it.
This module measures each layer against something independent of it and reports what it found:
elevation
The suitability grade, and the same measurement split by terrain class, so
that a basin which is part plain and part mountain is not reported as one
number. The classes are cut on local relief, which is the quantity the
model's vertical error competes with. Both the relief and the noise floor
are per-cell quantities, so the split is reported together with the cell
size it was measured at.
landcover
Two independently produced maps of the same year -- ESA WorldCover and the
ESRI annual series -- reduced to the classes they both define, and the
share of the basin where they agree. Where two mapping teams disagree, the
class under a given pixel is not settled.
soil
SoilGrids publishes a 5th and a 95th percentile beside its mean. The width
of that interval, in the units of the property, is the model's own
statement about how well it knows this ground.
precipitation
CHIRPS against TerraClimate over the same years: two products built from
different inputs. Their correlation and the difference between their means
bound how much of a rainfall figure is the choice of product.
surface_water
How much of the water in the basin is permanent, how much seasonal, and
how much of the basin the Landsat record never observed cleanly.
delineation
The boundary is not measured here -- it comes from the backend -- so this
reports the checks that do exist: the river-network consistency check and
the accuracy regime for a basin of this size.
Every threshold below is a choice, stated in the output, not a measurement. The measurements are the numbers beside them.
data_quality(basin, *, layers=('elevation', 'landcover', 'soil', 'precipitation', 'surface_water', 'delineation'), dem=None, year=2021, progress=True)
¶
A grade for every layer this basin can return, each against something independent.
Every entry carries the measurement, the threshold it was judged against and a sentence saying what was compared with what. A layer that could not be fetched is reported as an error rather than dropped, so the absence is visible.
Source code in basinkit/quality.py
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | |
delineation_quality(basin)
¶
What is actually known about the boundary: the checks that ran.
Source code in basinkit/quality.py
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 | |
elevation_quality(basin, dem=None, **kwargs)
¶
The suitability grade, plus the noise-floor test per terrain class.
Source code in basinkit/quality.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | |
landcover_quality(basin, year=2021, max_pixels=None, **kwargs)
¶
Agreement between ESA WorldCover and the ESRI annual map for one year.
Source code in basinkit/quality.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
precipitation_quality(basin, start=2000, end=None, **kwargs)
¶
CHIRPS against TerraClimate: two products, the same basin and years.
Source code in basinkit/quality.py
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | |
soil_quality(basin, prop='clay', depth='0-5cm', **kwargs)
¶
SoilGrids' own 90 per cent interval, as a share of its mean.
Source code in basinkit/quality.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
surface_water_quality(basin, **kwargs)
¶
Permanent against seasonal water, and how much was never observed.
Source code in basinkit/quality.py
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | |
An eight-page report a thesis or a manuscript can use directly.
Everything basinkit computes about a basin, laid out on A4 with the numbers carrying their symbols, units and original references, and with the suitability grade on the cover rather than in a footnote. The point is that a reader can see what the result rests on without being handed the code.
The pages, in order:
- Cover: where, how big, which backend, and the suitability grade
- Elevation, hillshade, the hypsometric curve and the elevation distribution
- Slope and aspect, with their distributions
- Curvature, position index, ruggedness and the slope-position classes
- The channel network and Horton's laws
- The morphometric parameters, with symbols and references
- The suitability scorecard, the support map and the drainage-density curve
- Methods: sources, licences, versions and what to cite
Pages 5 and 6 need the river network, which is a separate download. Without it they are replaced by a page saying so rather than quietly omitted.
estimated_peak_gb(n_pixels)
¶
What the report will need, in gigabytes, for a grid of this size.
Source code in basinkit/report.py
864 865 866 | |
report(basin, path, *, title=None, dem=None, rivers=None, morphometry=None, max_pixels=REPORT_MAX_PIXELS, progress=True)
¶
Write the eight-page report for basin to path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Where to write the PDF. |
required | |
title
|
str | None
|
Printed on the cover. Defaults to the basin's coordinates. |
None
|
dem
|
Already-computed layers, to avoid fetching or recomputing them. A grid passed in is used as it stands, budget included -- the caller chose it. |
None
|
|
rivers
|
Already-computed layers, to avoid fetching or recomputing them. A grid passed in is used as it stands, budget included -- the caller chose it. |
None
|
|
morphometry
|
Already-computed layers, to avoid fetching or recomputing them. A grid passed in is used as it stands, budget included -- the caller chose it. |
None
|
|
max_pixels
|
int | None
|
Pixel budget for the elevation grid this report is built from. The cover names the resolution that budget worked out to. |
REPORT_MAX_PIXELS
|
Returns:
| Type | Description |
|---|---|
str
|
The path written. |
Source code in basinkit/report.py
885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 | |
Clip and mask rasters to a basin polygon.
This is the part every generic downloader skips. eodag, earthaccess,
pystac-client and friends all take a bounding box and give you whole
scenes or tiles. For a river basin that is the wrong shape by a wide margin: a
long dendritic catchment can occupy under a third of its own bbox, so two
thirds of what you download, store and average over belongs to a neighbouring
basin. Everything here works on the polygon.
basin_area_km2(geometry, crs='EPSG:4326')
¶
Area of a lon/lat polygon in km2, via an equal-area projection.
Computing area in degrees is a common and badly wrong shortcut. This reprojects to a Lambert azimuthal equal-area centred on the basin itself, which is accurate to well under a percent at catchment scale.
Source code in basinkit/clip.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |
clip_raster(path_or_ds, geometry, *, crs='EPSG:4326', all_touched=False, nodata=None, drop_empty=True)
¶
Open a raster, clip it to geometry and mask everything outside.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path_or_ds
|
Any
|
File path, URL, or an already-open |
required |
geometry
|
Any
|
Basin polygon in |
required |
all_touched
|
bool
|
Include pixels merely touched by the boundary. Set |
False
|
drop_empty
|
bool
|
Raise a helpful error instead of returning an all-nodata array. |
True
|
Returns:
| Type | Description |
|---|---|
DataArray
|
Clipped to the polygon envelope and masked outside the polygon itself. |
Source code in basinkit/clip.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
clip_stack(da, geometry, *, crs='EPSG:4326', all_touched=False)
¶
Clip an already-loaded (possibly multi-temporal) DataArray to a polygon.
Source code in basinkit/clip.py
162 163 164 | |
laea_crs(lat, lon)
¶
A Lambert azimuthal equal-area CRS centred on a lon/lat point.
Two things this does that a bare proj4 string did not.
It refuses a centre that is not in degrees. A polygon in a projected CRS
has a centroid in metres, and passing a northing as lat_0 produces an
internal PROJ error that says nothing about the real mistake.
It builds the CRS from a dict. The proj4-string path needs a PROJ able to parse it, and inside QGIS that is not always the PROJ the rest of the stack was built against.
Source code in basinkit/clip.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
zonal_mean(da, geometry=None, *, dims=('y', 'x'))
¶
Area-weighted-ish spatial mean over a clipped array.
On a geographic grid, pixel area shrinks with cos(latitude). Ignoring
that biases a basin mean toward its poleward end. For a small basin the
error is negligible; for a Nile- or Ob-sized one it is not, so this
weights by cos(lat) whenever a latitude coordinate is present.
Source code in basinkit/clip.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
Tile mosaicking with a hard ceiling on how much comes into memory.
The naive version of this -- merge every tile at native resolution, then clip -- is fine for a 200 km2 catchment and fatal for a 50,000 km2 one. ESA WorldCover over the Koshi basin is nine tiles and a five-degree extent; at 10 m that is about 2.5 billion pixels, which no laptop will hold.
So the mosaic is budgeted. basinkit estimates the output size first and, if it
exceeds max_pixels, coarsens by an integer factor and records that in the
array's attributes. Nearest-neighbour resampling is used for categorical layers
so class codes are never averaged into meaningless intermediates.
merge_tiles(paths, bounds, *, max_pixels=DEFAULT_MAX_PIXELS, categorical=False, nodata_below=None, src_nodata=None)
¶
Merge tiles into one DataArray, coarsening if the result would be huge.
Returns:
| Type | Description |
|---|---|
(DataArray, dict)
|
The mosaic, and a dict describing whether and by how much it was
coarsened. The caller writes that into |
Source code in basinkit/mosaic.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
Machine-readable catalogue of the open datasets basinkit can fetch.
Every entry records not just where the data lives but the two facts that
decide whether a pipeline is reproducible: whether an account is needed, and
what the licence permits. basinkit.catalog.table() prints it; the CLI and
Basin.license_report() read from the same dict, so the documentation can
never drift from the code.
Verified live 2026-08-25.
Dataset
dataclass
¶
One fetchable open dataset.
Source code in basinkit/catalog.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
anonymous()
¶
Datasets needing no account of any kind.
Source code in basinkit/catalog.py
411 412 413 | |
implemented()
¶
Datasets basinkit can actually fetch today.
Source code in basinkit/catalog.py
391 392 393 | |
require(key)
¶
Return a dataset, raising with instructions if it cannot be fetched.
Source code in basinkit/catalog.py
401 402 403 404 405 406 407 408 | |
table(datasets=None)
¶
Render the catalogue as a plain-text table.
Source code in basinkit/catalog.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | |
unimplemented()
¶
Datasets basinkit documents but cannot fetch.
Source code in basinkit/catalog.py
396 397 398 | |