Skip to content

Commit b948235

Browse files
committed
pplots.qgmd
1 parent 745b8ec commit b948235

File tree

3 files changed

+419
-637
lines changed

3 files changed

+419
-637
lines changed

03-preprocessing/crop-mask-lup.ipynb

+61-12
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
{
3636
"cell_type": "code",
37-
"execution_count": 17,
37+
"execution_count": 2,
3838
"metadata": {},
3939
"outputs": [],
4040
"source": [
@@ -62,7 +62,7 @@
6262
},
6363
{
6464
"cell_type": "code",
65-
"execution_count": 18,
65+
"execution_count": 3,
6666
"metadata": {},
6767
"outputs": [],
6868
"source": [
@@ -80,7 +80,7 @@
8080
},
8181
{
8282
"cell_type": "code",
83-
"execution_count": 26,
83+
"execution_count": 4,
8484
"metadata": {},
8585
"outputs": [],
8686
"source": [
@@ -100,27 +100,27 @@
100100
},
101101
{
102102
"cell_type": "code",
103-
"execution_count": 27,
103+
"execution_count": 5,
104104
"metadata": {},
105105
"outputs": [
106106
{
107107
"data": {
108108
"text/plain": [
109-
"'/Users/romero61/../../capstone/pyforest/ml_data/raw_nelson/travel_time_to_ports_5.tif'"
109+
"['/Users/romero61/../../capstone/pyforest/ml_data/output/processed_rasters/land_type']"
110110
]
111111
},
112-
"execution_count": 27,
112+
"execution_count": 5,
113113
"metadata": {},
114114
"output_type": "execute_result"
115115
}
116116
],
117117
"source": [
118-
"PORTS_FILEPATH"
118+
"SIM_LUP_RASTER_PATH"
119119
]
120120
},
121121
{
122122
"cell_type": "code",
123-
"execution_count": 21,
123+
"execution_count": 6,
124124
"metadata": {},
125125
"outputs": [],
126126
"source": [
@@ -134,7 +134,7 @@
134134
},
135135
{
136136
"cell_type": "code",
137-
"execution_count": 22,
137+
"execution_count": 7,
138138
"metadata": {},
139139
"outputs": [],
140140
"source": [
@@ -174,7 +174,7 @@
174174
},
175175
{
176176
"cell_type": "code",
177-
"execution_count": 23,
177+
"execution_count": 8,
178178
"metadata": {},
179179
"outputs": [
180180
{
@@ -202,7 +202,7 @@
202202
},
203203
{
204204
"cell_type": "code",
205-
"execution_count": 24,
205+
"execution_count": 9,
206206
"metadata": {},
207207
"outputs": [
208208
{
@@ -212,7 +212,7 @@
212212
" 0.0, -0.00026949458523585647, -19.287457970745013), 'tiled': False, 'interleave': 'band'}"
213213
]
214214
},
215-
"execution_count": 24,
215+
"execution_count": 9,
216216
"metadata": {},
217217
"output_type": "execute_result"
218218
}
@@ -790,6 +790,55 @@
790790
"with rasterio.open(output_filepath, 'w', **profile) as dst:\n",
791791
" dst.write(lup_raster_array.astype('int16'), 1)"
792792
]
793+
},
794+
{
795+
"cell_type": "markdown",
796+
"metadata": {},
797+
"source": [
798+
"# Deforestation in undeveloped region for Spatial \n",
799+
"This file is the inverse of the deforestatio11_20_masked for Validation of our models predictions we use the masked rasters outputs of the chunks directly above for simulated land use plans."
800+
]
801+
},
802+
{
803+
"cell_type": "code",
804+
"execution_count": 10,
805+
"metadata": {},
806+
"outputs": [
807+
{
808+
"data": {
809+
"text/plain": [
810+
"['/Users/romero61/../../capstone/pyforest/ml_data/output/processed_rasters/land_type']"
811+
]
812+
},
813+
"execution_count": 10,
814+
"metadata": {},
815+
"output_type": "execute_result"
816+
}
817+
],
818+
"source": [
819+
"SIM_LUP_RASTER_PATH"
820+
]
821+
},
822+
{
823+
"cell_type": "code",
824+
"execution_count": 11,
825+
"metadata": {},
826+
"outputs": [
827+
{
828+
"name": "stdout",
829+
"output_type": "stream",
830+
"text": [
831+
"Source data shape:(22512, 20381) Property data shape:(22512, 20381) Mask data shape:, (22512, 20381) After masking: Source data masked shape:, (22512, 20381)\n"
832+
]
833+
}
834+
],
835+
"source": [
836+
"raster_to_use_as_mask = os.path.join(\"/Users/romero61/../../capstone/pyforest/ml_data/output/sim_lup_features/sim25/sim25_raster.tif\")\n",
837+
"\n",
838+
"# Process DEFORESTATION_1120_PATH\n",
839+
"deforestation_1120_output_raster = os.path.join(output_folder, 'deforestation11_20_masked_sim_lup25.tif')\n",
840+
"crop_and_mask_raster(DEFORESTATION_1120_PATH, raster_to_use_as_mask, deforestation_1120_output_raster, max_height, max_width) \n"
841+
]
793842
}
794843
],
795844
"metadata": {

0 commit comments

Comments
 (0)