|
34 | 34 | },
|
35 | 35 | {
|
36 | 36 | "cell_type": "code",
|
37 |
| - "execution_count": 17, |
| 37 | + "execution_count": 2, |
38 | 38 | "metadata": {},
|
39 | 39 | "outputs": [],
|
40 | 40 | "source": [
|
|
62 | 62 | },
|
63 | 63 | {
|
64 | 64 | "cell_type": "code",
|
65 |
| - "execution_count": 18, |
| 65 | + "execution_count": 3, |
66 | 66 | "metadata": {},
|
67 | 67 | "outputs": [],
|
68 | 68 | "source": [
|
|
80 | 80 | },
|
81 | 81 | {
|
82 | 82 | "cell_type": "code",
|
83 |
| - "execution_count": 26, |
| 83 | + "execution_count": 4, |
84 | 84 | "metadata": {},
|
85 | 85 | "outputs": [],
|
86 | 86 | "source": [
|
|
100 | 100 | },
|
101 | 101 | {
|
102 | 102 | "cell_type": "code",
|
103 |
| - "execution_count": 27, |
| 103 | + "execution_count": 5, |
104 | 104 | "metadata": {},
|
105 | 105 | "outputs": [
|
106 | 106 | {
|
107 | 107 | "data": {
|
108 | 108 | "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']" |
110 | 110 | ]
|
111 | 111 | },
|
112 |
| - "execution_count": 27, |
| 112 | + "execution_count": 5, |
113 | 113 | "metadata": {},
|
114 | 114 | "output_type": "execute_result"
|
115 | 115 | }
|
116 | 116 | ],
|
117 | 117 | "source": [
|
118 |
| - "PORTS_FILEPATH" |
| 118 | + "SIM_LUP_RASTER_PATH" |
119 | 119 | ]
|
120 | 120 | },
|
121 | 121 | {
|
122 | 122 | "cell_type": "code",
|
123 |
| - "execution_count": 21, |
| 123 | + "execution_count": 6, |
124 | 124 | "metadata": {},
|
125 | 125 | "outputs": [],
|
126 | 126 | "source": [
|
|
134 | 134 | },
|
135 | 135 | {
|
136 | 136 | "cell_type": "code",
|
137 |
| - "execution_count": 22, |
| 137 | + "execution_count": 7, |
138 | 138 | "metadata": {},
|
139 | 139 | "outputs": [],
|
140 | 140 | "source": [
|
|
174 | 174 | },
|
175 | 175 | {
|
176 | 176 | "cell_type": "code",
|
177 |
| - "execution_count": 23, |
| 177 | + "execution_count": 8, |
178 | 178 | "metadata": {},
|
179 | 179 | "outputs": [
|
180 | 180 | {
|
|
202 | 202 | },
|
203 | 203 | {
|
204 | 204 | "cell_type": "code",
|
205 |
| - "execution_count": 24, |
| 205 | + "execution_count": 9, |
206 | 206 | "metadata": {},
|
207 | 207 | "outputs": [
|
208 | 208 | {
|
|
212 | 212 | " 0.0, -0.00026949458523585647, -19.287457970745013), 'tiled': False, 'interleave': 'band'}"
|
213 | 213 | ]
|
214 | 214 | },
|
215 |
| - "execution_count": 24, |
| 215 | + "execution_count": 9, |
216 | 216 | "metadata": {},
|
217 | 217 | "output_type": "execute_result"
|
218 | 218 | }
|
|
790 | 790 | "with rasterio.open(output_filepath, 'w', **profile) as dst:\n",
|
791 | 791 | " dst.write(lup_raster_array.astype('int16'), 1)"
|
792 | 792 | ]
|
| 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 | + ] |
793 | 842 | }
|
794 | 843 | ],
|
795 | 844 | "metadata": {
|
|
0 commit comments