composite(): masking and merging of images (vsm-model 1.1.0)
Browse filesFiles changed (2)
- README.md+19-8
- config.json+17-1
20 unmodified lines212223242526273 unmodified lines31323334353615 unmodified lines525354555657585960616263643 unmodified lines6869707172737420 unmodified lines## Usage```bashpip install "git+https://github.com/huizhml/vsm-model@v1.0.0"``````python3 unmodified linesout = model.predict(s2, x, y, crs="EPSG:32632", variables=["RH25_Q1", "RH98_Q1"])out["rh"] # float32 (n_images, 2, h, w), metresout["land_cover"] # int8 (n_images, h, w)````predict()` normalises the images, adds the latitude / longitude channels and runs the image15 unmodified lines`Q0` is the 0.95 quantile. `Q1` is the 0.5 quantile. `Q2` is the 0.05 quantile.- `land_cover`: index of the most likely class in 0 unknown, 1 Tree cover, 2 Shrubland, 3 Grassland, 4 Cropland, 5 Built-up, 6 Bare / sparse vegetation, 7 Snow and ice, 8 Permanent water bodies, 9 Herbaceous wetland and mangroves, 10 Moss and lichen, 11 unused.Nothing is masked: clouds, water and nodata pixels get a prediction like any other pixel.For the global VSM maps, up to 20 images of the growing season were predicted per Sentinel-2tile. Per image, pixels with scene classification (SCL) 0, 1, 3, 8, 9, 10, 11 or predicted snowwere dropped; the map is the per-pixel median of the remaining images. Pixels that are water(SCL or predicted class) or built-up (predicted class) in most images are nodata. The mapsstore decimetres as int16, nodata 32767.## Weights3 unmodified lines| Weights | Code ||---|---|| this version | [vsm-model](https://github.com/huizhml/vsm-model) 1.0.0 (git tag `v1.0.0`) |## Citation20 unmodified lines212223242526273 unmodified lines31323334353637383915 unmodified lines5556575859606162636465666768697071727374753 unmodified lines7980818283848520 unmodified lines## Usage```bashpip install "git+https://github.com/huizhml/vsm-model@v1.1.0"``````python3 unmodified linesout = model.predict(s2, x, y, crs="EPSG:32632", variables=["RH25_Q1", "RH98_Q1"])out["rh"] # float32 (n_images, 2, h, w), metresout["land_cover"] # int8 (n_images, h, w)# one map from several images of the same area, masked and merged as the global VSM mapsrh = model.composite(out["rh"], out["land_cover"], scl) # float32 (2, h, w), NaN where masked````predict()` normalises the images, adds the latitude / longitude channels and runs the image15 unmodified lines`Q0` is the 0.95 quantile. `Q1` is the 0.5 quantile. `Q2` is the 0.05 quantile.- `land_cover`: index of the most likely class in 0 unknown, 1 Tree cover, 2 Shrubland, 3 Grassland, 4 Cropland, 5 Built-up, 6 Bare / sparse vegetation, 7 Snow and ice, 8 Permanent water bodies, 9 Herbaceous wetland and mangroves, 10 Moss and lichen, 11 unused.`predict()` returns a prediction for every pixel of every image, also under clouds and on water.## Masking and merging images`composite(rh, land_cover, scl)` turns the predictions of several images into one map, with thesteps used for the global VSM maps. `scl` is the Sentinel-2 scene classification of the sameimages, `(n_images, h, w)` at 10 m.- Per image, pixels with SCL 0, 1, 3, 8, 9, 10, 11 or predicted snow are dropped.- The map is the per-pixel median of the remaining images.- Pixels that are water (SCL or predicted class) or built-up (predicted class) in most imagesare masked (NaN).For the global maps, up to 20 images of the growing season were used per Sentinel-2 tile. Themaps store decimetres as int16, nodata 32767.## Weights3 unmodified lines| Weights | Code ||---|---|| this version | [vsm-model](https://github.com/huizhml/vsm-model) 1.1.0 (git tag `v1.1.0`) |## Citation
87 unmodified lines88899091929394959687 unmodified lines"unused"]},"provenance": {"wandb_run": "cg11fpjr","bias_correction_column": "me_gradual_slope_veg","code_version": "1.0.0"}}87 unmodified lines88899091929394959697989910010110210310410510610710810911011111287 unmodified lines"unused"]},"masking": {"scl_nodata": 0,"scl_exclude": [0,1,3,8,9,10,11],"scl_water": 6,"snow_class": 7,"water_class": 8,"built_up_class": 5},"provenance": {"wandb_run": "cg11fpjr","bias_correction_column": "me_gradual_slope_veg","code_version": "1.1.0"}}
README.md+19-8
config.json+17-1