{"id":16505576,"url":"https://github.com/davidbrochart/flow_acc_3s","last_synced_at":"2025-10-28T01:30:24.199Z","repository":{"id":53256906,"uuid":"160412052","full_name":"davidbrochart/flow_acc_3s","owner":"davidbrochart","description":"Compute 3sec flow accumulation from HydroSHEDS","archived":false,"fork":false,"pushed_at":"2019-01-14T12:38:14.000Z","size":63,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-13T14:08:56.481Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidbrochart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-04T20:02:39.000Z","updated_at":"2024-03-13T16:42:17.000Z","dependencies_parsed_at":"2022-08-27T06:40:12.678Z","dependency_job_id":null,"html_url":"https://github.com/davidbrochart/flow_acc_3s","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidbrochart%2Fflow_acc_3s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidbrochart%2Fflow_acc_3s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidbrochart%2Fflow_acc_3s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidbrochart%2Fflow_acc_3s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidbrochart","download_url":"https://codeload.github.com/davidbrochart/flow_acc_3s/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219860298,"owners_count":16556019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T15:12:31.105Z","updated_at":"2025-10-28T01:30:18.909Z","avatar_url":"https://github.com/davidbrochart.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[HydroSHEDS](https://www.hydrosheds.org) provides flow directions at 3 seconds\nresolution, but flow accumulation is only available at 30s and 15s resolutions.\nThis is an attempt to fill that gap.\n\nThe computation takes place in two passes:\n- first, pixels are dropped on each tile individually, and we keep track of the\n  pixels that flow into neighbors. This pass can be parallelized and is the\nmost time consuming.\n- second, we take those overflowing pixels and make them flow again. Note that\n  this pass is not parallelized (except for the file compression), but it's\nquite fast anyway because pixels only flow from the boundaries of the tiles (the\ninside of the tiles doesn't have to be processed again).\n\nUsually, flow accumulation is just pixel-based: when one pixel flows into\nanother, we just increment the flow. This doesn't take into account the area of\na pixel, but if we want to use flow accumulation for hydrologic purposes, we\nmust correct for the fact that a pixel at the equator is bigger than a pixel at\ne.g. latitude 60N (since WGS84 is not an equal area projection). Here we do\nthis correction, and so the resulting flow accumulation data cannot be of\ninteger type (it is a `float64`).\n\nIf you want to run the Cython version (which is slightly faster), you first need\nto compile it:\n\n```\ncd cython\npython setup.py build_ext --inplace\n```\n\nFor the Numba version, pass the `-n` flag. You can set the number of CPU cores\nyou want to use in each pass with e.g. `-p1 4 -p2 4`. Since it takes a lot of\ntime to compute (days, depending on your CPUs), the current state is saved after\neach computation of a tile, so you can press Ctrl-C and resume later. But if you\nwant to start over, you can do so with the `-r` flag.\n\n```\npython flowAcc3s.py -n -r -p1 4 -p2 4\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidbrochart%2Fflow_acc_3s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidbrochart%2Fflow_acc_3s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidbrochart%2Fflow_acc_3s/lists"}