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
82e8bc17
Commit
82e8bc17
authored
1 year ago
by
Julia Signell
Browse files
Options
Downloads
Patches
Plain Diff
Keep better track of extpixels
parent
07ad9cee
Branches
fix-hulls
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fireatlas/FireMain.py
+11
-4
11 additions, 4 deletions
fireatlas/FireMain.py
fireatlas/FireObj.py
+2
-3
2 additions, 3 deletions
fireatlas/FireObj.py
with
13 additions
and
7 deletions
fireatlas/FireMain.py
+
11
−
4
View file @
82e8bc17
...
...
@@ -250,6 +250,7 @@ def Fire_expand_rtree(allfires, allpixels, tpixels, fids_ea):
newfire
=
Fire
(
id_newfire
,
allfires
.
t
,
allpixels
)
newfire
.
t_st
=
newfire
.
t
newfire
.
pixels
=
pixels
newfire
.
extpixels
=
pixels
newfire
.
hull
=
hull
newfire
.
updatefline
()
newfire
.
updateftype
()
# update the fire type
...
...
@@ -270,7 +271,6 @@ def Fire_expand_rtree(allfires, allpixels, tpixels, fids_ea):
# update current time, end time
f
.
t
=
allfires
.
t
f
.
t_ed
=
allfires
.
t
# extend pixels with newpixels
f
.
pixels
=
pd
.
concat
([
f
.
pixels
,
newpixels
])
...
...
@@ -281,6 +281,10 @@ def Fire_expand_rtree(allfires, allpixels, tpixels, fids_ea):
# update the fire type
f
.
updateftype
()
# update the end time after everything else
f
.
t_ed
=
allfires
.
t
# remove duplicates and sort the fid_expanded
fids_expanded
=
sorted
(
set
(
fids_expanded
))
...
...
@@ -416,14 +420,14 @@ def Fire_merge_rtree(allfires, fids_ne, fids_ea, fids_sleep):
f_source
=
allfires
.
fires
[
fid1
]
f_target
=
allfires
.
fires
[
fid2
]
# - target fire t
_ed set
to current time
# - target fire t to current time
f_target
.
t
=
allfires
.
t
f_target
.
t_ed
=
allfires
.
t
# just in case: set target to valid (is this needed?)
f_target
.
invalid
=
False
# - target fire add source pixels to pixels and newpixels
# - target fire add source pixels to pixels, extpixels
f_target
.
extpixels
=
f_source
.
extpixels
f_target
.
pixels
=
pd
.
concat
([
f_target
.
pixels
,
f_source
.
pixels
])
# - update the hull using previous hull and new pixels
...
...
@@ -436,6 +440,9 @@ def Fire_merge_rtree(allfires, fids_ne, fids_ea, fids_sleep):
# update target fire ftype
f_target
.
updateftype
()
# - target fire set end time to current time
f_target
.
t_ed
=
allfires
.
t
# record the heritages
allfires
.
heritages
.
append
((
fid1
,
fid2
))
...
...
This diff is collapsed.
Click to expand it.
fireatlas/FireObj.py
+
2
−
3
View file @
82e8bc17
...
...
@@ -611,12 +611,11 @@ class Fire:
@property
def
extpixels
(
self
):
"""
External pixels at the previous timestep + new pixels
"""
pdt
=
t2dt
(
t_nb
(
self
.
t
,
"
previous
"
))
"""
External pixels at the previous active timestep + new pixels
"""
return
self
.
allpixels
[
(
self
.
allpixels
[
"
fid
"
]
==
self
.
fireID
)
&
(
(
self
.
allpixels
[
"
ext_until
"
]
=
=
pdt
)
(
self
.
allpixels
[
"
ext_until
"
]
>
=
t2dt
(
self
.
t_ed
)
)
|
(
self
.
allpixels
[
"
t
"
]
==
t2dt
(
self
.
t
))
)
]
...
...
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