-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRicardo.py
41 lines (26 loc) · 1020 Bytes
/
Ricardo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import geopandas
import os
from matplotlib import pyplot
import rasterio
import shapely
import numpy as np
shp = geopandas.read_file(r"C:\Users\RICLO\OneDrive - Ørsted\Desktop\Geopython\last\GeoHack23-WildfirePerimeter-main\data\HeatPoly_utm.shp")
#dissolved
dissolved = shapely.unary_union(shp.geometry)
print(type(dissolved))
#Concave hull
new_shp = shapely.concave_hull(dissolved,ratio=0.01,allow_holes=False)
new_gdp = geopandas.GeoDataFrame(geometry=[new_shp])
new_gdp.to_file(r"C:\Users\RICLO\OneDrive - Ørsted\Desktop\Geopython\last\GeoHack23-WildfirePerimeter-main\data\afterDissolve_shp2",crs=shp.crs)
new_gdp.plot()
dataset = rasterio.open(r"C:\Users\RICLO\OneDrive - Ørsted\Desktop\Geopython\last\GeoHack23-WildfirePerimeter-main\data\LWIR_QuickMosaic_16-bit_9327.tiff")
band1 = dataset.read(1)
print(np.max(band1))
pyplot.imshow(band1, cmap='Reds')
pyplot.show()
from scipy.signal import find_peaks
a = band1.flatten()
print(a)
b = find_peaks(a)
import matplotlib.pyplot as plt
plt.plot(a)