Skip to content

Instantly share code, notes, and snippets.

View xinyuanwylb19's full-sized avatar

xinyuan_19 xinyuanwylb19

  • Oak Ridge National Laboratory
  • Oak Ridge, TN, USA
View GitHub Profile
#Version 1.0
#Xinyuan Wei 03/23/2019
#Edge Identification from the Simulated TSLF Map
'''
This program can identify the edge from a simulated TSLF map.
The identification algorithm is Removal of Outer Lines (ROL).
'''
import gdal
import osr
import os
#AIL
#Version 1.0
#Xinyuan Wei 03/19/2019
#Edge Identification from the Simulated TSLF Map
'''
This program can identify the edge from a simulated TSLF map.
The identification algorithm is Agglomerating Partial Inner Lines (APIL).
'''
import gdal
import osr
@xinyuanwylb19
xinyuanwylb19 / MW
Last active June 4, 2019 00:09
Moving Windows
#Version 1.0
#Xinyuan Wei 04/22/2018
'''
This program can reconstruct the .
'''
import numpy as np
import gdal
import osr
#read the .csv data
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
FFMC BUI WSV WindDir FWIBin Season Ecoregion
55 70 16 290 1 Summer All
90 86 16 110 4 Summer All
88 91 11 70 3 Summer All
87 96 21 340 4 Summer All
86 67 13 320 3 Summer All
88 72 6 230 3 Summer All
88 72 6 230 3 Summer All
82 72 13 270 2 Summer All
82 108 6 180 2 Summer All
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Rows are invdividual fires. Years are grouped into six classes based on the total area burned by all firest in those years.
individual fires grouped by annual area burned
> 1000 km2 400-999 km2 100-399 km2 10-99 km2 1--9 km2 01.-0.9 km2
year size (ha) ln size (ha) year size (ha) ln size (ha) year size (ha) ln size (ha) year size (ha) ln size (ha) year size (ha) ln size (ha) year size (ha) ln size (ha)
80 0.9 -0.1 70 0.5 -0.7 84 400.0 6.0 69 1.2 0.2 72 0.1 -2.3 74 0.1 -2.3
80 0.7 -0.4 70 0.3 -1.2 84 0.5 -0.7 69 2.0 0.7 72 0.1 -2.3 74 0.6 -0.5
80 1.0 0.0 70 0.1 -2.3 84 25.0 3.2 69 0.1 -2.3 72 0.1 -2.3 74 7.4 2.0
80 0.1 -2.3 70 1.2 0.2 84 1.2 0.2 69 2802.1 7.9 72 0.1 -2.3 74 2.0 0.7
80 377.0 5.9 70 0.2 -1.6 84 0.4 -0.9 69 0.8 -0.2 72 0.8 -0.2 74 0.4 -0.9
80 0.1 -2.3 70 0.4 -0.9 84 2800.0 7.9 69 1.0 0.0 72 40.5 3.7 74 0.1 -2.3
@xinyuanwylb19
xinyuanwylb19 / Number of Required Sample Points
Last active June 28, 2018 20:33
Number of Required Sample Points
#Number of Sample Points
#Version 1.0
#Xinyuan Wei 01/01/2016
'''
This program can calculate the minimum number of sample points (mean and median)
required to reliably estimate the fire cycle.
'''
import sys
import os
@xinyuanwylb19
xinyuanwylb19 / Fire Map Stacking.txt
Last active June 28, 2018 20:21
Fire Map Stacking
#Fire Map Stacking
#Version 1.0
#Xinyuan Wei 12/20/2015
#Fire Cycle Study
'''
This program can stack simulated fire maps and create a TSLF map.
'''
import os.path
import glob
import gdal