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
3fe8d469
Commit
3fe8d469
authored
1 year ago
by
GSFC Landslides
Browse files
Options
Downloads
Patches
Plain Diff
add tests
parent
0ca23903
Branches
profiling
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FireMain.py
+7
-5
7 additions, 5 deletions
FireMain.py
FireRun.py
+71
-0
71 additions, 0 deletions
FireRun.py
with
78 additions
and
5 deletions
FireMain.py
+
7
−
5
View file @
3fe8d469
...
...
@@ -692,8 +692,8 @@ if __name__ == "__main__":
# ted=(2021,9,15,'PM')
# region = ('Dixie',[-121.6,39.8,-120.5,40.6])
tst
=
(
202
0
,
9
,
25
,
'
P
M
'
)
ted
=
(
202
0
,
12
,
31
,
"
PM
"
)
tst
=
(
202
3
,
10
,
1
,
'
A
M
'
)
ted
=
(
202
3
,
12
,
31
,
'
PM
'
)
#print(tst)
#region = ("Creek", [-119.5, 36.8, -118.9, 37.7])
#region = ('CA',[-124.409591, 32.534155999999996, -114.131211, 42.009518])
...
...
@@ -703,21 +703,23 @@ if __name__ == "__main__":
#region = ('Frye',[-110.02849137185659,32.568462386228475,-109.69752823709096,32.84117803581184])
#region = ('Fish',[-117.98761271684656,34.14492745779149,-117.9021253511239,34.21536501245526])
#region = ('GrizzlyCreek',[-107.32359115976944,39.51527120096794,-107.04481308359756,39.698839413262284])
region
=
(
'
WesternUS_REDO
'
,[
-
125.698046875
,
31.676476158707615
,
-
101.00078125
,
49.51429477264348
])
#
region = ('WesternUS_REDO',[-125.698046875,31.676476158707615,-101.00078125,49.51429477264348])
#region = ('HermitsPeakREDO',[-105.62745646198083,35.373429737675505,-105.18251017291833,36.26028722617026])
# region = ('CONUS',[-126.401171875,-61.36210937500001,24.071240929282325,49.40003415463647])
#region = ('Caldor',[-120.69305873258455,38.52600288552201,-119.90341639860017,38.916006495378696])
region
=
(
'
Virginia
'
,[
-
83.99054790525538
,
36.359799031139175
,
-
75.70685649900538
,
39.2156393030213
])
# Run the time forward and record daily fire objects .pkl data and fire attributes .GeoJSON data
print
(
"
----------------------------------------
"
)
print
(
"
Running Fire_Forward
"
)
print
(
"
----------------------------------------
"
)
#
Fire_Forward(tst=tst, ted=ted, restart=True, region=region)
Fire_Forward
(
tst
=
tst
,
ted
=
ted
,
restart
=
True
,
region
=
region
)
# calculate and save snapshot files
print
(
"
----------------------------------------
"
)
print
(
"
Running save_gdf_trng
"
)
print
(
"
----------------------------------------
"
)
#
FireGpkg.save_gdf_trng(tst=tst, ted=ted, regnm=region[0])
FireGpkg
.
save_gdf_trng
(
tst
=
tst
,
ted
=
ted
,
regnm
=
region
[
0
])
# calculate and save single fire files
print
(
"
----------------------------------------
"
)
...
...
This diff is collapsed.
Click to expand it.
FireRun.py
+
71
−
0
View file @
3fe8d469
...
...
@@ -651,6 +651,77 @@ def WesternUSYrRun(year):
FireGpkg
.
save_gdf_trng
(
tst
=
tst
,
ted
=
ted
,
regnm
=
region
[
0
])
FireGpkg_sfs
.
save_sfts_trng
(
tst
,
ted
,
regnm
=
region
[
0
])
####### TESTS #######
# Archive Test(s)
def
CreekRegionTest
():
import
FireMain
,
FireGpkg
,
FireGpkg_sfs
,
FireConsts
from
datetime
import
datetime
if
FireConsts
.
firesrc
!=
'
SNPP
'
:
print
(
'
Please set firesrc to SNPP
'
)
return
elif
FireConsts
.
firenrt
!=
False
:
print
(
'
Please set firenrt to False
'
)
return
tst
=
(
2020
,
9
,
5
,
"
AM
"
)
ted
=
(
2020
,
9
,
12
,
"
PM
"
)
region
=
(
"
CreekRegionTest-{date:%Y-%m-%d_%H:%M:%S}
"
.
format
(
date
=
datetime
.
now
()),
[
-
120
,
36
,
-
118
,
38
])
print
(
f
'
Starting run for
{
region
[
0
]
}
'
)
tstart
=
time
.
time
()
# do fire tracking
FireMain
.
Fire_Forward
(
tst
=
tst
,
ted
=
ted
,
restart
=
True
,
region
=
region
)
# calculate and save snapshot files
FireGpkg
.
save_gdf_trng
(
tst
=
tst
,
ted
=
ted
,
regnm
=
region
[
0
])
# calculate and save single fire files
FireGpkg_sfs
.
save_sfts_trng
(
tst
,
ted
,
regnm
=
region
[
0
])
tend
=
time
.
time
()
print
(
f
"
{
(
tend
-
tstart
)
/
60.
}
minutes used for
{
region
[
0
]
}
"
)
# NRT Test(s)
def
CONUS_NRT_Test
():
import
FireMain
,
FireGpkg
,
FireGpkg_sfs
,
FireConsts
from
datetime
import
datetime
if
FireConsts
.
firesrc
!=
'
VIIRS
'
:
print
(
'
Please set firesrc to VIIRS
'
)
return
elif
FireConsts
.
firenrt
!=
True
:
print
(
'
Please set firenrt to True
'
)
return
tst
=
(
2023
,
9
,
1
,
"
AM
"
)
ted
=
(
2023
,
9
,
2
,
"
PM
"
)
region
=
(
"
CONUS_NRT_Test-{date:%Y-%m-%d_%H:%M:%S}
"
.
format
(
date
=
datetime
.
now
()),
[
-
126.401171875
,
24.071240929282325
,
-
61.36210937500001
,
49.40003415463647
])
print
(
f
'
Starting run for
{
region
[
0
]
}
'
)
tstart
=
time
.
time
()
# do fire tracking
FireMain
.
Fire_Forward
(
tst
=
tst
,
ted
=
ted
,
restart
=
True
,
region
=
region
)
# calculate and save snapshot files
FireGpkg
.
save_gdf_trng
(
tst
=
tst
,
ted
=
ted
,
regnm
=
region
[
0
])
# calculate and save single fire files
FireGpkg_sfs
.
save_sfts_trng
(
tst
,
ted
,
regnm
=
region
[
0
])
tend
=
time
.
time
()
print
(
f
"
{
(
tend
-
tstart
)
/
60.
}
minutes used for
{
region
[
0
]
}
"
)
if
__name__
==
"
__main__
"
:
"""
The main code to run time forwarding for a time period
...
...
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