Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
manuscript_code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
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
Maria Voigt
manuscript_code
Commits
af2ffb34
Commit
af2ffb34
authored
7 years ago
by
Maria Voigt
Browse files
Options
Downloads
Patches
Plain Diff
changing burnt to before cover change
parent
4efaa8ff
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/resource_use/preparing_grid_resource_use.py
+37
-34
37 additions, 34 deletions
src/resource_use/preparing_grid_resource_use.py
with
37 additions
and
34 deletions
src/resource_use/preparing_grid_resource_use.py
+
37
−
34
View file @
af2ffb34
...
@@ -91,13 +91,13 @@ np.unique(grid)
...
@@ -91,13 +91,13 @@ np.unique(grid)
# 0 - absence
# 0 - absence
# 1 - plantation
# 1 - plantation
# 2 - deforestation
# 2 - deforestation
# 3 -
landcover change
# 3 -
burnt
# 4 - l
oggi
ng
# 4 - l
andcover cha
ng
e
# 5 -
primary forest < 750m
# 5 -
logging
# 6 - primary forest
>
750
# 6 - primary forest
<
750
m
# 7 -
regrowth
# 7 -
primary forest > 750
# 8 -
plantations before 2000
# 8 -
regrowth
# 9 -
burnt
# 9 -
plantations before 2000
# 10 - other
# 10 - other
...
@@ -148,72 +148,75 @@ grid = np.where((plantations == 1) &
...
@@ -148,72 +148,75 @@ grid = np.where((plantations == 1) &
grid
=
np
.
where
((
plantations
==
0
)
&
grid
=
np
.
where
((
plantations
==
0
)
&
(
gaveau_deforested
==
1
)
&
(
gaveau_deforested
==
1
)
&
(
grid
==
1
),
2
,
grid
)
(
grid
==
1
),
2
,
grid
)
# 3 is burnt areas
grid
=
np
.
where
((
plantations
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
burnt
==
1
)
&
(
grid
==
1
),
3
,
grid
)
# 4 cover change
grid
=
np
.
where
((
plantations
==
0
)
&
grid
=
np
.
where
((
plantations
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
burnt
==
0
)
&
(
cover_change
==
1
)
&
(
cover_change
==
1
)
&
(
grid
==
1
),
3
,
grid
)
(
grid
==
1
),
4
,
grid
)
# 5 logged
grid
=
np
.
where
((
plantations
==
0
)
&
grid
=
np
.
where
((
plantations
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
burnt
==
0
)
&
(
cover_change
==
0
)
&
(
cover_change
==
0
)
&
(
gaveau_logged
==
1
)
&
(
gaveau_logged
==
1
)
&
(
grid
==
1
),
4
,
grid
)
(
grid
==
1
),
5
,
grid
)
#
5
primary forest
#
6
primary forest
grid
=
np
.
where
((
plantations
==
0
)
&
grid
=
np
.
where
((
plantations
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
burnt
==
0
)
&
(
cover_change
==
0
)
&
(
cover_change
==
0
)
&
(
gaveau_logged
==
0
)
&
(
gaveau_logged
==
0
)
&
(
gaveau_primary_forest
==
1
)
&
(
gaveau_primary_forest
==
1
)
&
(
grid
==
1
),
5
,
grid
)
(
grid
==
1
),
6
,
grid
)
# add here primary forest at high altitudes
# add here primary forest at high altitudes
# because everywhere where we have primary forest
# because everywhere where we have primary forest
# we no longer have a 1 in grid but a six we do it differently
# we no longer have a 1 in grid but a six we do it differently
# 7 primary montane
grid
=
np
.
where
((
grid
==
5
)
&
grid
=
np
.
where
((
grid
==
5
)
&
(
dem
>
750
),
6
,
grid
)
(
dem
>
750
),
7
,
grid
)
#
7
regrowth
#
8
regrowth
grid
=
np
.
where
((
plantations
==
0
)
&
grid
=
np
.
where
((
plantations
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
burnt
==
0
)
&
(
cover_change
==
0
)
&
(
cover_change
==
0
)
&
(
gaveau_logged
==
0
)
&
(
gaveau_logged
==
0
)
&
(
gaveau_primary_forest
==
0
)
&
(
gaveau_primary_forest
==
0
)
&
(
gaveau_regrowth
==
1
)
&
(
gaveau_regrowth
==
1
)
&
(
grid
==
1
),
7
,
grid
)
(
grid
==
1
),
8
,
grid
)
#
8
is old plantations
#
9
is old plantations
grid
=
np
.
where
((
plantations
==
0
)
&
grid
=
np
.
where
((
plantations
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
burnt
==
0
)
&
(
cover_change
==
0
)
&
(
cover_change
==
0
)
&
(
gaveau_logged
==
0
)
&
(
gaveau_logged
==
0
)
&
(
gaveau_primary_forest
==
0
)
&
(
gaveau_primary_forest
==
0
)
&
(
gaveau_regrowth
==
0
)
&
(
gaveau_regrowth
==
0
)
&
(
old_plantations
==
1
)
&
(
old_plantations
==
1
)
&
(
grid
==
1
),
8
,
grid
)
(
grid
==
1
),
9
,
grid
)
# 9 is burnt areas
grid
=
np
.
where
((
plantations
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
cover_change
==
0
)
&
(
gaveau_logged
==
0
)
&
(
gaveau_primary_forest
==
0
)
&
(
gaveau_regrowth
==
0
)
&
(
old_plantations
==
0
)
&
(
burnt
==
1
)
&
(
grid
==
1
),
9
,
grid
)
# 10 is other
# 10 is other
grid
=
np
.
where
((
plantations
==
0
)
&
grid
=
np
.
where
((
plantations
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
gaveau_deforested
==
0
)
&
(
cover_change
==
0
)
&
(
burnt
==
0
)
&
(
gaveau_logged
==
0
)
&
(
cover_change
==
0
)
&
(
gaveau_primary_forest
==
0
)
&
(
gaveau_logged
==
0
)
&
(
gaveau_regrowth
==
0
)
&
(
gaveau_primary_forest
==
0
)
&
(
old_plantations
==
0
)
&
(
gaveau_regrowth
==
0
)
&
(
burnt
==
0
)
&
(
grid
==
1
),
10
,
grid
)
(
grid
==
1
),
10
,
grid
)
np
.
unique
(
grid
)
np
.
unique
(
grid
)
...
...
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