Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit 54faace

Browse files
author
Emma Ai
committed
update readme
1 parent 821af6c commit 54faace

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

README.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ Requirements:
3131
-----------
3232
OpenMPI >= 4.0.1.
3333

34-
datacube_stats on the refactor branch: https://github.com/opendatacube/datacube-stats/tree/refactor
34+
datacube_stats https://github.com/opendatacube/datacube-stats/
3535

36-
A database with postgis enabled.
36+
dea_tools to retrieve the waterbody polygons
37+
38+
A database with postgis enabled
3739

3840
Other auxilliary data/scripts/shapefiles...
3941

@@ -57,7 +59,7 @@ How To:
5759

5860
One'll need four steps.
5961

60-
- Collect all the polygons interact with/contained by the landsat path/row and ouput the results as `txt` in `$out`.
62+
- Collect all the polygons intersect with/contained by the landsat path/row and ouput the results as `txt` in `$out`.
6163
Two reasons: 1. Aggregate by time if the polygon(s) would cover more than one path/row; 2. See `Secondly` in Section `Why`
6264

6365
`mpirun python -m mpi4py.futures wetland_brutal.py wit-pathrow --output-location $out $shapefile`
@@ -70,7 +72,15 @@ mpirun python -m mpi4py.futures wetland_brutal.py wit-pathrow --output-location
7072

7173
with `$out = /g/data1a/u46/users/ea6141/wlinsight/sadew/new`,
7274

73-
and `$shapefile=/g/data1a/u46/users/ea6141/wlinsight/shapefiles/waterfowlandwetlands_3577.shp`
75+
and `$shapefile=/g/data1a/u46/users/ea6141/wlinsight/shapefiles/waterfowlandwetlands_3577.shp`.
76+
77+
Or specially for the polygons from DEA waterbodies
78+
79+
`mpirun python -m mpi4py.futures wetland_brutal.py wit-pathrow --geo-hash $hashlist --output-location $out`
80+
81+
where `$hashlist` is a file of geohash list of the waterbody polygons.
82+
83+
Note: in this case, `$shapefile` has to be left as `default = None`.
7484

7585
The results in your output folder would look like:
7686
```
@@ -130,7 +140,12 @@ Here `$in` is `$out` from the last step
130140

131141
Example:
132142

133-
`mpirun python -m mpi4py.futures wetland_brutal.py wit-query --input-folder /g/data1a/u46/users/ea6141/wlinsight/sadew/new --output-location /g/data1a/u46/users/ea6141/wlinsight/sadew/query --union True --product-yaml /g/data1a/u46/users/ea6141/wlinsight/fc_pd.yaml /g/data1a/u46/users/ea6141/wlinsight/shapefiles/waterfowlandwetlands_3577.shp`
143+
`mpirun python -m mpi4py.futures wetland_brutal.py wit-query --input-folder /g/data1a/u46/users/ea6141/wlinsight/sadew/new --output-location /g/data1a/u46/users/ea6141/wlinsight/sadew/query --union True --product-yaml /g/data1a/u46/users/ea6141/wlinsight/fc_pd.yaml /g/data1a/u46/users/ea6141/wlinsight/shapefiles/waterfowlandwetlands_3577.shp`.
144+
145+
Or for the polygons from DEA waterbodies
146+
147+
`mpirun python -m mpi4py.futures wetland_brutal.py wit-query --geo-hash $hashlist --input-folder $in --output-location $out --union True --product-yaml $pd_yaml`
148+
134149

135150
The result would look like
136151
```
@@ -162,6 +177,10 @@ Example
162177
Or deal with the large polygons not contained by a single path/row, set `--aggregate 15` typically, i.e.,
163178
`mpirun python -m mpi4py.futures wetland_brutal.py wit-cal --feature-list /g/data1a/u46/users/ea6141/wlinsight/anae/intersect_16_17_18_739_740_741.txt --datasets /g/data1a/u46/users/ea6141/wlinsight/anane/query/16_17_18_739_740_741.pkl --aggregate 15 --product-yaml /g/data1a/u46/users/ea6141/wlinsight/fc_pd.yaml /g/data1a/u46/users/ea6141/wlinsight/shapefiles/waterfowlandwetlands_3577.shp`
164179

180+
For the polygons in DEA waterbodies, do
181+
182+
`mpirun python -m mpi4py.futures wetland_brutal.py wit-cal --geo-hash $hashlist --feature-list $feature --datasets $datasets --aggregate $aggregate --product-yaml $pd_yaml`
183+
165184
- Plot the data
166185

167186
`python wetland_brutal.py wit-plot --output-location $folder --feature $id -n $property_1 -n $property_2 $shapefile`
@@ -177,6 +196,12 @@ Example:
177196
`python wetland_brutal.py wit-plot --output-location sadew/results -n Site_Name shapefiles/waterfowlandwetlands_3577.shp`
178197
, where `Site_Name` is an entry under `properties` for each polygon in the shapefile.
179198

199+
For the polygons in DEA waterbodies, do
200+
201+
`python wetland_brutal.py wit-plot --geo-hash $hashlist --output-location $folder --feature $id -n hash`,
202+
203+
where `-n hash` is to specify the output file named by the geohash of the waterbody polygon.
204+
180205
The results look like:
181206
```
182207
[ea6141@vdi-n24 wlinsight]$ ls sadew/results/

examples/wit/wetland_brutal.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@
3535
from wit_tooling import poly_wkt, convert_shape_to_polygon, query_wit_data, plot_to_png, query_wit_metrics, load_timeslice, generate_raster
3636
from dea_tools import waterbodies
3737

38-
try:
39-
# this need to be fixed
40-
sys.path.append(os.environ['HOME'] + "/datafile/dea-notebooks/Scripts/")
41-
import dea_waterbodies
42-
except:
43-
print("tmp solution fix the water body lib properly please")
44-
4538
_LOG = logging.getLogger('wit_tool')
4639
stdout_hdlr = logging.StreamHandler(sys.stdout)
4740
formatter = logging.Formatter('[%(asctime)s.%(msecs)03d - %(levelname)s] %(message)s')

0 commit comments

Comments
 (0)