Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plio
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
Plio
Commits
7f9fd4c7
Commit
7f9fd4c7
authored
6 years ago
by
Adam Paquette
Browse files
Options
Downloads
Patches
Plain Diff
Small changes.
parent
81d0ef93
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/socet2isis
+1
-5
1 addition, 5 deletions
bin/socet2isis
plio/spatial/transformations.py
+53
-5
53 additions, 5 deletions
plio/spatial/transformations.py
with
54 additions
and
10 deletions
bin/socet2isis
+
1
−
5
View file @
7f9fd4c7
...
@@ -34,11 +34,7 @@ def main(args):
...
@@ -34,11 +34,7 @@ def main(args):
else
:
else
:
outpath
=
os
.
path
.
split
(
at_file
)[
0
]
outpath
=
os
.
path
.
split
(
at_file
)[
0
]
# with open(args.cub_ipf_map) as cub_ipf_map:
# Read in and setup the atf dict of information
# reader = csv.reader(cub_ipf_map, delimiter = ',')
# image_dict = dict([(row[0], row[1]) for row in reader])
# Read in and setup the atf dict of information
atf_dict
=
read_atf
(
at_file
)
atf_dict
=
read_atf
(
at_file
)
# Get the gpf and ipf files using atf dict
# Get the gpf and ipf files using atf dict
...
...
This diff is collapsed.
Click to expand it.
plio/spatial/transformations.py
+
53
−
5
View file @
7f9fd4c7
...
@@ -317,12 +317,24 @@ def apply_isis_transformations(df, eRadius, pRadius, serial_dict, extension, cub
...
@@ -317,12 +317,24 @@ def apply_isis_transformations(df, eRadius, pRadius, serial_dict, extension, cub
Parameters
Parameters
----------
----------
atf_dict : dict
Dictionary containing information from an atf file
df : object
df : object
Pandas dataframe object
Pandas dataframe object
eRadius : float
Equitorial radius
pRadius : float
Polar radius
serial_dict : dict
Dictionary mapping serials as keys to images as the values
extension : str
String extension of all cubes being used
cub_path : str
Path to all cubes being used
"""
"""
# Convert from geocentered coords (x, y, z), to lat lon coords (latitude, longitude, alltitude)
# Convert from geocentered coords (x, y, z), to lat lon coords (latitude, longitude, alltitude)
ecef
=
np
.
array
([[
df
[
'
long_X_East
'
]],
[
df
[
'
lat_Y_North
'
]],
[
df
[
'
ht
'
]]])
ecef
=
np
.
array
([[
df
[
'
long_X_East
'
]],
[
df
[
'
lat_Y_North
'
]],
[
df
[
'
ht
'
]]])
...
@@ -521,16 +533,52 @@ def reverse_known(record):
...
@@ -521,16 +533,52 @@ def reverse_known(record):
return
3
return
3
def
fix_sample_line
(
record
,
serial_dict
,
extension
,
cub_path
):
def
fix_sample_line
(
record
,
serial_dict
,
extension
,
cub_path
):
"""
Extracts the sample, line data from a cube and computes deviation from the
center of the image
Parameters
----------
record : dict
Dict containing the key serialnumber, l., and s.
serial_dict : dict
Maps serial numbers to images
extension : str
Extension for cube being looked at
cub_path : str
Path to a given cube being looked at
Returns
-------
new_line : int
new line deviation from the center
new_sample : int
new sample deviation from the center
"""
# Cube location to load
# Cube location to load
cube
=
pvl
.
load
(
os
.
path
.
join
(
cub_path
,
serial_dict
[
record
[
'
serialnumber
'
]]
+
extension
))
cube
=
pvl
.
load
(
os
.
path
.
join
(
cub_path
,
serial_dict
[
record
[
'
serialnumber
'
]]
+
extension
))
line_size
=
find_in_dict
(
cube
,
'
Lines
'
)
line_size
=
find_in_dict
(
cube
,
'
Lines
'
)
sample_size
=
find_in_dict
(
cube
,
'
Samples
'
)
sample_size
=
find_in_dict
(
cube
,
'
Samples
'
)
new_line
=
record
[
'
l.
'
]
-
(
int
(
line_size
)
/
2.0
)
-
1
new_line
=
record
[
'
l.
'
]
-
(
int
(
line_size
/
2.0
))
-
1
new_sample
=
record
[
'
s.
'
]
-
(
int
(
sample_size
)
/
2.0
)
-
1
new_sample
=
record
[
'
s.
'
]
-
(
int
(
sample_size
/
2.0
))
-
1
return
new_line
,
new_sample
return
new_line
,
new_sample
def
ignore_toggle
(
record
):
def
ignore_toggle
(
record
):
"""
Maps the stat column in a record to 0 or 1 based on True or False
Parameters
----------
record : dict
Dict containing the key stat
"""
if
record
[
'
stat
'
]
==
True
:
if
record
[
'
stat
'
]
==
True
:
return
0
return
0
else
:
else
:
...
...
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