Develop a tool that focuses on forest fires as a measure of early prevention of fire expansion, with extensive monitoring through the study of large amounts of data linked to neural networks. The project is responsible for analyzing satellite and geographic data and crossing it with trends data in the network, using a learning algorithm that can visualize in real time the areas most prone to fire (and other types of disasters such as landslides, floods), which Depending on the range or the fire radius suggests the nearest places where there is fire water supply and fire control measures.
Analyze the scenarios to gather information for the integration of data with social networks (Facebook, Twitter, Instagram, etc.) and have an impact of the events.
rom mpl_toolkits.basemap import Basemap as Bm | |
import matplotlib.pyplot as plt | |
from pyhdf import SD as hdf | |
class Grafica: | |
def __init__(self,lon1,lon2, lat1, lat2): | |
if lon2 > lon1: | |
self.lon1 = lon1 | |
self.lon2 = lon2 | |
else: | |
self.lon1 = lon2 | |
self.lon2 = lon1 | |
if lat2 > lat1: | |
self.lat1 = lat1 | |
self.lat2 = lat2 | |
else: | |
self.lat1 = lat2 | |
self.lat2 = lat1 | |
def plotM(self): | |
#m = Bm(llcrnrlon=lon[i][0], llcrnrlat=lat[i][-1], urcrnrlon=lon[i][-1], urcrnrlat=lat[i][0], projection='mill') | |
m = Bm(llcrnrlon=self.lon1, llcrnrlat=self.lat1, urcrnrlon=self.lon2, urcrnrlat=self.lat2, projection='mill') | |
m.shadedrelief() | |
plt.savefig('mapa.png',dpi=500) | |
def plot(self,datos): | |
#m = Bm(llcrnrlon=lon[i][0], llcrnrlat=lat[i][-1], urcrnrlon=lon[i][-1], urcrnrlat=lat[i][0], projection='mill') | |
m = Bm(llcrnrlon=self.lon1, llcrnrlat=self.lat1, urcrnrlon=self.lon2, urcrnrlat=self.lat2, projection='mill') | |
m.shadedrelief() | |
m.imshow(datos[:]) | |
m.colorbar() | |
#plt.show() | |
plt.savefig('mapaT.png',dpi=500) | |
if __name__ == '__main__': | |
# fileSD = hdf.SD('/home/dextron/PycharmProjects/incendioHack/datos/MOD11_L2.A2017119.0045.006.NRT.hdf') | |
fileSD = hdf.SD('datos/MOD11_L2.A2017096.1445.006.2017097093512.hdf') | |
lat = fileSD.select('Latitude') | |
lon = fileSD.select('Longitude') | |
emision = fileSD.select('Emis_31') | |
#emision2 = fileSD.select('Emis_32') | |
lsData = fileSD.select('LST') | |
print lsData.attributes() | |
print lsData.getdatastrs() | |
print emision.attributes() | |
print emision.getdatastrs() | |
print emision.info() | |
latM = min(map(lambda x : min(x), lat[:])) | |
latX = max(map(lambda x : max(x), lat[:])) | |
lonM = min(map(lambda x: min(x), lon[:])) | |
lonX = max(map(lambda x: max(x), lon[:])) | |
#Test grafica | |
test = Grafica(lonM, lonX, latM, latX) | |
test.plotM() # mapa coordenadas | |
test.plot(lsData) # mapa de temperaturas escalado | |
#test.plot(emision2) |
var googleTrends = require('google-trends-api'), | |
express = require('express'), | |
app = express(); | |
app.get('/', function (req, res) { | |
res.send('<h1>FireFighter API</h1>'); | |
}); | |
app.get('/getGoogleTrend', function (req, res) { | |
var keyword = req.query.keyword; | |
googleTrends.interestOverTime({keyword: keyword}) | |
.then(function(results){ | |
console.log('These results are awesome', results); | |
res.send(results); | |
}) | |
.catch(function(err){ | |
console.error('Oh no there was an error', err); | |
res.send(err); | |
}); | |
}); | |
app.get('/getDataByRegion', function (req, res) { | |
var keyword = req.query.keyword; | |
var startTime = req.query.startTime; | |
var endTime = req.query.endTime; | |
var geo = req.query.geo; | |
var gprop = req.query.gprop; | |
googleTrends.interestByRegion({keyword: keyword, startTime: new Date(startTime), endTime: new Date(endTime), geo: geo, gprop: gprop}) | |
.then(function(results) { | |
console.log('These results are awesome', results); | |
var obj = JSON.parse(res); | |
var mapResponse=obj.default.geoMapData; | |
for(var i=0; i<mapResponse.length; i++) { | |
googleTrends.interestByRegion({keyword: keyword, geo:mapResponse[i].geoCode}) | |
.then(function(results2) { | |
console.log('These results2 are awesome', results2); | |
res.send(results2); | |
}) | |
.catch(function(err) { | |
console.error('Oh no there was an error', err); | |
res.send(err); | |
}); | |
} | |
res.send(results); | |
}) | |
.catch(function(err) { | |
console.error('Oh no there was an error', err); | |
res.send(err); | |
}); | |
// getInterest('fire','2016-01-04','2017-04-28','BO','news'); | |
}); | |
app.listen(3000, function(){ | |
console.log('Listening on 3000'); | |
}); |
SpaceApps is a NASA incubator innovation program.