description | Prototype Python code to acquire and process satellite fire detection data, including MODIS and VIIRS. |
homepage URL | http://www.openwfm.org |
repository URL | https://github.com/openwfm/JPSSData.git |
owner | jan.mandel@gmail.com |
last change | Thu, 24 Sep 2020 23:35:29 +0000 (24 17:35 -0600) |
last refresh | Thu, 21 Nov 2024 08:20:37 +0000 (21 09:20 +0100) |
mirror URL | git://repo.or.cz/JPSSData.git |
https://repo.or.cz/JPSSData.git | |
ssh://git@repo.or.cz/JPSSData.git | |
bundle info | JPSSData.git downloadable bundles |
content tags |
1) Install Anaconda 3:
wget https://repo.continuum.io/archive/Anaconda3-2019.10-Linux-x86_64.sh
chmod +x Anaconda3-2019.10-Linux-x86_64.sh
./Anaconda3-2019.10-Linux-x86_64.sh
2) Create anaconda environment named jpssdata:
conda create -n jpssdata python=2.7 basemap netcdf4 scikit-learn scikit-image h5py pandas requests
3) Download other necessary packages:
conda install -c conda-forge pyhdf
pip install python-cmr
Run process.py as:
python process.py wrfout start_time days
OR
python process.py lon1,lon2,lat1,lat2 start_time days
Generates the fire mesh, downloads all the granules in between the dates and intersecting with the fire mesh, reads all the important information inside them and saves everything in a binary file called 'data'. It creates as well a KML file with all the fire detections called 'fire_detections.kml'. After that, it runs a postprocessing of the data creating an intermediate binary file called 'result'. Finally, it estimates the fire arrival time using SVM machine learning technique, creating an output file 'svm.mat' with the results.
The input variales from 'python process.py coord start_time days' are:
- coord: string:
1) link to the wrfout file of WRF-SFIRE simulation or
2) bounding box coordinates separated by commas
lon1,lon2,lat1,lat2
- start_time - string, YYYYMMDDHHMMSS where:
- YYYY - year
- MM - month
- DD - day
- HH - hour
- MM - minute
- SS - second
- days: number, number of days of simulation (can be decimal).
For different configurations of the SVM run, create file called 'conf.json' using similar structure than in 'conf_example.json' file. In order to find out what are the flags, look into 'utils.py' file.
For running SVM using different weights depending on the confidence levels, run inside JPSSdata repository:
git clone https://github.com/Fergui/libsvm_weights
and set 'dyn_pen' flag in 'conf.json' to true.
There is also an example.sh bash script which needs to be run in Kinspeak or change the wrfout path to some existent wrfout file.
Run case.py as:
$ python case.py wrfout start_time days
Generates the fire mesh, downloads all the granules in between the dates and intersecting with the fire mesh, reads all the important information inside them and saves everything in a binary file called 'data'. It creates as well a csv file and a KML file with all the detections called 'fire_detections.csv' and 'fire_detections.kml'. It is also created a KML file with the ground detections called 'nofire.kml'. The input variales are:
- wrfout: string, link to the wrfout file of WRF-SFIRE simulation.
- start_time - string, YYYYMMDDHHMMSS where:
- YYYY - year
- MM - month
- DD - day
- HH - hour
- MM - minute
- SS - second
- days: integer, number of days of simulation.
Run setup.py as:
$ python setup.py
Processes all the granules and creates the upper and lower bounds for the fire arrival time. It saves everything in a text file called 'result' and in a Matlab file called 'result.mat'.
The Matlab file result.mat can be used to run the Multigrid method which are going to define a fire arrival time curve in between the upper and lower bounds as a rigid plate deformed by forces. In order to do that, the next steps are necessary.
Link the Matlab file 'result.mat' into the private fire_interpolation repository in:
ssh://repo.openwfm.org/home/git/fire_interpolation
Run in Matlab the script jpss_mg.m as:
\>\> jpss_mg
Generates the fire arrival time in a 2D array called 'a' using the Multigrid technique and saves everything in a Matlab file called 'mgout.mat'. It shows in different figures the different levels and how they are changing all the time.
Link back the Matlab file 'mgout.mat' into the JPSSData repository and run contline.py as:
$ python contline.py
Generates a contour line representation of the results in a KML file called 'perimeters.kml'. It can be opened in Google Earth application as well with step 2) and it generates a movie of the interpolation with the fire detections.
https://github.com/openwfm/JPSSdata mirror: http://repo.or.cz/git-browser/by-commit.html?r=JPSSData.git
Lauren Hearn, Jan Mandel, Angel Farguell, James Haley
University of Colorado Denver
*A subproject in the OpenWFM project with support from NASA NNX13AH59G and NSF 1664175
3 years ago | angel | logtree |
3 years ago | jmdata | logtree |
4 years ago | data | logtree |
4 years ago | jm2 | logtree |
4 years ago | jm2tmp | logtree |
4 years ago | master | logtree |
4 years ago | bounds | logtree |
5 years ago | jm | logtree |
5 years ago | forecast | logtree |
5 years ago | article | logtree |
5 years ago | lauren | logtree |
5 years ago | cycling | logtree |
6 years ago | wget | logtree |