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
b4b37c37
Commit
b4b37c37
authored
6 years ago
by
Adam Paquette
Browse files
Options
Downloads
Patches
Plain Diff
Fixed system to cooperate with isis programs.
parent
f55cbbfd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
bin/isis2socet
+17
-0
17 additions, 0 deletions
bin/isis2socet
bin/socet2isis
+6
-5
6 additions, 5 deletions
bin/socet2isis
notebooks/Socet2ISIS.ipynb
+615
-22
615 additions, 22 deletions
notebooks/Socet2ISIS.ipynb
plio/io/io_controlnetwork.py
+1
-0
1 addition, 0 deletions
plio/io/io_controlnetwork.py
with
639 additions
and
27 deletions
bin/isis2socet
0 → 100644
+
17
−
0
View file @
b4b37c37
#!/usr/bin/env python
import
argparse
import
os
def
parse_args
():
parser
=
argparse
.
ArgumentParser
()
# Add args here
return
parser
.
parse_args
()
def
main
(
args
):
print
(
'
Do some stuff
'
)
if
__name__
==
'
__main__
'
:
main
(
parse_args
())
This diff is collapsed.
Click to expand it.
bin/socet2isis
+
6
−
5
View file @
b4b37c37
...
@@ -20,6 +20,7 @@ def parse_args():
...
@@ -20,6 +20,7 @@ def parse_args():
parser
.
add_argument
(
'
at_file
'
,
help
=
'
Path to the .atf file for a project.
'
)
parser
.
add_argument
(
'
at_file
'
,
help
=
'
Path to the .atf file for a project.
'
)
parser
.
add_argument
(
'
cub_file_path
'
,
help
=
'
Path to cube files related to ipf files.
'
)
parser
.
add_argument
(
'
cub_file_path
'
,
help
=
'
Path to cube files related to ipf files.
'
)
parser
.
add_argument
(
'
cub_ipf_map
'
,
help
=
'
Path to map file for all ipfs and cubes.
'
)
parser
.
add_argument
(
'
cub_ipf_map
'
,
help
=
'
Path to map file for all ipfs and cubes.
'
)
parser
.
add_argument
(
'
target_name
'
,
help
=
'
Name of the target body used in the control net
'
)
parser
.
add_argument
(
'
--outpath
'
,
help
=
'
Directory for the control network to be output to.
'
,
parser
.
add_argument
(
'
--outpath
'
,
help
=
'
Directory for the control network to be output to.
'
,
required
=
False
)
required
=
False
)
...
@@ -73,10 +74,10 @@ def main(args):
...
@@ -73,10 +74,10 @@ def main(args):
# Define column remap for socet dataframe
# Define column remap for socet dataframe
column_remap
=
{
'
l.
'
:
'
y
'
,
'
s.
'
:
'
x
'
,
column_remap
=
{
'
l.
'
:
'
y
'
,
'
s.
'
:
'
x
'
,
'
res_l
'
:
'
LineResidual
'
,
'
res_s
'
:
'
SampleResidual
'
,
'
known
'
:
'
Type
'
,
'
res_l
'
:
'
LineResidual
'
,
'
res_s
'
:
'
SampleResidual
'
,
'
known
'
:
'
Type
'
,
'
lat_Y_North
'
:
'
AprioriY
'
,
'
long_X_East
'
:
'
AprioriX
'
,
'
ht
'
:
'
AprioriZ
'
,
'
lat_Y_North
'
:
'
AprioriY
'
,
'
long_X_East
'
:
'
AprioriX
'
,
'
ht
'
:
'
AprioriZ
'
,
'
sig0
'
:
'
AprioriLatitudeSigma
'
,
'
sig1
'
:
'
AprioriLongitudeSigma
'
,
'
sig0
'
:
'
AprioriLatitudeSigma
'
,
'
sig1
'
:
'
AprioriLongitudeSigma
'
,
'
sig2
'
:
'
AprioriRadiusSigma
'
}
'
sig2
'
:
'
AprioriRadiusSigma
'
}
# Rename the columns using the column remap above
# Rename the columns using the column remap above
socet_df
.
rename
(
columns
=
column_remap
,
inplace
=
True
)
socet_df
.
rename
(
columns
=
column_remap
,
inplace
=
True
)
...
@@ -86,7 +87,7 @@ def main(args):
...
@@ -86,7 +87,7 @@ def main(args):
serial_dict
=
serial_numbers
(
image_dict
,
cub_path
)
serial_dict
=
serial_numbers
(
image_dict
,
cub_path
)
# creates the control network
# creates the control network
cn
.
to_isis
(
os
.
path
.
join
(
outpath
,
cnet_out
+
'
.net
'
),
socet_df
,
serial_dict
)
cn
.
to_isis
(
os
.
path
.
join
(
outpath
,
cnet_out
+
'
.net
'
),
socet_df
,
serial_dict
,
targetname
=
args
.
target_name
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
main
(
parse_args
())
main
(
parse_args
())
This diff is collapsed.
Click to expand it.
notebooks/Socet2ISIS.ipynb
+
615
−
22
View file @
b4b37c37
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"cells": [
"cells": [
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
null
,
"execution_count":
56
,
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
"source": [
"source": [
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
null
,
"execution_count":
85
,
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
"source": [
"source": [
...
@@ -82,6 +82,7 @@
...
@@ -82,6 +82,7 @@
" return files_dict\n",
" return files_dict\n",
"\n",
"\n",
"# converts columns l. and s. to isis\n",
"# converts columns l. and s. to isis\n",
"# no transform applied\n",
"def line_sample_size(record, path):\n",
"def line_sample_size(record, path):\n",
" with open(os.path.join(path, record['ipf_file'] + '.sup')) as f:\n",
" with open(os.path.join(path, record['ipf_file'] + '.sup')) as f:\n",
" for i, line in enumerate(f):\n",
" for i, line in enumerate(f):\n",
...
@@ -107,6 +108,7 @@
...
@@ -107,6 +108,7 @@
" return sample_size, line_size, img_index\n",
" return sample_size, line_size, img_index\n",
" \n",
" \n",
"# converts known to ISIS keywords\n",
"# converts known to ISIS keywords\n",
"# transform\n",
"def known(record):\n",
"def known(record):\n",
" if record['known'] == 0:\n",
" if record['known'] == 0:\n",
" return 'Free'\n",
" return 'Free'\n",
...
@@ -119,6 +121,7 @@
...
@@ -119,6 +121,7 @@
" return num % 360\n",
" return num % 360\n",
"\n",
"\n",
"# ocentric to ographic latitudes\n",
"# ocentric to ographic latitudes\n",
"# transform but unsure how to handle\n",
"def oc2og(dlat, dMajorRadius, dMinorRadius):\n",
"def oc2og(dlat, dMajorRadius, dMinorRadius):\n",
" try: \n",
" try: \n",
" dlat = math.radians(dlat)\n",
" dlat = math.radians(dlat)\n",
...
@@ -129,6 +132,7 @@
...
@@ -129,6 +132,7 @@
" return dlat\n",
" return dlat\n",
"\n",
"\n",
"# ographic to ocentric latitudes\n",
"# ographic to ocentric latitudes\n",
"# transform but unsure how to handle\n",
"def og2oc(dlat, dMajorRadius, dMinorRadius):\n",
"def og2oc(dlat, dMajorRadius, dMinorRadius):\n",
" try:\n",
" try:\n",
" dlat = math.radians(dlat)\n",
" dlat = math.radians(dlat)\n",
...
@@ -197,22 +201,30 @@
...
@@ -197,22 +201,30 @@
" \"\"\"\n",
" \"\"\"\n",
" Given geospatial coordinates, desired accuracy sigmas, and an equitorial radius, compute a 2x3\n",
" Given geospatial coordinates, desired accuracy sigmas, and an equitorial radius, compute a 2x3\n",
" sigma covariange matrix.\n",
" sigma covariange matrix.\n",
" \n",
" Parameters\n",
" Parameters\n",
" ----------\n",
" ----------\n",
" lat : float\n",
" lat : float\n",
" A point's latitude in degrees\n",
" A point's latitude in degrees\n",
" \n",
" lon : float\n",
" lon : float\n",
" A point's longitude in degrees\n",
" A point's longitude in degrees\n",
" \n",
" rad : float\n",
" rad : float\n",
" The radius (z-value) of the point in meters\n",
" The radius (z-value) of the point in meters\n",
" \n",
" latsigma : float\n",
" latsigma : float\n",
" The desired latitude accuracy in meters (Default 10.0)\n",
" The desired latitude accuracy in meters (Default 10.0)\n",
" \n",
" lonsigma : float\n",
" lonsigma : float\n",
" The desired longitude accuracy in meters (Default 10.0)\n",
" The desired longitude accuracy in meters (Default 10.0)\n",
" \n",
" radsigma : float\n",
" radsigma : float\n",
" The desired radius accuracy in meters (Defualt: 15.0)\n",
" The desired radius accuracy in meters (Defualt: 15.0)\n",
" \n",
" semimajor_axis : float\n",
" semimajor_axis : float\n",
" The semi-major or equitorial radius in meters (Default: 1737400.0 - Moon)\n",
" The semi-major or equitorial radius in meters (Default: 1737400.0 - Moon)\n",
" \n",
" Returns\n",
" Returns\n",
" -------\n",
" -------\n",
" rectcov : ndarray\n",
" rectcov : ndarray\n",
...
@@ -261,7 +273,7 @@
...
@@ -261,7 +273,7 @@
" rectcov[1,1] = mat[1,2]\n",
" rectcov[1,1] = mat[1,2]\n",
" rectcov[1,2] = mat[2,2]\n",
" rectcov[1,2] = mat[2,2]\n",
" \n",
" \n",
" return rectcov\n",
" return
np.array(
rectcov
)
\n",
"# return np.array([[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]])\n",
"# return np.array([[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]])\n",
"\n",
"\n",
"\n",
"\n",
...
@@ -270,7 +282,7 @@
...
@@ -270,7 +282,7 @@
" return cov_matrix.ravel().tolist()\n",
" return cov_matrix.ravel().tolist()\n",
"\n",
"\n",
"# applys transformations to columns\n",
"# applys transformations to columns\n",
"def apply_transformations(atf_dict, df):\n",
"def apply_
two_isis_
transformations(atf_dict, df):\n",
" prj_file = os.path.join(atf_dict['PATH'], atf_dict['PROJECT'])\n",
" prj_file = os.path.join(atf_dict['PATH'], atf_dict['PROJECT'])\n",
" \n",
" \n",
" eRadius, pRadius = get_axis(prj_file)\n",
" eRadius, pRadius = get_axis(prj_file)\n",
...
@@ -285,7 +297,7 @@
...
@@ -285,7 +297,7 @@
" df['lat_Y_North'] = ecef[1][0]\n",
" df['lat_Y_North'] = ecef[1][0]\n",
" df['ht'] = ecef[2][0] \n",
" df['ht'] = ecef[2][0] \n",
" df['aprioriCovar'] = df.apply(compute_cov_matrix, semimajor_axis = eRadius, axis=1)\n",
" df['aprioriCovar'] = df.apply(compute_cov_matrix, semimajor_axis = eRadius, axis=1)\n",
" df['ignore'] = df.apply(ignore_toggle, axis=1)\n",
"
#
df['ignore'] = df.apply(ignore_toggle, axis=1)\n",
" \n",
" \n",
"def socet2isis(prj_file):\n",
"def socet2isis(prj_file):\n",
" # Read in and setup the atf dict of information\n",
" # Read in and setup the atf dict of information\n",
...
@@ -314,17 +326,17 @@
...
@@ -314,17 +326,17 @@
" socet_df = ipf_df.merge(gpf_df, left_on='pt_id', right_on='point_id')\n",
" socet_df = ipf_df.merge(gpf_df, left_on='pt_id', right_on='point_id')\n",
" \n",
" \n",
" # Apply the transformations\n",
" # Apply the transformations\n",
" apply_transformations(atf_dict, socet_df)\n",
"
#
apply_
two_isis_
transformations(atf_dict, socet_df)\n",
" \n",
" \n",
" # Define column remap for socet dataframe\n",
" # Define column remap for socet dataframe\n",
" column_
re
map = {'l.': 'y', 's.': 'x',\n",
"
#
column_map = {
'pt_id': 'id',
'l.': 'y', 's.': 'x',\n",
"
'res_l': 'lineResidual', 'res_s': 'sampleResidual', 'known': 'Type',\n",
"
#
'res_l': 'lineResidual', 'res_s': 'sampleResidual', 'known': 'Type',\n",
"
'lat_Y_North': '
A
prioriY', 'long_X_East': '
A
prioriX', 'ht': '
A
prioriZ',\n",
"
#
'lat_Y_North': '
a
prioriY', 'long_X_East': '
a
prioriX', 'ht': '
a
prioriZ',\n",
"
'sig0': '
A
prioriLatitudeSigma', 'sig1': '
A
prioriLongitudeSigma', 'sig2': '
A
prioriRadiusSigma',\n",
"
#
'sig0': '
a
prioriLatitudeSigma', 'sig1': '
a
prioriLongitudeSigma', 'sig2': '
a
prioriRadiusSigma',\n",
"
'sig_l': 'linesigma', 'sig_s': 'samplesigma'}\n",
"
#
'sig_l': 'linesigma', 'sig_s': 'samplesigma'}\n",
" \n",
" \n",
" # Rename the columns using the column remap above\n",
" # Rename the columns using the column remap above\n",
" socet_df.rename(columns = column_
re
map, inplace=True)\n",
"
#
socet_df.rename(columns = column_map, inplace=True)\n",
" \n",
" \n",
" # Return the socet dataframe to be converted to a control net\n",
" # Return the socet dataframe to be converted to a control net\n",
" return socet_df\n",
" return socet_df\n",
...
@@ -337,35 +349,616 @@
...
@@ -337,35 +349,616 @@
" snum = sn.generate_serial_number(os.path.join(path, image + extension))\n",
" snum = sn.generate_serial_number(os.path.join(path, image + extension))\n",
" snum = snum.replace('Mars_Reconnaissance_Orbiter', 'MRO')\n",
" snum = snum.replace('Mars_Reconnaissance_Orbiter', 'MRO')\n",
" serial_dict[image] = snum\n",
" serial_dict[image] = snum\n",
" return serial_dict\n",
" return serial_dict"
"\n"
]
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
null
,
"execution_count":
86
,
"metadata": {
"metadata": {
"scrolled": true
"scrolled": true
},
},
"outputs": [],
"outputs": [],
"source": [
"source": [
"# Setup stuffs for the cub information namely the path and extension\n",
"# Setup stuffs for the cub information namely the path and extension\n",
"path = '/
path/where/cub/files/are/
'\n",
"path = '/
home/acpaquette/repos/plio/test_cubes
'\n",
"\n",
"
targetname = 'Mars'
\n",
"# Extension of your cub files\n",
"# Extension of your cub files\n",
"extension = '.
something
.cub'\n",
"extension = '.
8bit
.cub'\n",
"\n",
"\n",
"# Path to atf file\n",
"# Path to atf file\n",
"atf_file = ('/
path/to/atf/file
')\n",
"atf_file = ('/
home/acpaquette/repos/plio/plio/examples/SocetSet/Relative.atf
')\n",
"\n",
"\n",
"socet_df = socet2isis(atf_file)\n",
"socet_df = socet2isis(atf_file)\n",
"\n",
"\n",
"images = pd.unique(socet_df['ipf_file'])\n",
"
#
images = pd.unique(socet_df['ipf_file'])\n",
"\n",
"\n",
"serial_dict = serial_numbers(images, path, extension)\n",
"
#
serial_dict = serial_numbers(images, path, extension)\n",
"\n",
"\n",
"# creates the control network\n",
"# creates the control network\n",
"cn.to_isis('/path/you/want/the/cnet/to/be/in/cn.net', socet_df, serial_dict)"
"# cn.to_isis('/home/acpaquette/repos/plio/plio/examples/SocetSet/cn.net', socet_df, serial_dict, targetname = targetname)"
]
},
{
"cell_type": "code",
"execution_count": 116,
"metadata": {},
"outputs": [],
"source": [
"return_df = cn.from_isis(\"/home/acpaquette/repos/plio/plio/examples/SocetSet/cn.net\")\n",
"\n",
"columns = []\n",
"column_index = []\n",
"\n",
"for i, column in enumerate(list(return_df.columns)):\n",
" if column not in columns:\n",
" column_index.append(i)\n",
" columns.append(column)\n",
"\n",
"return_df = return_df.iloc[:, column_index]"
]
},
{
"cell_type": "code",
"execution_count": 117,
"metadata": {},
"outputs": [],
"source": [
"column_map = {'pt_id': 'id', 'l.': 'y', 's.': 'x',\n",
" 'res_l': 'lineResidual', 'res_s': 'sampleResidual', 'known': 'Type',\n",
" 'lat_Y_North': 'aprioriY', 'long_X_East': 'aprioriX', 'ht': 'aprioriZ',\n",
" 'sig0': 'aprioriLatitudeSigma', 'sig1': 'aprioriLongitudeSigma', 'sig2': 'aprioriRadiusSigma',\n",
" 'sig_l': 'linesigma', 'sig_s': 'samplesigma'}\n",
"\n",
"column_map = {k: v for v, k in column_map.items()}\n",
"return_df.rename(columns = column_map, inplace=True)\n",
"return_df.drop(['chooserName', 'datetime', 'referenceIndex', 'jigsawRejected', 'editLock', 'aprioriSurfPointSource', 'aprioriSurfPointSourceFile','aprioriRadiusSource', 'aprioriRadiusSourceFile'] , axis = 1, inplace=True)"
]
},
{
"cell_type": "code",
"execution_count": 129,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>lat_Y_North</th>\n",
" <th>long_X_East</th>\n",
" <th>ht</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>139525.230749</td>\n",
" <td>3.390974e+06</td>\n",
" <td>4506.496945</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>139525.230749</td>\n",
" <td>3.390974e+06</td>\n",
" <td>4506.496945</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>139489.278045</td>\n",
" <td>3.390969e+06</td>\n",
" <td>4516.454802</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>139489.278045</td>\n",
" <td>3.390969e+06</td>\n",
" <td>4516.454802</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>139823.489797</td>\n",
" <td>3.390990e+06</td>\n",
" <td>4536.274914</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>139823.489797</td>\n",
" <td>3.390990e+06</td>\n",
" <td>4536.274914</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>139772.738004</td>\n",
" <td>3.390936e+06</td>\n",
" <td>4518.050219</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>139772.738004</td>\n",
" <td>3.390936e+06</td>\n",
" <td>4518.050219</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>139575.914815</td>\n",
" <td>3.390952e+06</td>\n",
" <td>3816.666542</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>139575.914815</td>\n",
" <td>3.390952e+06</td>\n",
" <td>3816.666542</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>139614.756296</td>\n",
" <td>3.390953e+06</td>\n",
" <td>3791.232717</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>139614.756296</td>\n",
" <td>3.390953e+06</td>\n",
" <td>3791.232717</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>139912.041374</td>\n",
" <td>3.390914e+06</td>\n",
" <td>3875.608660</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>139912.041374</td>\n",
" <td>3.390914e+06</td>\n",
" <td>3875.608660</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>139909.452033</td>\n",
" <td>3.390930e+06</td>\n",
" <td>3845.361327</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>139909.452033</td>\n",
" <td>3.390930e+06</td>\n",
" <td>3845.361327</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>139669.826849</td>\n",
" <td>3.391120e+06</td>\n",
" <td>3270.672620</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>139669.826849</td>\n",
" <td>3.391120e+06</td>\n",
" <td>3270.672620</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>139694.517017</td>\n",
" <td>3.391205e+06</td>\n",
" <td>3289.744506</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>139694.517017</td>\n",
" <td>3.391205e+06</td>\n",
" <td>3289.744506</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>139968.793338</td>\n",
" <td>3.391126e+06</td>\n",
" <td>3274.711397</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>139968.793338</td>\n",
" <td>3.391126e+06</td>\n",
" <td>3274.711397</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>139979.200780</td>\n",
" <td>3.391138e+06</td>\n",
" <td>3298.297228</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>139979.200780</td>\n",
" <td>3.391138e+06</td>\n",
" <td>3298.297228</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>139688.031217</td>\n",
" <td>3.391041e+06</td>\n",
" <td>4253.956077</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>139688.031217</td>\n",
" <td>3.391041e+06</td>\n",
" <td>4253.956077</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>139686.910823</td>\n",
" <td>3.391089e+06</td>\n",
" <td>4216.743792</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>139686.910823</td>\n",
" <td>3.391089e+06</td>\n",
" <td>4216.743792</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>139786.205284</td>\n",
" <td>3.390979e+06</td>\n",
" <td>3579.127600</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>139786.205284</td>\n",
" <td>3.390979e+06</td>\n",
" <td>3579.127600</td>\n",
" </tr>\n",
" <tr>\n",
" <th>30</th>\n",
" <td>139785.010997</td>\n",
" <td>3.391002e+06</td>\n",
" <td>3546.549796</td>\n",
" </tr>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>139785.010997</td>\n",
" <td>3.391002e+06</td>\n",
" <td>3546.549796</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" lat_Y_North long_X_East ht\n",
"0 139525.230749 3.390974e+06 4506.496945\n",
"1 139525.230749 3.390974e+06 4506.496945\n",
"2 139489.278045 3.390969e+06 4516.454802\n",
"3 139489.278045 3.390969e+06 4516.454802\n",
"4 139823.489797 3.390990e+06 4536.274914\n",
"5 139823.489797 3.390990e+06 4536.274914\n",
"6 139772.738004 3.390936e+06 4518.050219\n",
"7 139772.738004 3.390936e+06 4518.050219\n",
"8 139575.914815 3.390952e+06 3816.666542\n",
"9 139575.914815 3.390952e+06 3816.666542\n",
"10 139614.756296 3.390953e+06 3791.232717\n",
"11 139614.756296 3.390953e+06 3791.232717\n",
"12 139912.041374 3.390914e+06 3875.608660\n",
"13 139912.041374 3.390914e+06 3875.608660\n",
"14 139909.452033 3.390930e+06 3845.361327\n",
"15 139909.452033 3.390930e+06 3845.361327\n",
"16 139669.826849 3.391120e+06 3270.672620\n",
"17 139669.826849 3.391120e+06 3270.672620\n",
"18 139694.517017 3.391205e+06 3289.744506\n",
"19 139694.517017 3.391205e+06 3289.744506\n",
"20 139968.793338 3.391126e+06 3274.711397\n",
"21 139968.793338 3.391126e+06 3274.711397\n",
"22 139979.200780 3.391138e+06 3298.297228\n",
"23 139979.200780 3.391138e+06 3298.297228\n",
"24 139688.031217 3.391041e+06 4253.956077\n",
"25 139688.031217 3.391041e+06 4253.956077\n",
"26 139686.910823 3.391089e+06 4216.743792\n",
"27 139686.910823 3.391089e+06 4216.743792\n",
"28 139786.205284 3.390979e+06 3579.127600\n",
"29 139786.205284 3.390979e+06 3579.127600\n",
"30 139785.010997 3.391002e+06 3546.549796\n",
"31 139785.010997 3.391002e+06 3546.549796"
]
},
"execution_count": 129,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"return_df[['lat_Y_North', 'long_X_East', 'ht']]"
]
},
{
"cell_type": "code",
"execution_count": 128,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>lat_Y_North</th>\n",
" <th>long_X_East</th>\n",
" <th>ht</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>0.095708</td>\n",
" <td>2.356167</td>\n",
" <td>-2342.889214</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>0.095708</td>\n",
" <td>2.356167</td>\n",
" <td>-2342.889214</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>0.095920</td>\n",
" <td>2.355564</td>\n",
" <td>-2349.638414</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>0.095920</td>\n",
" <td>2.355564</td>\n",
" <td>-2349.638414</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>0.096339</td>\n",
" <td>2.361186</td>\n",
" <td>-2314.316425</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>0.096339</td>\n",
" <td>2.361186</td>\n",
" <td>-2314.316425</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>0.095954</td>\n",
" <td>2.360368</td>\n",
" <td>-2370.502882</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>0.095954</td>\n",
" <td>2.360368</td>\n",
" <td>-2370.502882</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>0.081058</td>\n",
" <td>2.357037</td>\n",
" <td>-2363.989968</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>0.081058</td>\n",
" <td>2.357037</td>\n",
" <td>-2363.989968</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>0.080518</td>\n",
" <td>2.357691</td>\n",
" <td>-2360.922571</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>0.080518</td>\n",
" <td>2.357691</td>\n",
" <td>-2360.922571</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>0.082311</td>\n",
" <td>2.362733</td>\n",
" <td>-2388.123298</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>0.082311</td>\n",
" <td>2.362733</td>\n",
" <td>-2388.123298</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>0.081668</td>\n",
" <td>2.362678</td>\n",
" <td>-2371.973499</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>0.081668</td>\n",
" <td>2.362678</td>\n",
" <td>-2371.973499</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>0.069458</td>\n",
" <td>2.358505</td>\n",
" <td>-2193.309629</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>0.069458</td>\n",
" <td>2.358505</td>\n",
" <td>-2193.309629</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>0.069861</td>\n",
" <td>2.358862</td>\n",
" <td>-2106.769773</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>0.069861</td>\n",
" <td>2.358862</td>\n",
" <td>-2106.769773</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>0.069543</td>\n",
" <td>2.363543</td>\n",
" <td>-2174.971745</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>0.069543</td>\n",
" <td>2.363543</td>\n",
" <td>-2174.971745</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>0.070044</td>\n",
" <td>2.363710</td>\n",
" <td>-2162.103231</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>0.070044</td>\n",
" <td>2.363710</td>\n",
" <td>-2162.103231</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>0.090342</td>\n",
" <td>2.358866</td>\n",
" <td>-2269.610862</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>0.090342</td>\n",
" <td>2.358866</td>\n",
" <td>-2269.610862</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>0.089550</td>\n",
" <td>2.358814</td>\n",
" <td>-2222.328983</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>0.089550</td>\n",
" <td>2.358814</td>\n",
" <td>-2222.328983</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>0.076012</td>\n",
" <td>2.360565</td>\n",
" <td>-2328.281125</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>0.076012</td>\n",
" <td>2.360565</td>\n",
" <td>-2328.281125</td>\n",
" </tr>\n",
" <tr>\n",
" <th>30</th>\n",
" <td>0.075320</td>\n",
" <td>2.360529</td>\n",
" <td>-2305.362047</td>\n",
" </tr>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>0.075320</td>\n",
" <td>2.360529</td>\n",
" <td>-2305.362047</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" lat_Y_North long_X_East ht\n",
"0 0.095708 2.356167 -2342.889214\n",
"1 0.095708 2.356167 -2342.889214\n",
"2 0.095920 2.355564 -2349.638414\n",
"3 0.095920 2.355564 -2349.638414\n",
"4 0.096339 2.361186 -2314.316425\n",
"5 0.096339 2.361186 -2314.316425\n",
"6 0.095954 2.360368 -2370.502882\n",
"7 0.095954 2.360368 -2370.502882\n",
"8 0.081058 2.357037 -2363.989968\n",
"9 0.081058 2.357037 -2363.989968\n",
"10 0.080518 2.357691 -2360.922571\n",
"11 0.080518 2.357691 -2360.922571\n",
"12 0.082311 2.362733 -2388.123298\n",
"13 0.082311 2.362733 -2388.123298\n",
"14 0.081668 2.362678 -2371.973499\n",
"15 0.081668 2.362678 -2371.973499\n",
"16 0.069458 2.358505 -2193.309629\n",
"17 0.069458 2.358505 -2193.309629\n",
"18 0.069861 2.358862 -2106.769773\n",
"19 0.069861 2.358862 -2106.769773\n",
"20 0.069543 2.363543 -2174.971745\n",
"21 0.069543 2.363543 -2174.971745\n",
"22 0.070044 2.363710 -2162.103231\n",
"23 0.070044 2.363710 -2162.103231\n",
"24 0.090342 2.358866 -2269.610862\n",
"25 0.090342 2.358866 -2269.610862\n",
"26 0.089550 2.358814 -2222.328983\n",
"27 0.089550 2.358814 -2222.328983\n",
"28 0.076012 2.360565 -2328.281125\n",
"29 0.076012 2.360565 -2328.281125\n",
"30 0.075320 2.360529 -2305.362047\n",
"31 0.075320 2.360529 -2305.362047"
]
},
"execution_count": 128,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"socet_df[['lat_Y_North', 'long_X_East', 'ht']]"
]
]
},
},
{
{
...
...
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
import
os
import
os
import
sys
import
sys
from
functools
import
singledispatch
from
functools
import
singledispatch
import
warnings
import
warnings
import
pandas
as
pd
import
pandas
as
pd
import
numpy
as
np
import
numpy
as
np
import
math
import
math
import
pyproj
import
pyproj
from
plio.examples
import
get_path
from
plio.examples
import
get_path
from
plio.io.io_bae
import
read_gpf
,
read_ipf
from
plio.io.io_bae
import
read_gpf
,
read_ipf
from
collections
import
defaultdict
from
collections
import
defaultdict
import
plio.io.io_controlnetwork
as
cn
import
plio.io.io_controlnetwork
as
cn
import
plio.io.isis_serial_number
as
sn
import
plio.io.isis_serial_number
as
sn
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
# Reads a .atf file and outputs all of the
# Reads a .atf file and outputs all of the
# .ipf, .gpf, .sup, .prj, and path to locate the
# .ipf, .gpf, .sup, .prj, and path to locate the
# .apf file (should be the same as all others)
# .apf file (should be the same as all others)
def
read_atf
(
atf_file
):
def
read_atf
(
atf_file
):
with
open
(
atf_file
)
as
f
:
with
open
(
atf_file
)
as
f
:
# Extensions of files we want
# Extensions of files we want
files_ext
=
[
'
.prj
'
,
'
.sup
'
,
'
.ipf
'
,
'
.gpf
'
]
files_ext
=
[
'
.prj
'
,
'
.sup
'
,
'
.ipf
'
,
'
.gpf
'
]
files_dict
=
[]
files_dict
=
[]
files
=
defaultdict
(
list
)
files
=
defaultdict
(
list
)
for
line
in
f
:
for
line
in
f
:
ext
=
os
.
path
.
splitext
(
line
)[
-
1
].
strip
()
ext
=
os
.
path
.
splitext
(
line
)[
-
1
].
strip
()
# Check is needed for split as all do not have a space
# Check is needed for split as all do not have a space
if
ext
in
files_ext
:
if
ext
in
files_ext
:
# If it is the .prj file, it strips the directory away and grabs file name
# If it is the .prj file, it strips the directory away and grabs file name
if
ext
==
'
.prj
'
:
if
ext
==
'
.prj
'
:
files
[
ext
].
append
(
line
.
strip
().
split
(
'
'
)[
1
].
split
(
'
\\
'
)[
-
1
])
files
[
ext
].
append
(
line
.
strip
().
split
(
'
'
)[
1
].
split
(
'
\\
'
)[
-
1
])
# If the ext is in the list of files we care about, it addes to the dict
# If the ext is in the list of files we care about, it addes to the dict
files
[
ext
].
append
(
line
.
strip
().
split
(
'
'
)[
-
1
])
files
[
ext
].
append
(
line
.
strip
().
split
(
'
'
)[
-
1
])
else
:
else
:
# Adds to the dict even if not in files we care about
# Adds to the dict even if not in files we care about
files
[
ext
.
strip
()].
append
(
line
)
files
[
ext
.
strip
()].
append
(
line
)
# Gets the base filepath
# Gets the base filepath
files
[
'
basepath
'
]
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
atf_file
))
files
[
'
basepath
'
]
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
atf_file
))
# Creates a dict out of file lists for GPF, PRJ, IPF, and ATF
# Creates a dict out of file lists for GPF, PRJ, IPF, and ATF
files_dict
=
(
dict
(
files_dict
))
files_dict
=
(
dict
(
files_dict
))
# Sets the value of IMAGE_IPF to all IPF images
# Sets the value of IMAGE_IPF to all IPF images
files_dict
[
'
IMAGE_IPF
'
]
=
files
[
'
.ipf
'
]
files_dict
[
'
IMAGE_IPF
'
]
=
files
[
'
.ipf
'
]
# Sets the value of IMAGE_SUP to all SUP images
# Sets the value of IMAGE_SUP to all SUP images
files_dict
[
'
IMAGE_SUP
'
]
=
files
[
'
.sup
'
]
files_dict
[
'
IMAGE_SUP
'
]
=
files
[
'
.sup
'
]
# Sets value for GPF file
# Sets value for GPF file
files_dict
[
'
GP_FILE
'
]
=
files
[
'
.gpf
'
][
0
]
files_dict
[
'
GP_FILE
'
]
=
files
[
'
.gpf
'
][
0
]
# Sets value for PRJ file
# Sets value for PRJ file
files_dict
[
'
PROJECT
'
]
=
files
[
'
.prj
'
][
0
]
files_dict
[
'
PROJECT
'
]
=
files
[
'
.prj
'
][
0
]
# Sets the value of PATH to the path of the ATF file
# Sets the value of PATH to the path of the ATF file
files_dict
[
'
PATH
'
]
=
files
[
'
basepath
'
]
files_dict
[
'
PATH
'
]
=
files
[
'
basepath
'
]
return
files_dict
return
files_dict
# converts columns l. and s. to isis
# converts columns l. and s. to isis
# no transform applied
def
line_sample_size
(
record
,
path
):
def
line_sample_size
(
record
,
path
):
with
open
(
os
.
path
.
join
(
path
,
record
[
'
ipf_file
'
]
+
'
.sup
'
))
as
f
:
with
open
(
os
.
path
.
join
(
path
,
record
[
'
ipf_file
'
]
+
'
.sup
'
))
as
f
:
for
i
,
line
in
enumerate
(
f
):
for
i
,
line
in
enumerate
(
f
):
if
i
==
2
:
if
i
==
2
:
img_index
=
line
.
split
(
'
\\
'
)
img_index
=
line
.
split
(
'
\\
'
)
img_index
=
img_index
[
-
1
].
strip
()
img_index
=
img_index
[
-
1
].
strip
()
img_index
=
img_index
.
split
(
'
.
'
)[
0
]
img_index
=
img_index
.
split
(
'
.
'
)[
0
]
if
i
==
3
:
if
i
==
3
:
line_size
=
line
.
split
(
'
'
)
line_size
=
line
.
split
(
'
'
)
line_size
=
line_size
[
-
1
].
strip
()
line_size
=
line_size
[
-
1
].
strip
()
assert
int
(
line_size
)
>
0
,
"
Line number {} from {} is a negative number: Invalid Data
"
.
format
(
line_size
,
record
[
'
ipf_file
'
])
assert
int
(
line_size
)
>
0
,
"
Line number {} from {} is a negative number: Invalid Data
"
.
format
(
line_size
,
record
[
'
ipf_file
'
])
if
i
==
4
:
if
i
==
4
:
sample_size
=
line
.
split
(
'
'
)
sample_size
=
line
.
split
(
'
'
)
sample_size
=
sample_size
[
-
1
].
strip
()
sample_size
=
sample_size
[
-
1
].
strip
()
assert
int
(
sample_size
)
>
0
,
"
Sample number {} from {} is a negative number: Invalid Data
"
.
format
(
sample_size
,
record
[
'
ipf_file
'
])
assert
int
(
sample_size
)
>
0
,
"
Sample number {} from {} is a negative number: Invalid Data
"
.
format
(
sample_size
,
record
[
'
ipf_file
'
])
break
break
line_size
=
int
(
line_size
)
/
2.0
+
record
[
'
l.
'
]
+
1
line_size
=
int
(
line_size
)
/
2.0
+
record
[
'
l.
'
]
+
1
sample_size
=
int
(
sample_size
)
/
2.0
+
record
[
'
s.
'
]
+
1
sample_size
=
int
(
sample_size
)
/
2.0
+
record
[
'
s.
'
]
+
1
return
sample_size
,
line_size
,
img_index
return
sample_size
,
line_size
,
img_index
# converts known to ISIS keywords
# converts known to ISIS keywords
# transform
def
known
(
record
):
def
known
(
record
):
if
record
[
'
known
'
]
==
0
:
if
record
[
'
known
'
]
==
0
:
return
'
Free
'
return
'
Free
'
elif
record
[
'
known
'
]
==
1
or
record
[
'
known
'
]
==
2
or
record
[
'
known
'
]
==
3
:
elif
record
[
'
known
'
]
==
1
or
record
[
'
known
'
]
==
2
or
record
[
'
known
'
]
==
3
:
return
'
Constrained
'
return
'
Constrained
'
# converts +/- 180 system to 0 - 360 system
# converts +/- 180 system to 0 - 360 system
def
to_360
(
num
):
def
to_360
(
num
):
return
num
%
360
return
num
%
360
# ocentric to ographic latitudes
# ocentric to ographic latitudes
# transform but unsure how to handle
def
oc2og
(
dlat
,
dMajorRadius
,
dMinorRadius
):
def
oc2og
(
dlat
,
dMajorRadius
,
dMinorRadius
):
try
:
try
:
dlat
=
math
.
radians
(
dlat
)
dlat
=
math
.
radians
(
dlat
)
dlat
=
math
.
atan
(((
dMajorRadius
/
dMinorRadius
)
**
2
)
*
(
math
.
tan
(
dlat
)))
dlat
=
math
.
atan
(((
dMajorRadius
/
dMinorRadius
)
**
2
)
*
(
math
.
tan
(
dlat
)))
dlat
=
math
.
degrees
(
dlat
)
dlat
=
math
.
degrees
(
dlat
)
except
:
except
:
print
(
"
Error in oc2og conversion
"
)
print
(
"
Error in oc2og conversion
"
)
return
dlat
return
dlat
# ographic to ocentric latitudes
# ographic to ocentric latitudes
# transform but unsure how to handle
def
og2oc
(
dlat
,
dMajorRadius
,
dMinorRadius
):
def
og2oc
(
dlat
,
dMajorRadius
,
dMinorRadius
):
try
:
try
:
dlat
=
math
.
radians
(
dlat
)
dlat
=
math
.
radians
(
dlat
)
dlat
=
math
.
atan
((
math
.
tan
(
dlat
)
/
((
dMajorRadius
/
dMinorRadius
)
**
2
)))
dlat
=
math
.
atan
((
math
.
tan
(
dlat
)
/
((
dMajorRadius
/
dMinorRadius
)
**
2
)))
dlat
=
math
.
degrees
(
dlat
)
dlat
=
math
.
degrees
(
dlat
)
except
:
except
:
print
(
"
Error in og2oc conversion
"
)
print
(
"
Error in og2oc conversion
"
)
return
dlat
return
dlat
# gets eRadius and pRadius from a .prj file
# gets eRadius and pRadius from a .prj file
def
get_axis
(
file
):
def
get_axis
(
file
):
with
open
(
file
)
as
f
:
with
open
(
file
)
as
f
:
from
collections
import
defaultdict
from
collections
import
defaultdict
files
=
defaultdict
(
list
)
files
=
defaultdict
(
list
)
for
line
in
f
:
for
line
in
f
:
ext
=
line
.
strip
().
split
(
'
'
)
ext
=
line
.
strip
().
split
(
'
'
)
files
[
ext
[
0
]].
append
(
ext
[
-
1
])
files
[
ext
[
0
]].
append
(
ext
[
-
1
])
eRadius
=
float
(
files
[
'
A_EARTH
'
][
0
])
eRadius
=
float
(
files
[
'
A_EARTH
'
][
0
])
pRadius
=
eRadius
*
(
1
-
float
(
files
[
'
E_EARTH
'
][
0
]))
pRadius
=
eRadius
*
(
1
-
float
(
files
[
'
E_EARTH
'
][
0
]))
return
eRadius
,
pRadius
return
eRadius
,
pRadius
# function to convert lat_Y_North to ISIS_lat
# function to convert lat_Y_North to ISIS_lat
def
lat_ISIS_coord
(
record
,
semi_major
,
semi_minor
):
def
lat_ISIS_coord
(
record
,
semi_major
,
semi_minor
):
ocentric_coord
=
og2oc
(
record
[
'
lat_Y_North
'
],
semi_major
,
semi_minor
)
ocentric_coord
=
og2oc
(
record
[
'
lat_Y_North
'
],
semi_major
,
semi_minor
)
coord_360
=
to_360
(
ocentric_coord
)
coord_360
=
to_360
(
ocentric_coord
)
return
coord_360
return
coord_360
# function to convert long_X_East to ISIS_lon
# function to convert long_X_East to ISIS_lon
def
lon_ISIS_coord
(
record
,
semi_major
,
semi_minor
):
def
lon_ISIS_coord
(
record
,
semi_major
,
semi_minor
):
ocentric_coord
=
og2oc
(
record
[
'
long_X_East
'
],
semi_major
,
semi_minor
)
ocentric_coord
=
og2oc
(
record
[
'
long_X_East
'
],
semi_major
,
semi_minor
)
coord_360
=
to_360
(
ocentric_coord
)
coord_360
=
to_360
(
ocentric_coord
)
return
coord_360
return
coord_360
def
body_fix
(
record
,
semi_major
,
semi_minor
,
inverse
=
False
):
def
body_fix
(
record
,
semi_major
,
semi_minor
,
inverse
=
False
):
"""
"""
Parameters
Parameters
----------
----------
record : ndarray
record : ndarray
(n,3) where columns are x, y, height or lon, lat, alt
(n,3) where columns are x, y, height or lon, lat, alt
"""
"""
ecef
=
pyproj
.
Proj
(
proj
=
'
geocent
'
,
a
=
semi_major
,
b
=
semi_minor
)
ecef
=
pyproj
.
Proj
(
proj
=
'
geocent
'
,
a
=
semi_major
,
b
=
semi_minor
)
lla
=
pyproj
.
Proj
(
proj
=
'
latlon
'
,
a
=
semi_major
,
b
=
semi_minor
)
lla
=
pyproj
.
Proj
(
proj
=
'
latlon
'
,
a
=
semi_major
,
b
=
semi_minor
)
if
inverse
:
if
inverse
:
lon
,
lat
,
height
=
pyproj
.
transform
(
ecef
,
lla
,
record
[
0
],
record
[
1
],
record
[
2
])
lon
,
lat
,
height
=
pyproj
.
transform
(
ecef
,
lla
,
record
[
0
],
record
[
1
],
record
[
2
])
return
lon
,
lat
,
height
return
lon
,
lat
,
height
else
:
else
:
y
,
x
,
z
=
pyproj
.
transform
(
lla
,
ecef
,
record
[
0
],
record
[
1
],
record
[
2
])
y
,
x
,
z
=
pyproj
.
transform
(
lla
,
ecef
,
record
[
0
],
record
[
1
],
record
[
2
])
return
y
,
x
,
z
return
y
,
x
,
z
def
ignore_toggle
(
record
):
def
ignore_toggle
(
record
):
if
record
[
'
stat
'
]
==
0
:
if
record
[
'
stat
'
]
==
0
:
return
True
return
True
else
:
else
:
return
False
return
False
# TODO: Does isis cnet need a convariance matrix for sigmas? Even with a static matrix of 1,1,1,1
# TODO: Does isis cnet need a convariance matrix for sigmas? Even with a static matrix of 1,1,1,1
def
compute_sigma_covariance_matrix
(
lat
,
lon
,
rad
,
latsigma
,
lonsigma
,
radsigma
,
semimajor_axis
):
def
compute_sigma_covariance_matrix
(
lat
,
lon
,
rad
,
latsigma
,
lonsigma
,
radsigma
,
semimajor_axis
):
"""
"""
Given geospatial coordinates, desired accuracy sigmas, and an equitorial radius, compute a 2x3
Given geospatial coordinates, desired accuracy sigmas, and an equitorial radius, compute a 2x3
sigma covariange matrix.
sigma covariange matrix.
Parameters
Parameters
----------
----------
lat : float
lat : float
A point
'
s latitude in degrees
A point
'
s latitude in degrees
lon : float
lon : float
A point
'
s longitude in degrees
A point
'
s longitude in degrees
rad : float
rad : float
The radius (z-value) of the point in meters
The radius (z-value) of the point in meters
latsigma : float
latsigma : float
The desired latitude accuracy in meters (Default 10.0)
The desired latitude accuracy in meters (Default 10.0)
lonsigma : float
lonsigma : float
The desired longitude accuracy in meters (Default 10.0)
The desired longitude accuracy in meters (Default 10.0)
radsigma : float
radsigma : float
The desired radius accuracy in meters (Defualt: 15.0)
The desired radius accuracy in meters (Defualt: 15.0)
semimajor_axis : float
semimajor_axis : float
The semi-major or equitorial radius in meters (Default: 1737400.0 - Moon)
The semi-major or equitorial radius in meters (Default: 1737400.0 - Moon)
Returns
Returns
-------
-------
rectcov : ndarray
rectcov : ndarray
(2,3) covariance matrix
(2,3) covariance matrix
"""
"""
lat
=
math
.
radians
(
lat
)
lat
=
math
.
radians
(
lat
)
lon
=
math
.
radians
(
lon
)
lon
=
math
.
radians
(
lon
)
# SetSphericalSigmasDistance
# SetSphericalSigmasDistance
scaled_lat_sigma
=
latsigma
/
semimajor_axis
scaled_lat_sigma
=
latsigma
/
semimajor_axis
# This is specific to each lon.
# This is specific to each lon.
scaled_lon_sigma
=
lonsigma
*
math
.
cos
(
lat
)
/
semimajor_axis
scaled_lon_sigma
=
lonsigma
*
math
.
cos
(
lat
)
/
semimajor_axis
# SetSphericalSigmas
# SetSphericalSigmas
cov
=
np
.
eye
(
3
,
3
)
cov
=
np
.
eye
(
3
,
3
)
cov
[
0
,
0
]
=
scaled_lat_sigma
**
2
cov
[
0
,
0
]
=
scaled_lat_sigma
**
2
cov
[
1
,
1
]
=
scaled_lon_sigma
**
2
cov
[
1
,
1
]
=
scaled_lon_sigma
**
2
cov
[
2
,
2
]
=
radsigma
**
2
cov
[
2
,
2
]
=
radsigma
**
2
# Approximate the Jacobian
# Approximate the Jacobian
j
=
np
.
zeros
((
3
,
3
))
j
=
np
.
zeros
((
3
,
3
))
cosphi
=
math
.
cos
(
lat
)
cosphi
=
math
.
cos
(
lat
)
sinphi
=
math
.
sin
(
lat
)
sinphi
=
math
.
sin
(
lat
)
coslambda
=
math
.
cos
(
lon
)
coslambda
=
math
.
cos
(
lon
)
sinlambda
=
math
.
sin
(
lon
)
sinlambda
=
math
.
sin
(
lon
)
rcosphi
=
rad
*
cosphi
rcosphi
=
rad
*
cosphi
rsinphi
=
rad
*
sinphi
rsinphi
=
rad
*
sinphi
j
[
0
,
0
]
=
-
rsinphi
*
coslambda
j
[
0
,
0
]
=
-
rsinphi
*
coslambda
j
[
0
,
1
]
=
-
rcosphi
*
sinlambda
j
[
0
,
1
]
=
-
rcosphi
*
sinlambda
j
[
0
,
2
]
=
cosphi
*
coslambda
j
[
0
,
2
]
=
cosphi
*
coslambda
j
[
1
,
0
]
=
-
rsinphi
*
sinlambda
j
[
1
,
0
]
=
-
rsinphi
*
sinlambda
j
[
1
,
1
]
=
rcosphi
*
coslambda
j
[
1
,
1
]
=
rcosphi
*
coslambda
j
[
1
,
2
]
=
cosphi
*
sinlambda
j
[
1
,
2
]
=
cosphi
*
sinlambda
j
[
2
,
0
]
=
rcosphi
j
[
2
,
0
]
=
rcosphi
j
[
2
,
1
]
=
0.
j
[
2
,
1
]
=
0.
j
[
2
,
2
]
=
sinphi
j
[
2
,
2
]
=
sinphi
mat
=
j
.
dot
(
cov
)
mat
=
j
.
dot
(
cov
)
mat
=
mat
.
dot
(
j
.
T
)
mat
=
mat
.
dot
(
j
.
T
)
rectcov
=
np
.
zeros
((
2
,
3
))
rectcov
=
np
.
zeros
((
2
,
3
))
rectcov
[
0
,
0
]
=
mat
[
0
,
0
]
rectcov
[
0
,
0
]
=
mat
[
0
,
0
]
rectcov
[
0
,
1
]
=
mat
[
0
,
1
]
rectcov
[
0
,
1
]
=
mat
[
0
,
1
]
rectcov
[
0
,
2
]
=
mat
[
0
,
2
]
rectcov
[
0
,
2
]
=
mat
[
0
,
2
]
rectcov
[
1
,
0
]
=
mat
[
1
,
1
]
rectcov
[
1
,
0
]
=
mat
[
1
,
1
]
rectcov
[
1
,
1
]
=
mat
[
1
,
2
]
rectcov
[
1
,
1
]
=
mat
[
1
,
2
]
rectcov
[
1
,
2
]
=
mat
[
2
,
2
]
rectcov
[
1
,
2
]
=
mat
[
2
,
2
]
return
rectcov
return
np
.
array
(
rectcov
)
# return np.array([[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]])
# return np.array([[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]])
def
compute_cov_matrix
(
record
,
semimajor_axis
):
def
compute_cov_matrix
(
record
,
semimajor_axis
):
cov_matrix
=
compute_sigma_covariance_matrix
(
record
[
'
lat_Y_North
'
],
record
[
'
long_X_East
'
],
record
[
'
ht
'
],
record
[
'
sig0
'
],
record
[
'
sig1
'
],
record
[
'
sig2
'
],
semimajor_axis
)
cov_matrix
=
compute_sigma_covariance_matrix
(
record
[
'
lat_Y_North
'
],
record
[
'
long_X_East
'
],
record
[
'
ht
'
],
record
[
'
sig0
'
],
record
[
'
sig1
'
],
record
[
'
sig2
'
],
semimajor_axis
)
return
cov_matrix
.
ravel
().
tolist
()
return
cov_matrix
.
ravel
().
tolist
()
# applys transformations to columns
# applys transformations to columns
def
apply_transformations
(
atf_dict
,
df
):
def
apply_
two_isis_
transformations
(
atf_dict
,
df
):
prj_file
=
os
.
path
.
join
(
atf_dict
[
'
PATH
'
],
atf_dict
[
'
PROJECT
'
])
prj_file
=
os
.
path
.
join
(
atf_dict
[
'
PATH
'
],
atf_dict
[
'
PROJECT
'
])
eRadius
,
pRadius
=
get_axis
(
prj_file
)
eRadius
,
pRadius
=
get_axis
(
prj_file
)
lla
=
np
.
array
([[
df
[
'
long_X_East
'
]],
[
df
[
'
lat_Y_North
'
]],
[
df
[
'
ht
'
]]])
lla
=
np
.
array
([[
df
[
'
long_X_East
'
]],
[
df
[
'
lat_Y_North
'
]],
[
df
[
'
ht
'
]]])
ecef
=
body_fix
(
lla
,
semi_major
=
eRadius
,
semi_minor
=
pRadius
,
inverse
=
False
)
ecef
=
body_fix
(
lla
,
semi_major
=
eRadius
,
semi_minor
=
pRadius
,
inverse
=
False
)
df
[
'
s.
'
],
df
[
'
l.
'
],
df
[
'
image_index
'
]
=
(
zip
(
*
df
.
apply
(
line_sample_size
,
path
=
atf_dict
[
'
PATH
'
],
axis
=
1
)))
df
[
'
s.
'
],
df
[
'
l.
'
],
df
[
'
image_index
'
]
=
(
zip
(
*
df
.
apply
(
line_sample_size
,
path
=
atf_dict
[
'
PATH
'
],
axis
=
1
)))
df
[
'
known
'
]
=
df
.
apply
(
known
,
axis
=
1
)
df
[
'
known
'
]
=
df
.
apply
(
known
,
axis
=
1
)
df
[
'
long_X_East
'
]
=
ecef
[
0
][
0
]
df
[
'
long_X_East
'
]
=
ecef
[
0
][
0
]
df
[
'
lat_Y_North
'
]
=
ecef
[
1
][
0
]
df
[
'
lat_Y_North
'
]
=
ecef
[
1
][
0
]
df
[
'
ht
'
]
=
ecef
[
2
][
0
]
df
[
'
ht
'
]
=
ecef
[
2
][
0
]
df
[
'
aprioriCovar
'
]
=
df
.
apply
(
compute_cov_matrix
,
semimajor_axis
=
eRadius
,
axis
=
1
)
df
[
'
aprioriCovar
'
]
=
df
.
apply
(
compute_cov_matrix
,
semimajor_axis
=
eRadius
,
axis
=
1
)
df
[
'
ignore
'
]
=
df
.
apply
(
ignore_toggle
,
axis
=
1
)
#
df['ignore'] = df.apply(ignore_toggle, axis=1)
def
socet2isis
(
prj_file
):
def
socet2isis
(
prj_file
):
# Read in and setup the atf dict of information
# Read in and setup the atf dict of information
atf_dict
=
read_atf
(
prj_file
)
atf_dict
=
read_atf
(
prj_file
)
# Get the gpf and ipf files using atf dict
# Get the gpf and ipf files using atf dict
gpf_file
=
os
.
path
.
join
(
atf_dict
[
'
PATH
'
],
atf_dict
[
'
GP_FILE
'
]);
gpf_file
=
os
.
path
.
join
(
atf_dict
[
'
PATH
'
],
atf_dict
[
'
GP_FILE
'
]);
ipf_list
=
[
os
.
path
.
join
(
atf_dict
[
'
PATH
'
],
i
)
for
i
in
atf_dict
[
'
IMAGE_IPF
'
]]
ipf_list
=
[
os
.
path
.
join
(
atf_dict
[
'
PATH
'
],
i
)
for
i
in
atf_dict
[
'
IMAGE_IPF
'
]]
# Read in the gpf file and ipf file(s) into seperate dataframes
# Read in the gpf file and ipf file(s) into seperate dataframes
gpf_df
=
read_gpf
(
gpf_file
)
gpf_df
=
read_gpf
(
gpf_file
)
ipf_df
=
read_ipf
(
ipf_list
)
ipf_df
=
read_ipf
(
ipf_list
)
# Check for differences between point ids using each dataframes
# Check for differences between point ids using each dataframes
# point ids as a reference
# point ids as a reference
gpf_pt_idx
=
pd
.
Index
(
pd
.
unique
(
gpf_df
[
'
point_id
'
]))
gpf_pt_idx
=
pd
.
Index
(
pd
.
unique
(
gpf_df
[
'
point_id
'
]))
ipf_pt_idx
=
pd
.
Index
(
pd
.
unique
(
ipf_df
[
'
pt_id
'
]))
ipf_pt_idx
=
pd
.
Index
(
pd
.
unique
(
ipf_df
[
'
pt_id
'
]))
point_diff
=
ipf_pt_idx
.
difference
(
gpf_pt_idx
)
point_diff
=
ipf_pt_idx
.
difference
(
gpf_pt_idx
)
if
len
(
point_diff
)
!=
0
:
if
len
(
point_diff
)
!=
0
:
warnings
.
warn
(
"
The following points found in ipf files missing from gpf file:
\n\n
{}.
\
warnings
.
warn
(
"
The following points found in ipf files missing from gpf file:
\n\n
{}.
\
\n\n
Continuing, but these points will be missing from the control network
"
.
format
(
list
(
point_diff
)))
\n\n
Continuing, but these points will be missing from the control network
"
.
format
(
list
(
point_diff
)))
# Merge the two dataframes on their point id columns
# Merge the two dataframes on their point id columns
socet_df
=
ipf_df
.
merge
(
gpf_df
,
left_on
=
'
pt_id
'
,
right_on
=
'
point_id
'
)
socet_df
=
ipf_df
.
merge
(
gpf_df
,
left_on
=
'
pt_id
'
,
right_on
=
'
point_id
'
)
# Apply the transformations
# Apply the transformations
apply_transformations
(
atf_dict
,
socet_df
)
#
apply_
two_isis_
transformations(atf_dict, socet_df)
# Define column remap for socet dataframe
# Define column remap for socet dataframe
column_
re
map
=
{
'
l.
'
:
'
y
'
,
'
s.
'
:
'
x
'
,
#
column_map = {
'pt_id': 'id',
'l.': 'y', 's.': 'x',
'
res_l
'
:
'
lineResidual
'
,
'
res_s
'
:
'
sampleResidual
'
,
'
known
'
:
'
Type
'
,
#
'res_l': 'lineResidual', 'res_s': 'sampleResidual', 'known': 'Type',
'
lat_Y_North
'
:
'
A
prioriY
'
,
'
long_X_East
'
:
'
A
prioriX
'
,
'
ht
'
:
'
A
prioriZ
'
,
#
'lat_Y_North': '
a
prioriY', 'long_X_East': '
a
prioriX', 'ht': '
a
prioriZ',
'
sig0
'
:
'
A
prioriLatitudeSigma
'
,
'
sig1
'
:
'
A
prioriLongitudeSigma
'
,
'
sig2
'
:
'
A
prioriRadiusSigma
'
,
#
'sig0': '
a
prioriLatitudeSigma', 'sig1': '
a
prioriLongitudeSigma', 'sig2': '
a
prioriRadiusSigma',
'
sig_l
'
:
'
linesigma
'
,
'
sig_s
'
:
'
samplesigma
'
}
#
'sig_l': 'linesigma', 'sig_s': 'samplesigma'}
# Rename the columns using the column remap above
# Rename the columns using the column remap above
socet_df
.
rename
(
columns
=
column_
re
map
,
inplace
=
True
)
#
socet_df.rename(columns = column_map, inplace=True)
# Return the socet dataframe to be converted to a control net
# Return the socet dataframe to be converted to a control net
return
socet_df
return
socet_df
# creates a dict of serial numbers with the cub being the key
# creates a dict of serial numbers with the cub being the key
def
serial_numbers
(
images
,
path
,
extension
):
def
serial_numbers
(
images
,
path
,
extension
):
serial_dict
=
dict
()
serial_dict
=
dict
()
for
image
in
images
:
for
image
in
images
:
snum
=
sn
.
generate_serial_number
(
os
.
path
.
join
(
path
,
image
+
extension
))
snum
=
sn
.
generate_serial_number
(
os
.
path
.
join
(
path
,
image
+
extension
))
snum
=
snum
.
replace
(
'
Mars_Reconnaissance_Orbiter
'
,
'
MRO
'
)
snum
=
snum
.
replace
(
'
Mars_Reconnaissance_Orbiter
'
,
'
MRO
'
)
serial_dict
[
image
]
=
snum
serial_dict
[
image
]
=
snum
return
serial_dict
return
serial_dict
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
# Setup stuffs for the cub information namely the path and extension
# Setup stuffs for the cub information namely the path and extension
path
=
'
/
path/where/cub/files/are/
'
path
=
'
/
home/acpaquette/repos/plio/test_cubes
'
targetname
=
'
Mars
'
# Extension of your cub files
# Extension of your cub files
extension
=
'
.
something
.cub
'
extension
=
'
.
8bit
.cub
'
# Path to atf file
# Path to atf file
atf_file
=
(
'
/
path/to/atf/file
'
)
atf_file
=
(
'
/
home/acpaquette/repos/plio/plio/examples/SocetSet/Relative.atf
'
)
socet_df
=
socet2isis
(
atf_file
)
socet_df
=
socet2isis
(
atf_file
)
images
=
pd
.
unique
(
socet_df
[
'
ipf_file
'
])
#
images = pd.unique(socet_df['ipf_file'])
serial_dict
=
serial_numbers
(
images
,
path
,
extension
)
#
serial_dict = serial_numbers(images, path, extension)
# creates the control network
# creates the control network
cn
.
to_isis
(
'
/
path/you/want/the/cnet/to/be/in
/cn.net
'
,
socet_df
,
serial_dict
)
#
cn.to_isis('/
home/acpaquette/repos/plio/plio/examples/SocetSet
/cn.net', socet_df, serial_dict
, targetname = targetname
)
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
return_df
=
cn
.
from_isis
(
"
/home/acpaquette/repos/plio/plio/examples/SocetSet/cn.net
"
)
columns
=
[]
column_index
=
[]
for
i
,
column
in
enumerate
(
list
(
return_df
.
columns
)):
if
column
not
in
columns
:
column_index
.
append
(
i
)
columns
.
append
(
column
)
return_df
=
return_df
.
iloc
[:,
column_index
]
```
%% Cell type:code id: tags:
```
python
column_map
=
{
'
pt_id
'
:
'
id
'
,
'
l.
'
:
'
y
'
,
'
s.
'
:
'
x
'
,
'
res_l
'
:
'
lineResidual
'
,
'
res_s
'
:
'
sampleResidual
'
,
'
known
'
:
'
Type
'
,
'
lat_Y_North
'
:
'
aprioriY
'
,
'
long_X_East
'
:
'
aprioriX
'
,
'
ht
'
:
'
aprioriZ
'
,
'
sig0
'
:
'
aprioriLatitudeSigma
'
,
'
sig1
'
:
'
aprioriLongitudeSigma
'
,
'
sig2
'
:
'
aprioriRadiusSigma
'
,
'
sig_l
'
:
'
linesigma
'
,
'
sig_s
'
:
'
samplesigma
'
}
column_map
=
{
k
:
v
for
v
,
k
in
column_map
.
items
()}
return_df
.
rename
(
columns
=
column_map
,
inplace
=
True
)
return_df
.
drop
([
'
chooserName
'
,
'
datetime
'
,
'
referenceIndex
'
,
'
jigsawRejected
'
,
'
editLock
'
,
'
aprioriSurfPointSource
'
,
'
aprioriSurfPointSourceFile
'
,
'
aprioriRadiusSource
'
,
'
aprioriRadiusSourceFile
'
]
,
axis
=
1
,
inplace
=
True
)
```
%% Cell type:code id: tags:
```
python
return_df
[[
'
lat_Y_North
'
,
'
long_X_East
'
,
'
ht
'
]]
```
%% Output
lat_Y_North long_X_East ht
0 139525.230749 3.390974e+06 4506.496945
1 139525.230749 3.390974e+06 4506.496945
2 139489.278045 3.390969e+06 4516.454802
3 139489.278045 3.390969e+06 4516.454802
4 139823.489797 3.390990e+06 4536.274914
5 139823.489797 3.390990e+06 4536.274914
6 139772.738004 3.390936e+06 4518.050219
7 139772.738004 3.390936e+06 4518.050219
8 139575.914815 3.390952e+06 3816.666542
9 139575.914815 3.390952e+06 3816.666542
10 139614.756296 3.390953e+06 3791.232717
11 139614.756296 3.390953e+06 3791.232717
12 139912.041374 3.390914e+06 3875.608660
13 139912.041374 3.390914e+06 3875.608660
14 139909.452033 3.390930e+06 3845.361327
15 139909.452033 3.390930e+06 3845.361327
16 139669.826849 3.391120e+06 3270.672620
17 139669.826849 3.391120e+06 3270.672620
18 139694.517017 3.391205e+06 3289.744506
19 139694.517017 3.391205e+06 3289.744506
20 139968.793338 3.391126e+06 3274.711397
21 139968.793338 3.391126e+06 3274.711397
22 139979.200780 3.391138e+06 3298.297228
23 139979.200780 3.391138e+06 3298.297228
24 139688.031217 3.391041e+06 4253.956077
25 139688.031217 3.391041e+06 4253.956077
26 139686.910823 3.391089e+06 4216.743792
27 139686.910823 3.391089e+06 4216.743792
28 139786.205284 3.390979e+06 3579.127600
29 139786.205284 3.390979e+06 3579.127600
30 139785.010997 3.391002e+06 3546.549796
31 139785.010997 3.391002e+06 3546.549796
%% Cell type:code id: tags:
```
python
socet_df
[[
'
lat_Y_North
'
,
'
long_X_East
'
,
'
ht
'
]]
```
%% Output
lat_Y_North long_X_East ht
0 0.095708 2.356167 -2342.889214
1 0.095708 2.356167 -2342.889214
2 0.095920 2.355564 -2349.638414
3 0.095920 2.355564 -2349.638414
4 0.096339 2.361186 -2314.316425
5 0.096339 2.361186 -2314.316425
6 0.095954 2.360368 -2370.502882
7 0.095954 2.360368 -2370.502882
8 0.081058 2.357037 -2363.989968
9 0.081058 2.357037 -2363.989968
10 0.080518 2.357691 -2360.922571
11 0.080518 2.357691 -2360.922571
12 0.082311 2.362733 -2388.123298
13 0.082311 2.362733 -2388.123298
14 0.081668 2.362678 -2371.973499
15 0.081668 2.362678 -2371.973499
16 0.069458 2.358505 -2193.309629
17 0.069458 2.358505 -2193.309629
18 0.069861 2.358862 -2106.769773
19 0.069861 2.358862 -2106.769773
20 0.069543 2.363543 -2174.971745
21 0.069543 2.363543 -2174.971745
22 0.070044 2.363710 -2162.103231
23 0.070044 2.363710 -2162.103231
24 0.090342 2.358866 -2269.610862
25 0.090342 2.358866 -2269.610862
26 0.089550 2.358814 -2222.328983
27 0.089550 2.358814 -2222.328983
28 0.076012 2.360565 -2328.281125
29 0.076012 2.360565 -2328.281125
30 0.075320 2.360529 -2305.362047
31 0.075320 2.360529 -2305.362047
%% Cell type:code id: tags:
```
python
```
```
...
...
This diff is collapsed.
Click to expand it.
plio/io/io_controlnetwork.py
+
1
−
0
View file @
b4b37c37
...
@@ -187,6 +187,7 @@ class IsisStore(object):
...
@@ -187,6 +187,7 @@ class IsisStore(object):
header_bytes
=
find_in_dict
(
pvl_header
,
'
HeaderBytes
'
)
header_bytes
=
find_in_dict
(
pvl_header
,
'
HeaderBytes
'
)
point_start_byte
=
find_in_dict
(
pvl_header
,
'
PointsStartByte
'
)
point_start_byte
=
find_in_dict
(
pvl_header
,
'
PointsStartByte
'
)
version
=
find_in_dict
(
pvl_header
,
'
Version
'
)
version
=
find_in_dict
(
pvl_header
,
'
Version
'
)
if
version
==
2
:
if
version
==
2
:
point_attrs
=
[
i
for
i
in
cnf
.
_CONTROLPOINTFILEENTRYV0002
.
fields_by_name
if
i
!=
'
measures
'
]
point_attrs
=
[
i
for
i
in
cnf
.
_CONTROLPOINTFILEENTRYV0002
.
fields_by_name
if
i
!=
'
measures
'
]
measure_attrs
=
[
i
for
i
in
cnf
.
_CONTROLPOINTFILEENTRYV0002_MEASURE
.
fields_by_name
]
measure_attrs
=
[
i
for
i
in
cnf
.
_CONTROLPOINTFILEENTRYV0002_MEASURE
.
fields_by_name
]
...
...
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