Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fireatlas_nrt
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gcorradini
fireatlas_nrt
Commits
8245367e
Commit
8245367e
authored
2 years ago
by
screbec
Browse files
Options
Downloads
Patches
Plain Diff
changes for spread rate computation and metric distances/areas
parent
e40069c1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
FireMain.py
+9
-2
9 additions, 2 deletions
FireMain.py
with
9 additions
and
2 deletions
FireMain.py
+
9
−
2
View file @
8245367e
...
@@ -257,7 +257,6 @@ def Fire_merge_rtree(allfires,fids_ne,fids_ea,fids_sleep):
...
@@ -257,7 +257,6 @@ def Fire_merge_rtree(allfires,fids_ne,fids_ea,fids_sleep):
allfires : Allfires obj
allfires : Allfires obj
Allfires obj after fire merging
Allfires obj after fire merging
'''
'''
import
FireClustering
,
FireVector
import
FireClustering
,
FireVector
from
FireConsts
import
CONNECTIVITY_THRESHOLD_KM
,
sleeperthresh
from
FireConsts
import
CONNECTIVITY_THRESHOLD_KM
,
sleeperthresh
...
@@ -368,7 +367,10 @@ def Fire_merge_rtree(allfires,fids_ne,fids_ea,fids_sleep):
...
@@ -368,7 +367,10 @@ def Fire_merge_rtree(allfires,fids_ne,fids_ea,fids_sleep):
# - use the updated hull to update exterior pixels
# - use the updated hull to update exterior pixels
f_target
.
extpixels
=
FireVector
.
cal_extpixels
(
f_target
.
extpixels
+
f_source
.
pixels
,
f_target
.
hull
)
f_target
.
extpixels
=
FireVector
.
cal_extpixels
(
f_target
.
extpixels
+
f_source
.
pixels
,
f_target
.
hull
)
# merge the two prior hulls for spread rate calculation
f_target
.
add_prior_hull
(
f_source
.
prior_hull
)
# invalidate and deactivate source object
# invalidate and deactivate source object
f_source
.
invalid
=
True
f_source
.
invalid
=
True
f_source
.
mergeid
=
f_target
.
mergeid
f_source
.
mergeid
=
f_target
.
mergeid
...
@@ -376,6 +378,7 @@ def Fire_merge_rtree(allfires,fids_ne,fids_ea,fids_sleep):
...
@@ -376,6 +378,7 @@ def Fire_merge_rtree(allfires,fids_ne,fids_ea,fids_sleep):
# record the heritages
# record the heritages
allfires
.
heritages
.
append
((
fid1
,
fid2
))
allfires
.
heritages
.
append
((
fid1
,
fid2
))
allfires
.
mergedates
.
append
((
fid1
,
allfires
.
t
))
# remove duplicates and record fid change for merged and invalidated
# remove duplicates and record fid change for merged and invalidated
fids_invalid
,
fids_merged
=
zip
(
*
fids_merge
)
fids_invalid
,
fids_merged
=
zip
(
*
fids_merge
)
...
@@ -400,6 +403,7 @@ def Fire_clean_save(allfires, t):
...
@@ -400,6 +403,7 @@ def Fire_clean_save(allfires, t):
# copy the heritage from the original allfires object
# copy the heritage from the original allfires object
allfires_out
.
heritages
=
allfires
.
heritages
allfires_out
.
heritages
=
allfires
.
heritages
allfires_out
.
mergedates
=
allfires
.
mergedates
allfires_out
.
id_dict
=
id_dict
allfires_out
.
id_dict
=
id_dict
# - save updated allfires object to pickle file
# - save updated allfires object to pickle file
...
@@ -491,6 +495,9 @@ def Fire_Forward(tst,ted,restart=False,sat='SNPP'):
...
@@ -491,6 +495,9 @@ def Fire_Forward(tst,ted,restart=False,sat='SNPP'):
# record average spread rate of all fires
# record average spread rate of all fires
allfires
.
record_spreadrates
()
allfires
.
record_spreadrates
()
# recompute the area and perimeter length
allfires
.
compute_geom_stats
()
# 7. manualy invalidate fires that only burn one pixel at a single time step (likely false detections)
# 7. manualy invalidate fires that only burn one pixel at a single time step (likely false detections)
allfires
.
invalidate_statfires
()
allfires
.
invalidate_statfires
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment