Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dinamis-sdk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CDOS-Pub
dinamis-sdk
Merge requests
!4
Enh documentation supers2
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Enh documentation supers2
enh_documentation_supers2
into
main
Overview
0
Commits
16
Pipelines
1
Changes
9
Merged
Cresson Remi
requested to merge
enh_documentation_supers2
into
main
1 year ago
Overview
0
Commits
16
Pipelines
1
Changes
9
Expand
close
#4 (closed)
close
#3 (closed)
Edited
1 year ago
by
Cresson Remi
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
39dcf6ca
16 commits,
1 year ago
9 files
+
121
−
62
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
9
Search (e.g. *.vue) (Ctrl+P)
dinamis_sdk/examples/pyotb_ndvi_loss.py
+
7
−
5
Options
@@ -8,12 +8,14 @@ api = Client.open(
modifier
=
sign_inplace
)
bbox
=
[
4
,
42.99
,
5
,
44.05
]
def
mosa
(
year
):
"""
Return a pyotb application that perform a mosaic.
"""
res
=
api
.
search
(
bbox
=
bbox
,
datetime
=
[
f
'
{
year
}
-01-01
'
,
f
'
{
year
}
-12-25
'
])
res
=
api
.
search
(
bbox
=
[
4
,
42.99
,
5
,
44.05
],
datetime
=
[
f
"
{
year
}
-01-01
"
,
f
"
{
year
}
-12-25
"
],
collections
=
[
"
spot-6-7-drs
"
]
)
urls
=
[
f
"
/vsicurl/
{
r
.
assets
[
'
src_xs
'
].
href
}
"
for
r
in
res
.
items
()]
return
pyotb
.
Mosaic
({
"
il
"
:
urls
})
@@ -23,7 +25,7 @@ def ndvi(xs):
return
pyotb
.
BandMath
({
"
il
"
:
[
xs
],
"
exp
"
:
"
(im1b4-im1b1)/(im1b4+im1b1)
"
})
ndvi_22
=
ndvi
(
mosa
(
'
2022
'
))
ndvi_21
=
ndvi
(
mosa
(
'
2021
'
))
ndvi_22
=
ndvi
(
mosa
(
"
2022
"
))
ndvi_21
=
ndvi
(
mosa
(
"
2021
"
))
delta_ndvi
=
ndvi_22
-
pyotb
.
Superimpose
({
"
inr
"
:
ndvi_22
,
"
inm
"
:
ndvi_21
})
delta_ndvi
.
write
(
"
ndvi_loss.tif?&box=5000:5000:4096:4096
"
)
Loading