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
e35fc471
Commit
e35fc471
authored
1 year ago
by
Amy Stamile
Browse files
Options
Downloads
Patches
Plain Diff
removed full local paths
parent
92116f14
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
examples/sensor_utils.ipynb
+0
-3
0 additions, 3 deletions
examples/sensor_utils.ipynb
with
0 additions
and
3 deletions
examples/sensor_utils.ipynb
+
0
−
3
View file @
e35fc471
...
@@ -15,9 +15,6 @@
...
@@ -15,9 +15,6 @@
"source": [
"source": [
"import os\n",
"import os\n",
"\n",
"\n",
"os.environ[\"ISISROOT\"] = \"/Users/astamile/ISIS3/build\"\n",
"os.environ[\"ISISDATA\"] = \"/Volumes/isis_data1/isis_data/\"\n",
"\n",
"from csmapi import csmapi\n",
"from csmapi import csmapi\n",
"from knoten import csm, sensor_utils\n",
"from knoten import csm, sensor_utils\n",
"\n",
"\n",
...
...
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
# Sensor Utils
# Sensor Utils
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
import
os
import
os
os
.
environ
[
"
ISISROOT
"
]
=
"
/Users/astamile/ISIS3/build
"
os
.
environ
[
"
ISISDATA
"
]
=
"
/Volumes/isis_data1/isis_data/
"
from
csmapi
import
csmapi
from
csmapi
import
csmapi
from
knoten
import
csm
,
sensor_utils
from
knoten
import
csm
,
sensor_utils
from
knoten.shape
import
Ellipsoid
from
knoten.shape
import
Ellipsoid
from
knoten.illuminator
import
Illuminator
from
knoten.illuminator
import
Illuminator
import
ale
import
ale
import
json
import
json
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
## Create a usgscsm sensor model
## Create a usgscsm sensor model
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
fileName
=
"
data/N1573082850_1.cub
"
fileName
=
"
data/N1573082850_1.cub
"
kernels
=
ale
.
util
.
generate_kernels_from_cube
(
fileName
,
expand
=
True
)
kernels
=
ale
.
util
.
generate_kernels_from_cube
(
fileName
,
expand
=
True
)
isd_string
=
ale
.
loads
(
fileName
,
props
=
{
'
kernels
'
:
kernels
})
isd_string
=
ale
.
loads
(
fileName
,
props
=
{
'
kernels
'
:
kernels
})
csm_isd
=
os
.
path
.
splitext
(
fileName
)[
0
]
+
'
.json
'
csm_isd
=
os
.
path
.
splitext
(
fileName
)[
0
]
+
'
.json
'
with
open
(
csm_isd
,
'
w
'
)
as
isd_file
:
with
open
(
csm_isd
,
'
w
'
)
as
isd_file
:
isd_file
.
write
(
isd_string
)
isd_file
.
write
(
isd_string
)
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
## Run Sensor Utils with usgscsm sensor model and image point
## Run Sensor Utils with usgscsm sensor model and image point
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
camera
=
csm
.
create_csm
(
csm_isd
)
camera
=
csm
.
create_csm
(
csm_isd
)
image_pt
=
csmapi
.
ImageCoord
(
511.5
,
511.5
)
image_pt
=
csmapi
.
ImageCoord
(
511.5
,
511.5
)
shape
=
Ellipsoid
.
from_csm_sensor
(
camera
)
shape
=
Ellipsoid
.
from_csm_sensor
(
camera
)
illuminator
=
Illuminator
()
illuminator
=
Illuminator
()
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
phaseAngle
=
sensor_utils
.
phase_angle
(
image_pt
,
camera
,
shape
,
illuminator
)
phaseAngle
=
sensor_utils
.
phase_angle
(
image_pt
,
camera
,
shape
,
illuminator
)
phaseAngle
phaseAngle
```
```
%% Output
%% Output
38.87212509629895
38.87212509629895
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
emissionAngle
=
sensor_utils
.
emission_angle
(
image_pt
,
camera
,
shape
)
emissionAngle
=
sensor_utils
.
emission_angle
(
image_pt
,
camera
,
shape
)
emissionAngle
emissionAngle
```
```
%% Output
%% Output
49.60309924893989
49.60309924893989
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
slantDistance
=
sensor_utils
.
slant_distance
(
image_pt
,
camera
,
shape
)
slantDistance
=
sensor_utils
.
slant_distance
(
image_pt
,
camera
,
shape
)
slantDistance
slantDistance
```
```
%% Output
%% Output
2903512972.146115
2903512972.146115
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
targetCenterDistance
=
sensor_utils
.
target_center_distance
(
image_pt
,
camera
)
targetCenterDistance
=
sensor_utils
.
target_center_distance
(
image_pt
,
camera
)
targetCenterDistance
targetCenterDistance
```
```
%% Output
%% Output
2943536048.858226
2943536048.858226
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
subSpacecraftPoint
=
sensor_utils
.
sub_spacecraft_point
(
image_pt
,
camera
)
subSpacecraftPoint
=
sensor_utils
.
sub_spacecraft_point
(
image_pt
,
camera
)
subSpacecraftPoint
subSpacecraftPoint
```
```
%% Output
%% Output
LatLon(lat=3.2229625890973583, lon=258.6197326526089)
LatLon(lat=3.2229625890973583, lon=258.6197326526089)
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
localRadius
=
sensor_utils
.
local_radius
(
image_pt
,
camera
,
shape
)
localRadius
=
sensor_utils
.
local_radius
(
image_pt
,
camera
,
shape
)
localRadius
localRadius
```
```
%% Output
%% Output
59096282.024265066
59096282.024265066
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
rightAscDec
=
sensor_utils
.
right_ascension_declination
(
image_pt
,
camera
)
rightAscDec
=
sensor_utils
.
right_ascension_declination
(
image_pt
,
camera
)
rightAscDec
rightAscDec
```
```
%% Output
%% Output
(79.34815579474038, -2.7790780986459485)
(79.34815579474038, -2.7790780986459485)
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
lineResolution
=
sensor_utils
.
line_resolution
(
image_pt
,
camera
,
shape
)
lineResolution
=
sensor_utils
.
line_resolution
(
image_pt
,
camera
,
shape
)
lineResolution
lineResolution
```
```
%% Output
%% Output
17397.96094194587
17397.96094194587
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
sampleResolution
=
sensor_utils
.
sample_resolution
(
image_pt
,
camera
,
shape
)
sampleResolution
=
sensor_utils
.
sample_resolution
(
image_pt
,
camera
,
shape
)
sampleResolution
sampleResolution
```
```
%% Output
%% Output
17397.93370038153
17397.93370038153
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
pixelResolution
=
sensor_utils
.
pixel_resolution
(
image_pt
,
camera
,
shape
)
pixelResolution
=
sensor_utils
.
pixel_resolution
(
image_pt
,
camera
,
shape
)
pixelResolution
pixelResolution
```
```
%% Output
%% Output
17397.9473211637
17397.9473211637
...
...
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