|
1 | 1 | # Migration of wms_cfg.py. As at commit c44c5e61c7fb9
|
2 |
| - |
| 2 | +import copy |
| 3 | +from functools import partial |
3 | 4 | # Reusable Chunks 1. Resource limit configurations
|
4 | 5 |
|
5 | 6 | reslim_landsat = {
|
|
4688 | 4689 | ]
|
4689 | 4690 | }
|
4690 | 4691 |
|
| 4692 | +############################################################################################## |
| 4693 | +# |
| 4694 | +# Rescale styles for tide layers |
| 4695 | +# |
| 4696 | +############################################################################################## |
| 4697 | + |
| 4698 | +ls_style_list = [ |
| 4699 | + style_ls_simple_rgb, |
| 4700 | + style_ls_irg, style_ls_ndvi, style_ls_ndwi, style_ls_mndwi, |
| 4701 | + style_sentinel_pure_blue, style_ls_pure_green, style_ls_pure_red, |
| 4702 | + style_ls_pure_nir, style_ls_pure_swir1, style_ls_pure_swir2, |
| 4703 | +] |
| 4704 | + |
| 4705 | +# HACK: Move this to a utils to allow style reusability |
| 4706 | +def swap_scale(new_scale : list, style : dict): |
| 4707 | + if "scale_range" in style: |
| 4708 | + new_style = copy.copy(style) |
| 4709 | + new_style["scale_range"] = new_scale |
| 4710 | + return new_style |
| 4711 | + return style |
| 4712 | + |
| 4713 | +swap_scale_p = partial(swap_scale, [0.0,0.3]) |
| 4714 | + |
| 4715 | +tide_style_list = list([swap_scale_p(s) for s in ls_style_list]) |
| 4716 | + |
4691 | 4717 | style_insar_velocity = {
|
4692 | 4718 | "name": "insar_velocity",
|
4693 | 4719 | "title": "InSAR Displacement Velocity",
|
|
6398 | 6424 | },
|
6399 | 6425 | "styling": {
|
6400 | 6426 | "default_style": "simple_rgb",
|
6401 |
| - "styles": [ |
6402 |
| - style_ls_simple_rgb, |
6403 |
| - style_ls_irg, style_ls_ndvi, style_ls_ndwi, style_ls_mndwi, |
6404 |
| - style_sentinel_pure_blue, style_ls_pure_green, style_ls_pure_red, |
6405 |
| - style_ls_pure_nir, style_ls_pure_swir1, style_ls_pure_swir2, |
6406 |
| - ] |
| 6427 | + "styles": tide_style_list |
6407 | 6428 | }
|
6408 | 6429 |
|
6409 | 6430 | },
|
|
6448 | 6469 | },
|
6449 | 6470 | "styling": {
|
6450 | 6471 | "default_style": "simple_rgb",
|
6451 |
| - "styles": [ |
6452 |
| - style_ls_simple_rgb, |
6453 |
| - style_ls_irg, style_ls_ndvi, style_ls_ndwi, style_ls_mndwi, |
6454 |
| - style_sentinel_pure_blue, style_ls_pure_green, style_ls_pure_red, |
6455 |
| - style_ls_pure_nir, style_ls_pure_swir1, style_ls_pure_swir2, |
6456 |
| - ] |
| 6472 | + "styles": tide_style_list |
6457 | 6473 | }
|
6458 | 6474 | },
|
6459 | 6475 | ]
|
|
0 commit comments