Sahand
commited on
Commit
·
c8c4008
1
Parent(s):
3628430
mask method change
Browse files- libs/dashapp.py +5 -12
libs/dashapp.py
CHANGED
@@ -11,6 +11,7 @@ import netCDF4
|
|
11 |
import numpy as np
|
12 |
import pandas as pd
|
13 |
import rasterio
|
|
|
14 |
from shapely.validation import make_valid
|
15 |
|
16 |
from libs.utils import verbose as vprint
|
@@ -519,9 +520,7 @@ def analyse(
|
|
519 |
|
520 |
try:
|
521 |
with rasterio.open(historic_raster) as src:
|
522 |
-
out_image, transformed =
|
523 |
-
src, shapes, crop=True, filled=True
|
524 |
-
)
|
525 |
out_profile = src.profile.copy()
|
526 |
out_profile.update(
|
527 |
{
|
@@ -537,9 +536,7 @@ def analyse(
|
|
537 |
|
538 |
try:
|
539 |
with rasterio.open(current_raster) as src:
|
540 |
-
out_image, transformed =
|
541 |
-
src, shapes, crop=True, filled=True
|
542 |
-
)
|
543 |
out_profile = src.profile.copy()
|
544 |
out_profile.update(
|
545 |
{
|
@@ -555,9 +552,7 @@ def analyse(
|
|
555 |
|
556 |
try:
|
557 |
with rasterio.open(delta_raster) as src:
|
558 |
-
out_image, transformed =
|
559 |
-
src, shapes, crop=True, filled=True
|
560 |
-
)
|
561 |
out_profile = src.profile.copy()
|
562 |
out_profile.update(
|
563 |
{
|
@@ -573,9 +568,7 @@ def analyse(
|
|
573 |
|
574 |
try:
|
575 |
with rasterio.open(quant_raster) as src:
|
576 |
-
out_image, transformed =
|
577 |
-
src, shapes, crop=True, filled=True
|
578 |
-
)
|
579 |
out_profile = src.profile.copy()
|
580 |
out_profile.update(
|
581 |
{
|
|
|
11 |
import numpy as np
|
12 |
import pandas as pd
|
13 |
import rasterio
|
14 |
+
from rasterio.mask import mask
|
15 |
from shapely.validation import make_valid
|
16 |
|
17 |
from libs.utils import verbose as vprint
|
|
|
520 |
|
521 |
try:
|
522 |
with rasterio.open(historic_raster) as src:
|
523 |
+
out_image, transformed = mask(src, shapes, crop=True, filled=True)
|
|
|
|
|
524 |
out_profile = src.profile.copy()
|
525 |
out_profile.update(
|
526 |
{
|
|
|
536 |
|
537 |
try:
|
538 |
with rasterio.open(current_raster) as src:
|
539 |
+
out_image, transformed = mask(src, shapes, crop=True, filled=True)
|
|
|
|
|
540 |
out_profile = src.profile.copy()
|
541 |
out_profile.update(
|
542 |
{
|
|
|
552 |
|
553 |
try:
|
554 |
with rasterio.open(delta_raster) as src:
|
555 |
+
out_image, transformed = mask(src, shapes, crop=True, filled=True)
|
|
|
|
|
556 |
out_profile = src.profile.copy()
|
557 |
out_profile.update(
|
558 |
{
|
|
|
568 |
|
569 |
try:
|
570 |
with rasterio.open(quant_raster) as src:
|
571 |
+
out_image, transformed = mask(src, shapes, crop=True, filled=True)
|
|
|
|
|
572 |
out_profile = src.profile.copy()
|
573 |
out_profile.update(
|
574 |
{
|