Skip to content
Snippets Groups Projects
Commit 3bc7fdc4 authored by Tyler Thatcher's avatar Tyler Thatcher
Browse files

Removed Test

parent 1367aff6
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags:
``` python
import os
import numpy as np
from plio.examples import get_path
# Reads a .atf file and outputs all of the
# .ipf, .gpf, .sup, .prj, and path to locate the
# .apf file (should be the same as all others)
def read_atf(atf_file):
with open(get_path(atf_file)) as f:
atf_file = get_path(atf_file);
files = []
ipf = []
sup = []
files_dict = []
# Grabs every PRJ, GPF, SUP, and IPF image from the ATF file
for line in f:
if line[-4:-1] == 'prj' or line[-4:-1] == 'gpf' or line[-4:-1] == 'sup' or line[-4:-1] == 'ipf' or line[-4:-1] == 'atf':
files.append(line)
files = np.array(files)
# Creates appropriate arrays for certain files in the right format
for file in files:
file = file.strip()
file = file.split(' ')
# Grabs all the IPF files
if file[1].endswith('.ipf'):
ipf.append(file[1])
# Grabs all the SUP files
if file[1].endswith('.sup'):
sup.append(file[1])
files_dict.append(file)
# Creates a dict out of file lists for GPF, PRJ, IPF, and ATF
files_dict = (dict(files_dict))
# Sets the value of IMAGE_IPF to all IPF images
files_dict['IMAGE_IPF'] = ipf
# Sets the value of IMAGE_SUP to all SUP images
files_dict['IMAGE_SUP'] = sup
# Sets the value of PATH to the path of the ATF file
files_dict['PATH'] = os.path.dirname(os.path.abspath(atf_file))
return files_dict
read_atf('CTX_Athabasca_Middle_step0.atf')
```
%% Output
{'ATF_FILE': 'CTX_Athabasca_Middle_step0.atf',
'GP_FILE': 'CTX_Athabasca_Middle.gpf',
'IMAGE_IPF': ['P19_008344_1894_XN_09N203W.ipf',
'P20_008845_1894_XN_09N203W.ipf',
'P03_002371_1888_XI_08N204W.ipf',
'P01_001540_1889_XI_08N204W.ipf',
'P01_001606_1897_XI_09N203W.ipf',
'P03_002226_1895_XI_09N203W.ipf'],
'IMAGE_SUP': ['P19_008344_1894_XN_09N203W.sup',
'P20_008845_1894_XN_09N203W.sup',
'P03_002371_1888_XI_08N204W.sup',
'P01_001540_1889_XI_08N204W.sup',
'P01_001606_1897_XI_09N203W.sup',
'P03_002226_1895_XI_09N203W.sup'],
'PATH': '/home/tthatcher/Desktop/Projects/Plio/plio/plio/examples/SocetSet',
'PROJECT': 'D:\\data\\CTX_Athabasca_Middle.prj'}
%% Cell type:code id: tags:
``` python
import os
import sys
import math
sys.path.insert(0, os.path.abspath('/home/tthatcher/Desktop/Projects/Plio/plio'))
import pandas as pd
import numpy as np
from plio.examples import get_path
from plio.io.io_bae import read_gpf
from plio.io.io_gdal import GeoDataset
```
%% Cell type:code id: tags:
``` python
def read_ipf(input_data):
"""
Read a socet ipf file into a pandas data frame
Parameters
----------
input_data : str
path to the an input data file
Returns
-------
df : pd.DataFrame
containing the ipf data with appropriate column names and indices
"""
# Check that the number of rows is matching the expected number
with open(input_data, 'r') as f:
for i, l in enumerate(f):
if i == 1:
cnt = int(l)
elif i == 2:
col = l
break
# TODO: Add unicode conversion
d = [line.split() for line in open(input_data, 'r')]
d = np.hstack(np.array(d[3:]))
d = d.reshape(-1, 12)
assert int(cnt) == len(d), 'Dataframe length {} does not match point length {}.'.format(int(cnt), len(df))
return d
def read_ipfs(input_data_list):
"""
Read a socet ipf file into a pandas data frame
Parameters
----------
input_data_list : list
list of paths to the a set of input data files
Returns
-------
df : pd.DataFrame
containing the ipf data with appropriate column names and indices
"""
columns = np.genfromtxt(input_data_list[0], skip_header=2, dtype='unicode',
max_rows = 1, delimiter = ',')
d_total = []
for input_file in input_data_list:
d = read_ipf(input_file)
for point in d:
d_total.append(point)
df = pd.DataFrame(d_total, columns=columns)
# Soft conversion of numeric types to numerics, allows str in first col for point_id
df = df.apply(pd.to_numeric, errors='ignore')
return df
```
%% Cell type:code id: tags:
``` python
gpf_file = get_path('CTX_Athabasca_Middle.gpf');
ipf_list = [get_path('P20_008845_1894_XN_09N203W.ipf'),
get_path('P03_002371_1888_XI_08N204W.ipf'),
get_path('P01_001540_1889_XI_08N204W.ipf'),
get_path('P01_001606_1897_XI_09N203W.ipf'),
get_path('P03_002226_1895_XI_09N203W.ipf'),]
# ipf_list = [get_path('P20_008845_1894_XN_09N203W.ipf')]
print(ipf_list)
gpf_df = read_gpf(gpf_file).set_index('point_id')
ipf_df = read_ipfs(ipf_list).set_index('pt_id')
# ipf_df.to_csv("/Users/adampaquette/repos/plio/plio/examples/SocetSet/P20_008845_1894_XN_09N203W.csv")
```
%% Output
['/home/tthatcher/Desktop/Projects/Plio/plio/plio/examples/SocetSet/P20_008845_1894_XN_09N203W.ipf', '/home/tthatcher/Desktop/Projects/Plio/plio/plio/examples/SocetSet/P03_002371_1888_XI_08N204W.ipf', '/home/tthatcher/Desktop/Projects/Plio/plio/plio/examples/SocetSet/P01_001540_1889_XI_08N204W.ipf', '/home/tthatcher/Desktop/Projects/Plio/plio/plio/examples/SocetSet/P01_001606_1897_XI_09N203W.ipf', '/home/tthatcher/Desktop/Projects/Plio/plio/plio/examples/SocetSet/P03_002226_1895_XI_09N203W.ipf']
%% Cell type:code id: tags:
``` python
new_df = ipf_df.merge(gpf_df, left_index=True, right_index=True)
# print(new_df.columns)
new_df.index('')
```
%% Output
val fid_val no_obs l. s. \
10_8344_8845_4r 1 0 0 -4044.697510 1008.950928
10_8344_8845_4r 1 0 0 1700.584473 -2390.001709
10_8344_8845_4r 1 0 0 2006.141113 -2234.915283
11_8344_8845_4r 1 0 0 -761.216064 2303.787109
11_8344_8845_4r 1 0 0 4985.437988 -1070.364990
11_8344_8845_4r 1 0 0 5293.700195 -993.390625
12_8344_8845_4r 1 0 0 -889.364441 966.533997
12_8344_8845_4r 1 0 0 4856.525391 -2439.154785
12_8344_8845_4r 1 0 0 5158.205566 -2295.737549
13_8344_8845_4r 1 0 0 -2559.871338 1777.522827
13_8344_8845_4r 1 0 0 3186.063232 -1598.743530
13_8344_8845_4r 1 0 0 3493.876221 -1493.029175
14_8344_8845_4r 1 0 0 2385.278320 2476.032227
14_8344_8845_4r 1 0 0 8131.361816 -902.645325
14_8344_8845_4r 1 0 0 8437.115234 -842.309326
15_8344_8845_4r_mt_z 1 0 0 2395.869385 1038.165405
15_8344_8845_4r_mt_z 1 0 0 8142.054688 -2364.445557
15_8344_8845_4r_mt_z 1 0 0 8440.085938 -2219.049805
16_8344_8845_4r 1 0 0 756.099792 1785.494751
16_8344_8845_4r 1 0 0 6502.070313 -1593.964233
16_8344_8845_4r 1 0 0 6805.896973 -1493.774048
17_8344_8845_2r_mt_z 1 0 0 -3138.269531 442.515503
18_8344_8845_2r 1 0 0 -1773.864990 354.084259
19_8344_8845_2r_mt_z 1 0 0 -92.482826 723.305237
1_8344_8845_4r 1 0 0 -4058.982422 -2318.010742
1_8344_8845_4r 1 0 0 -6144.898438 677.674805
1_8344_8845_4r 1 0 0 -5284.357910 504.304413
20_8344_8845_2r_mt_z 1 0 0 1434.079712 742.064026
21_8344_8845_4r_xyz 1 0 0 -838.991028 -614.524109
21_8344_8845_4r_xyz 1 0 0 -2919.093018 2467.773926
... ... ... ... ... ...
P20_008845_1894_XN_09N203W_16 1 0 2 2865.000000 2024.000000
P20_008845_1894_XN_09N203W_16 1 0 1 8611.724609 -1352.647949
P20_008845_1894_XN_09N203W_16 1 0 1 8914.713867 -1261.989868
P20_008845_1894_XN_09N203W_17 1 0 2 3175.000000 1974.000000
P20_008845_1894_XN_09N203W_17 1 0 1 8921.941406 -1402.745361
P20_008845_1894_XN_09N203W_17 1 0 1 9224.031250 -1309.074219
P20_008845_1894_XN_09N203W_18 1 0 2 2872.000000 1565.000000
P20_008845_1894_XN_09N203W_18 1 0 1 8617.777344 -1818.614380
P20_008845_1894_XN_09N203W_18 1 0 1 8918.806641 -1701.755249
P20_008845_1894_XN_09N203W_2 1 0 0 -3389.000000 -2155.000000
P20_008845_1894_XN_09N203W_2 1 0 1 -5474.326660 842.207031
P20_008845_1894_XN_09N203W_2 1 0 0 -4613.785645 643.217224
P20_008845_1894_XN_09N203W_3 1 0 0 -2913.000000 -2000.000000
P20_008845_1894_XN_09N203W_3 1 0 1 -4997.791504 1000.375854
P20_008845_1894_XN_09N203W_3 1 0 0 -4137.536133 774.480347
P20_008845_1894_XN_09N203W_4 1 0 1 -3226.000000 167.000000
P20_008845_1894_XN_09N203W_5 1 0 1 -2934.000000 -6.000000
P20_008845_1894_XN_09N203W_5 1 0 0 -4165.228516 2507.076660
P20_008845_1894_XN_09N203W_6 1 0 3 -3378.000000 1532.000000
P20_008845_1894_XN_09N203W_6 1 0 1 2367.587646 -1849.272095
P20_008845_1894_XN_09N203W_6 1 0 1 2675.137207 -1730.558105
P20_008845_1894_XN_09N203W_7 1 0 3 -3378.000000 1672.000000
P20_008845_1894_XN_09N203W_7 1 0 1 2367.507813 -1706.241821
P20_008845_1894_XN_09N203W_7 1 0 1 2675.892578 -1596.527100
P20_008845_1894_XN_09N203W_8 1 0 3 -2793.000000 1837.000000
P20_008845_1894_XN_09N203W_8 1 0 1 2953.094727 -1538.956543
P20_008845_1894_XN_09N203W_8 1 0 1 3261.290039 -1439.873169
P20_008845_1894_XN_09N203W_9 1 0 0 -780.000000 -1953.000000
P20_008845_1894_XN_09N203W_9 1 0 0 -2866.689453 1031.006104
P20_008845_1894_XN_09N203W_9 1 0 0 -2002.366211 824.604126
sig_l sig_s res_l res_s fid_x \
10_8344_8845_4r 0.000000 0.000000 0.063678 0.661294 0.0
10_8344_8845_4r 0.000000 0.000000 -0.063695 -1.055619 0.0
10_8344_8845_4r 0.000000 0.000000 0.318779 -0.585138 0.0
11_8344_8845_4r 0.000000 0.000000 -0.247307 -0.587299 0.0
11_8344_8845_4r 0.000000 0.000000 0.239207 1.080801 0.0
11_8344_8845_4r 0.000000 0.000000 0.672877 0.626316 0.0
12_8344_8845_4r 0.000000 0.000000 -0.251753 0.008170 0.0
12_8344_8845_4r 0.000000 0.000000 0.133406 0.068024 0.0
12_8344_8845_4r 0.000000 0.000000 0.487209 0.036399 0.0
13_8344_8845_4r 0.000000 0.000000 -0.131265 -0.305102 0.0
13_8344_8845_4r 0.000000 0.000000 0.019201 0.485372 0.0
13_8344_8845_4r 0.000000 0.000000 0.568393 0.146750 0.0
14_8344_8845_4r 0.000000 0.000000 0.389532 -0.299258 0.0
14_8344_8845_4r 0.000000 0.000000 -0.469784 0.023018 0.0
14_8344_8845_4r 0.000000 0.000000 0.289877 -0.829150 0.0
15_8344_8845_4r_mt_z 0.000000 0.000000 -0.170850 0.372485 0.0
15_8344_8845_4r_mt_z 0.000000 0.000000 -0.072035 -0.832436 0.0
15_8344_8845_4r_mt_z 0.000000 0.000000 0.274030 -0.850105 0.0
16_8344_8845_4r 0.000000 0.000000 0.165338 -0.327408 0.0
16_8344_8845_4r 0.000000 0.000000 -0.007916 0.463232 0.0
16_8344_8845_4r 0.000000 0.000000 0.328896 0.019526 0.0
17_8344_8845_2r_mt_z 0.000000 0.000000 -0.023370 -0.248643 0.0
18_8344_8845_2r 0.000000 0.000000 -0.002223 -0.000684 0.0
19_8344_8845_2r_mt_z 0.000000 0.000000 -0.214498 0.145192 0.0
1_8344_8845_4r 0.000000 0.000000 -0.062556 -0.214713 0.0
1_8344_8845_4r 0.000000 0.000000 -0.069161 0.311984 0.0
1_8344_8845_4r 0.000000 0.000000 0.002209 0.194239 0.0
20_8344_8845_2r_mt_z 0.000000 0.000000 -0.058132 -0.171782 0.0
21_8344_8845_4r_xyz 0.000000 0.000000 -0.131313 0.997120 0.0
21_8344_8845_4r_xyz 0.000000 0.000000 -0.469767 -0.745137 0.0
... ... ... ... ... ...
P20_008845_1894_XN_09N203W_16 0.000000 0.000000 -0.053859 0.035981 0.0
P20_008845_1894_XN_09N203W_16 0.015722 0.015722 -0.153906 -0.039881 0.0
P20_008845_1894_XN_09N203W_16 0.023530 0.023530 0.691574 -0.075730 0.0
P20_008845_1894_XN_09N203W_17 0.000000 0.000000 -0.064058 0.044374 0.0
P20_008845_1894_XN_09N203W_17 0.017650 0.017650 -0.016220 -0.049595 0.0
P20_008845_1894_XN_09N203W_17 0.030802 0.030802 0.567955 -0.078411 0.0
P20_008845_1894_XN_09N203W_18 0.000000 0.000000 0.256228 0.218860 0.0
P20_008845_1894_XN_09N203W_18 0.114295 0.114295 -0.500861 -0.252638 0.0
P20_008845_1894_XN_09N203W_18 0.022017 0.022017 0.734173 -0.074947 0.0
P20_008845_1894_XN_09N203W_2 0.000000 0.000000 -0.073150 -0.271173 0.0
P20_008845_1894_XN_09N203W_2 0.275627 0.275627 0.164525 0.349547 0.0
P20_008845_1894_XN_09N203W_2 0.091086 0.091086 0.132736 0.239899 0.0
P20_008845_1894_XN_09N203W_3 0.000000 0.000000 -0.088180 -0.049593 0.0
P20_008845_1894_XN_09N203W_3 0.132941 0.132941 0.257260 0.117777 0.0
P20_008845_1894_XN_09N203W_3 0.185544 0.185544 0.199301 0.065777 0.0
P20_008845_1894_XN_09N203W_4 0.000000 0.000000 -0.195774 -0.000066 0.0
P20_008845_1894_XN_09N203W_5 0.000000 0.000000 -0.049005 0.437424 0.0
P20_008845_1894_XN_09N203W_5 0.000000 0.000000 0.447100 -0.219764 0.0
P20_008845_1894_XN_09N203W_6 0.000000 0.000000 0.026541 0.063346 0.0
P20_008845_1894_XN_09N203W_6 0.025110 0.025110 -0.040890 -0.136247 0.0
P20_008845_1894_XN_09N203W_6 0.064276 0.064276 0.546035 -0.185103 0.0
P20_008845_1894_XN_09N203W_7 0.000000 0.000000 0.055623 0.013456 0.0
P20_008845_1894_XN_09N203W_7 0.047435 0.047435 -0.157931 -0.042074 0.0
P20_008845_1894_XN_09N203W_7 0.058218 0.058218 0.589561 -0.111421 0.0
P20_008845_1894_XN_09N203W_8 0.000000 0.000000 -0.117483 -0.229337 0.0
P20_008845_1894_XN_09N203W_8 0.023364 0.023364 0.177406 0.403161 0.0
P20_008845_1894_XN_09N203W_8 0.023538 0.023538 0.575510 0.180705 0.0
P20_008845_1894_XN_09N203W_9 0.000000 0.000000 0.298743 -0.045963 0.0
P20_008845_1894_XN_09N203W_9 0.000000 0.000000 -0.038437 0.471309 0.0
P20_008845_1894_XN_09N203W_9 0.397616 0.397616 -0.141172 0.105223 0.0
... known lat_Y_North long_X_East \
10_8344_8845_4r ... 0 0.159378 2.724649
10_8344_8845_4r ... 0 0.159378 2.724649
10_8344_8845_4r ... 0 0.159378 2.724649
11_8344_8845_4r ... 0 0.164905 2.721815
11_8344_8845_4r ... 0 0.164905 2.721815
11_8344_8845_4r ... 0 0.164905 2.721815
12_8344_8845_4r ... 0 0.164949 2.724076
12_8344_8845_4r ... 0 0.164949 2.724076
12_8344_8845_4r ... 0 0.164949 2.724076
13_8344_8845_4r ... 0 0.161840 2.723059
13_8344_8845_4r ... 0 0.161840 2.723059
13_8344_8845_4r ... 0 0.161840 2.723059
14_8344_8845_4r ... 0 0.170415 2.720880
14_8344_8845_4r ... 0 0.170415 2.720880
14_8344_8845_4r ... 0 0.170415 2.720880
15_8344_8845_4r_mt_z ... 1 0.170723 2.723266
15_8344_8845_4r_mt_z ... 1 0.170723 2.723266
15_8344_8845_4r_mt_z ... 1 0.170723 2.723266
16_8344_8845_4r ... 0 0.167682 2.722359
16_8344_8845_4r ... 0 0.167682 2.722359
16_8344_8845_4r ... 0 0.167682 2.722359
17_8344_8845_2r_mt_z ... 1 0.161092 2.725426
18_8344_8845_2r ... 0 0.163515 2.725299
19_8344_8845_2r_mt_z ... 1 0.166403 2.724323
1_8344_8845_4r ... 0 0.160037 2.730339
1_8344_8845_4r ... 0 0.160037 2.730339
1_8344_8845_4r ... 0 0.160037 2.730339
20_8344_8845_2r_mt_z ... 1 0.169088 2.723969
21_8344_8845_4r_xyz ... 3 0.165360 2.726740
21_8344_8845_4r_xyz ... 3 0.165360 2.726740
... ... ... ... ...
P20_008845_1894_XN_09N203W_16 ... 0 0.171351 2.721519
P20_008845_1894_XN_09N203W_16 ... 0 0.171351 2.721519
P20_008845_1894_XN_09N203W_16 ... 0 0.171351 2.721519
P20_008845_1894_XN_09N203W_17 ... 0 0.171907 2.721537
P20_008845_1894_XN_09N203W_17 ... 0 0.171907 2.721537
P20_008845_1894_XN_09N203W_17 ... 0 0.171907 2.721537
P20_008845_1894_XN_09N203W_18 ... 0 0.171455 2.722281
P20_008845_1894_XN_09N203W_18 ... 0 0.171455 2.722281
P20_008845_1894_XN_09N203W_18 ... 0 0.171455 2.722281
P20_008845_1894_XN_09N203W_2 ... 0 0.161184 2.729925
P20_008845_1894_XN_09N203W_2 ... 0 0.161184 2.729925
P20_008845_1894_XN_09N203W_2 ... 0 0.161184 2.729925
P20_008845_1894_XN_09N203W_3 ... 0 0.161992 2.729563
P20_008845_1894_XN_09N203W_3 ... 0 0.161992 2.729563
P20_008845_1894_XN_09N203W_3 ... 0 0.161992 2.729563
P20_008845_1894_XN_09N203W_4 ... 0 0.160994 2.725912
P20_008845_1894_XN_09N203W_5 ... 0 0.161544 2.726149
P20_008845_1894_XN_09N203W_5 ... 0 0.161544 2.726149
P20_008845_1894_XN_09N203W_6 ... 0 0.160447 2.723639
P20_008845_1894_XN_09N203W_6 ... 0 0.160447 2.723639
P20_008845_1894_XN_09N203W_6 ... 0 0.160447 2.723639
P20_008845_1894_XN_09N203W_7 ... 0 0.160419 2.723407
P20_008845_1894_XN_09N203W_7 ... 0 0.160419 2.723407
P20_008845_1894_XN_09N203W_7 ... 0 0.160419 2.723407
P20_008845_1894_XN_09N203W_8 ... 0 0.161417 2.723012
P20_008845_1894_XN_09N203W_8 ... 0 0.161417 2.723012
P20_008845_1894_XN_09N203W_8 ... 0 0.161417 2.723012
P20_008845_1894_XN_09N203W_9 ... 0 0.165741 2.729053
P20_008845_1894_XN_09N203W_9 ... 0 0.165741 2.729053
P20_008845_1894_XN_09N203W_9 ... 0 0.165741 2.729053
ht sigma0 sigma1 sigma2 \
10_8344_8845_4r -2523.828227 0.0 0.0 25.000000
10_8344_8845_4r -2523.828227 0.0 0.0 25.000000
10_8344_8845_4r -2523.828227 0.0 0.0 25.000000
11_8344_8845_4r -2445.237027 0.0 0.0 30.000000
11_8344_8845_4r -2445.237027 0.0 0.0 30.000000
11_8344_8845_4r -2445.237027 0.0 0.0 30.000000
12_8344_8845_4r -2606.935163 0.0 0.0 100.000000
12_8344_8845_4r -2606.935163 0.0 0.0 100.000000
12_8344_8845_4r -2606.935163 0.0 0.0 100.000000
13_8344_8845_4r -2551.901554 0.0 0.0 4.536068
13_8344_8845_4r -2551.901554 0.0 0.0 4.536068
13_8344_8845_4r -2551.901554 0.0 0.0 4.536068
14_8344_8845_4r -2505.953426 0.0 0.0 5.000000
14_8344_8845_4r -2505.953426 0.0 0.0 5.000000
14_8344_8845_4r -2505.953426 0.0 0.0 5.000000
15_8344_8845_4r_mt_z -2502.470000 0.0 0.0 5.000000
15_8344_8845_4r_mt_z -2502.470000 0.0 0.0 5.000000
15_8344_8845_4r_mt_z -2502.470000 0.0 0.0 5.000000
16_8344_8845_4r -2558.312931 0.0 0.0 1.707214
16_8344_8845_4r -2558.312931 0.0 0.0 1.707214
16_8344_8845_4r -2558.312931 0.0 0.0 1.707214
17_8344_8845_2r_mt_z -2590.130000 0.0 0.0 2.000000
18_8344_8845_2r -2608.227033 0.0 0.0 1.000000
19_8344_8845_2r_mt_z -2597.460000 0.0 0.0 2.000000
1_8344_8845_4r -2539.150747 0.0 0.0 4.000000
1_8344_8845_4r -2539.150747 0.0 0.0 4.000000
1_8344_8845_4r -2539.150747 0.0 0.0 4.000000
20_8344_8845_2r_mt_z -2522.470000 0.0 0.0 2.000000
21_8344_8845_4r_xyz -2209.490000 2.0 2.0 1.000000
21_8344_8845_4r_xyz -2209.490000 2.0 2.0 1.000000
... ... ... ... ...
P20_008845_1894_XN_09N203W_16 -2499.843797 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_16 -2499.843797 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_16 -2499.843797 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_17 -2504.618390 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_17 -2504.618390 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_17 -2504.618390 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_18 -2514.431453 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_18 -2514.431453 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_18 -2514.431453 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_2 -2535.712262 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_2 -2535.712262 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_2 -2535.712262 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_3 -2525.215515 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_3 -2525.215515 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_3 -2525.215515 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_4 -2562.446851 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_5 -2560.812028 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_5 -2560.812028 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_6 -2605.266130 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_6 -2605.266130 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_6 -2605.266130 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_7 -2619.498291 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_7 -2619.498291 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_7 -2619.498291 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_8 -2608.028730 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_8 -2608.028730 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_8 -2608.028730 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_9 -2586.686862 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_9 -2586.686862 0.0 0.0 0.000000
P20_008845_1894_XN_09N203W_9 -2586.686862 0.0 0.0 0.000000
res0 res1 res2
10_8344_8845_4r 18.301328 44.206259 416.201741
10_8344_8845_4r 18.301328 44.206259 416.201741
10_8344_8845_4r 18.301328 44.206259 416.201741
11_8344_8845_4r -22.046575 103.403228 173.210013
11_8344_8845_4r -22.046575 103.403228 173.210013
11_8344_8845_4r -22.046575 103.403228 173.210013
12_8344_8845_4r -7.549561 93.170584 180.058858
12_8344_8845_4r -7.549561 93.170584 180.058858
12_8344_8845_4r -7.549561 93.170584 180.058858
13_8344_8845_4r -1.643694 74.244153 319.554535
13_8344_8845_4r -1.643694 74.244153 319.554535
13_8344_8845_4r -1.643694 74.244153 319.554535
14_8344_8845_4r -50.069808 144.316524 -164.540707
14_8344_8845_4r -50.069808 144.316524 -164.540707
14_8344_8845_4r -50.069808 144.316524 -164.540707
15_8344_8845_4r_mt_z -34.817656 145.864550 0.214023
15_8344_8845_4r_mt_z -34.817656 145.864550 0.214023
15_8344_8845_4r_mt_z -34.817656 145.864550 0.214023
16_8344_8845_4r -29.465246 121.908506 19.874949
16_8344_8845_4r -29.465246 121.908506 19.874949
16_8344_8845_4r -29.465246 121.908506 19.874949
17_8344_8845_2r_mt_z -10.779830 38.761214 0.236077
18_8344_8845_2r -22.636068 54.092590 524.603661
19_8344_8845_2r_mt_z -42.271359 76.834077 -0.138177
1_8344_8845_4r 49.937532 -24.131687 639.699743
1_8344_8845_4r 49.937532 -24.131687 639.699743
1_8344_8845_4r 49.937532 -24.131687 639.699743
20_8344_8845_2r_mt_z -56.910236 91.282891 0.161681
21_8344_8845_4r_xyz -0.780598 -3.284978 -0.443885
21_8344_8845_4r_xyz -0.780598 -3.284978 -0.443885
... ... ... ...
P20_008845_1894_XN_09N203W_16 -43.211361 193.404135 -393.931834
P20_008845_1894_XN_09N203W_16 -43.211361 193.404135 -393.931834
P20_008845_1894_XN_09N203W_16 -43.211361 193.404135 -393.931834
P20_008845_1894_XN_09N203W_17 -44.880108 199.649337 -441.559606
P20_008845_1894_XN_09N203W_17 -44.880108 199.649337 -441.559606
P20_008845_1894_XN_09N203W_17 -44.880108 199.649337 -441.559606
P20_008845_1894_XN_09N203W_18 -38.388316 195.050373 -391.289238
P20_008845_1894_XN_09N203W_18 -38.388316 195.050373 -391.289238
P20_008845_1894_XN_09N203W_18 -38.388316 195.050373 -391.289238
P20_008845_1894_XN_09N203W_2 42.067289 -12.658160 627.742625
P20_008845_1894_XN_09N203W_2 42.067289 -12.658160 627.742625
P20_008845_1894_XN_09N203W_2 42.067289 -12.658160 627.742625
P20_008845_1894_XN_09N203W_3 36.033823 -4.170818 616.480181
P20_008845_1894_XN_09N203W_3 36.033823 -4.170818 616.480181
P20_008845_1894_XN_09N203W_3 36.033823 -4.170818 616.480181
P20_008845_1894_XN_09N203W_4 -7.233876 33.324946 574.887719
P20_008845_1894_XN_09N203W_5 7.498790 33.109007 581.149470
P20_008845_1894_XN_09N203W_5 7.498790 33.109007 581.149470
P20_008845_1894_XN_09N203W_6 7.687475 59.859663 375.680663
P20_008845_1894_XN_09N203W_6 7.687475 59.859663 375.680663
P20_008845_1894_XN_09N203W_6 7.687475 59.859663 375.680663
P20_008845_1894_XN_09N203W_7 6.358447 61.278242 375.840988
P20_008845_1894_XN_09N203W_7 6.358447 61.278242 375.840988
P20_008845_1894_XN_09N203W_7 6.358447 61.278242 375.840988
P20_008845_1894_XN_09N203W_8 -0.219662 71.414267 336.409684
P20_008845_1894_XN_09N203W_8 -0.219662 71.414267 336.409684
P20_008845_1894_XN_09N203W_8 -0.219662 71.414267 336.409684
P20_008845_1894_XN_09N203W_9 15.191825 22.094037 544.874936
P20_008845_1894_XN_09N203W_9 15.191825 22.094037 544.874936
P20_008845_1894_XN_09N203W_9 15.191825 22.094037 544.874936
[809 rows x 22 columns]
%% Cell type:code id: tags:
``` python
files_dict = read_atf('CTX_Athabasca_Middle_step0.atf')['IMAGE_SUP']
lines_samples_dict = {}
for key in files_dict:
with open(key) as f:
if f[0:5] == 'LINES':
lines_samples_dict[]
if f[0:7] == 'SAMPLES':
lines_samples_dict
print(new_df.index[800])
sup_dict = {}
for index in new_df['l.']:
if index in files_dict:
new_df['l.'] =
print(sup_dict)
atf_file = get_path(atf_file);
files = []
ipf = []
sup = []
files_dict = []
# Grabs every PRJ, GPF, SUP, and IPF image from the ATF file
for line in f:
if line[-4:-1] == 'prj' or line[-4:-1] == 'gpf' or line[-4:-1] == 'sup' or line[-4:-1] == 'ipf' or line[-4:-1] == 'atf':
files.append(line)
files = np.array(files)
```
%% Output
P20_008845_1894_XN_09N203W_7
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-52-9c95896b4ea2> in <module>()
4 sup_dict = {}
5 for files in files_dict:
----> 6 print(new_df.index[files.split('.sup')[0]])
7 sup_dict[files.split('.sup')[0]] = new_df[files.split('.sup')[0]]
8
~/anaconda3/envs/autocnet/lib/python3.6/site-packages/pandas/core/indexes/base.py in __getitem__(self, key)
1741
1742 if is_scalar(key):
-> 1743 return getitem(key)
1744
1745 if isinstance(key, slice):
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
%% Cell type:code id: tags:
``` python
diff = ipf_df.index.difference(pd.unique(gpf_df.index))
total_similar = 0
for i in gpf_df.index:
for j in pd.unique(ipf_df.index):
if i == j:
total_similar += 1
diff
```
%% Cell type:code id: tags:
``` python
# double ToPlanetocentric3(const double lattitude, double eRadius, double pRadius)
# {
# double mylat = (lattitude-90.0)*DegToRad;
# if(fabs(mylat)<90.0)
# {
# mylat = atan((tan(mylat) * (pRadius/eRadius) * (pRadius/eRadius)) );
# }
# return (mylat*RadToDeg)+90.0;
# }
# double ToPlanetocentric4(const double lattitude, double eRadius, double pRadius)
# {
# double mylat = (lattitude-90.0)*DegToRad;
# if(fabs(mylat)<90.0)
# {
# double oe = acos(pRadius/eRadius);
# double csqrd = cos(oe)*cos(oe);
# mylat = atan(csqrd*tan(mylat));
# }
# return (mylat*RadToDeg)+90.0;
# }
test = GeoDataset('/home/tthatcher/Desktop/Projects/Plio/plio/plio/examples/Apollo15/AS15-M-0295_SML_geo.tif')
print(test.spatial_reference)
print(test.geospatial_coordinate_system)
def ToPlanetocentric3(lat, eRadius, pRadius):
mylat = math.radians(lat - 90.0)
if(math.fabs(mylat) < 90.0):
mylat = math.atan(math.tan(mylat) * (pRadius/eRadius) * (pRadius/eRadius))
return math.degrees(mylat) + 90.0
def ToPlanetocentric4(lat, eRadius, pRadius):
mylat = math.radians(lat - 90.0)
if(math.fabs(mylat) < 90.0):
oe = math.acos(pRadius/eRadius)
cos_squared = math.cos(oe)**2
mylat = math.atan(cos_squared*(math.tan(mylat)))
return math.degrees(mylat) + 90.0
```
%% Output
GEOGCS["unnamed ellipse",
DATUM["unknown",
SPHEROID["Unknown",1737400,0]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]]
GEOGCS["unnamed ellipse",
DATUM["unknown",
SPHEROID["Unknown",1737400,0]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]]
%% Cell type:code id: tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment