Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Knoten
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
aflab
astrogeology
Knoten
Commits
7e371004
Commit
7e371004
authored
5 years ago
by
Jesse Mapel
Committed by
Jesse Mapel
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added verbose for creating a csm sensor
parent
cb0ef624
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
knoten/csm.py
+19
-2
19 additions, 2 deletions
knoten/csm.py
with
19 additions
and
2 deletions
knoten/csm.py
+
19
−
2
View file @
7e371004
...
...
@@ -74,7 +74,7 @@ def create_camera(label, url='http://pfeffer.wr.usgs.gov/api/1.0/pds/'):
model
=
plugin
.
constructModelFromISD
(
isd
,
model_name
)
return
model
def
create_csm
(
image
):
def
create_csm
(
image
,
verbose
=
False
):
"""
Given an image file create a Community Sensor Model.
...
...
@@ -82,6 +82,8 @@ def create_csm(image):
----------
image : str
The image filename to create a CSM for
verbose : bool
Print information about which plugins and models were attempted
Returns
-------
...
...
@@ -91,11 +93,26 @@ def create_csm(image):
isd
=
csmapi
.
Isd
(
image
)
plugins
=
csmapi
.
Plugin
.
getList
()
for
plugin
in
plugins
:
if
verbose
:
print
(
f
'
Trying plugin
{
plugin
.
getPluginName
()
}
'
)
num_models
=
plugin
.
getNumModels
()
for
model_index
in
range
(
num_models
):
model_name
=
plugin
.
getModelName
(
model_index
)
if
plugin
.
canModelBeConstructedFromISD
(
isd
,
model_name
):
warnings
=
csmapi
.
WarningList
()
if
verbose
:
print
(
f
'
Trying model
{
plugin
.
getModelName
(
model_index
)
}
'
)
if
plugin
.
canModelBeConstructedFromISD
(
isd
,
model_name
,
warnings
):
camera_warnings
=
csmapi
.
WarningList
()
camera
=
plugin
.
constructModelFromISD
(
isd
,
model_name
,
camera_warnings
)
if
verbose
:
for
warning
in
camera_warnings
:
print
(
f
'
Warning in function
{
warning
.
getFunction
()
}
:
"
{
warning
.
getMessage
()
}
"'
)
print
(
'
Success!
'
)
return
plugin
.
constructModelFromISD
(
isd
,
model_name
)
elif
verbose
:
for
warning
in
warnings
:
print
(
f
'
Warning in function
{
warning
.
getFunction
()
}
:
"
{
warning
.
getMessage
()
}
"'
)
print
(
'
Failed!
'
)
@singledispatch
def
generate_ground_point
(
dem
,
image_pt
,
camera
):
...
...
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