Skip to content
Snippets Groups Projects
Commit e35fc471 authored by Amy Stamile's avatar Amy Stamile
Browse files

removed full local paths

parent 92116f14
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
# Sensor Utils
%% Cell type:code id: tags:
``` python
import os
os.environ["ISISROOT"] = "/Users/astamile/ISIS3/build"
os.environ["ISISDATA"] = "/Volumes/isis_data1/isis_data/"
from csmapi import csmapi
from knoten import csm, sensor_utils
from knoten.shape import Ellipsoid
from knoten.illuminator import Illuminator
import ale
import json
```
%% Cell type:markdown id: tags:
## Create a usgscsm sensor model
%% Cell type:code id: tags:
``` python
fileName = "data/N1573082850_1.cub"
kernels = ale.util.generate_kernels_from_cube(fileName, expand=True)
isd_string = ale.loads(fileName, props={'kernels': kernels})
csm_isd = os.path.splitext(fileName)[0] + '.json'
with open(csm_isd, 'w') as isd_file:
isd_file.write(isd_string)
```
%% Cell type:markdown id: tags:
## Run Sensor Utils with usgscsm sensor model and image point
%% Cell type:code id: tags:
``` python
camera = csm.create_csm(csm_isd)
image_pt = csmapi.ImageCoord(511.5, 511.5)
shape = Ellipsoid.from_csm_sensor(camera)
illuminator = Illuminator()
```
%% Cell type:code id: tags:
``` python
phaseAngle = sensor_utils.phase_angle(image_pt, camera, shape, illuminator)
phaseAngle
```
%% Output
38.87212509629895
%% Cell type:code id: tags:
``` python
emissionAngle = sensor_utils.emission_angle(image_pt, camera, shape)
emissionAngle
```
%% Output
49.60309924893989
%% Cell type:code id: tags:
``` python
slantDistance = sensor_utils.slant_distance(image_pt, camera, shape)
slantDistance
```
%% Output
2903512972.146115
%% Cell type:code id: tags:
``` python
targetCenterDistance = sensor_utils.target_center_distance(image_pt, camera)
targetCenterDistance
```
%% Output
2943536048.858226
%% Cell type:code id: tags:
``` python
subSpacecraftPoint = sensor_utils.sub_spacecraft_point(image_pt, camera)
subSpacecraftPoint
```
%% Output
LatLon(lat=3.2229625890973583, lon=258.6197326526089)
%% Cell type:code id: tags:
``` python
localRadius = sensor_utils.local_radius(image_pt, camera, shape)
localRadius
```
%% Output
59096282.024265066
%% Cell type:code id: tags:
``` python
rightAscDec = sensor_utils.right_ascension_declination(image_pt, camera)
rightAscDec
```
%% Output
(79.34815579474038, -2.7790780986459485)
%% Cell type:code id: tags:
``` python
lineResolution = sensor_utils.line_resolution(image_pt, camera, shape)
lineResolution
```
%% Output
17397.96094194587
%% Cell type:code id: tags:
``` python
sampleResolution = sensor_utils.sample_resolution(image_pt, camera, shape)
sampleResolution
```
%% Output
17397.93370038153
%% Cell type:code id: tags:
``` python
pixelResolution = sensor_utils.pixel_resolution(image_pt, camera, shape)
pixelResolution
```
%% Output
17397.9473211637
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment