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
ccdc8b72
Commit
ccdc8b72
authored
6 years ago
by
Tyler Thatcher
Browse files
Options
Downloads
Patches
Plain Diff
Added bin and notebooks directories, also added Socetnet2ISIS script
parent
d7286705
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/Socetnet2ISIS.py
+49
-0
49 additions, 0 deletions
bin/Socetnet2ISIS.py
notebooks/.ipynb_checkpoints/Socet2ISIS-checkpoint.ipynb
+6
-0
6 additions, 0 deletions
notebooks/.ipynb_checkpoints/Socet2ISIS-checkpoint.ipynb
notebooks/Socet2ISIS.ipynb
+173
-0
173 additions, 0 deletions
notebooks/Socet2ISIS.ipynb
with
228 additions
and
0 deletions
bin/Socetnet2ISIS.py
0 → 100644
+
49
−
0
View file @
ccdc8b72
import
os
import
numpy
as
np
# 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
(
atf_file
)
as
f
:
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
This diff is collapsed.
Click to expand it.
notebooks/.ipynb_checkpoints/Socet2ISIS-checkpoint.ipynb
0 → 100644
+
6
−
0
View file @
ccdc8b72
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}
This diff is collapsed.
Click to expand it.
notebooks/Socet2ISIS.ipynb
0 → 100644
+
173
−
0
View file @
ccdc8b72
{
"cells": [
{
"cell_type": "code",
"execution_count": 67,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'ATF_FILE': 'CTX_Athabasca_Middle_step0.atf',\n",
" 'GP_FILE': 'CTX_Athabasca_Middle.gpf',\n",
" 'IMAGE_IPF': ['P19_008344_1894_XN_09N203W.ipf',\n",
" 'P20_008845_1894_XN_09N203W.ipf',\n",
" 'P03_002371_1888_XI_08N204W.ipf',\n",
" 'P01_001540_1889_XI_08N204W.ipf',\n",
" 'P01_001606_1897_XI_09N203W.ipf',\n",
" 'P03_002226_1895_XI_09N203W.ipf'],\n",
" 'IMAGE_SUP': ['P19_008344_1894_XN_09N203W.sup',\n",
" 'P20_008845_1894_XN_09N203W.sup',\n",
" 'P03_002371_1888_XI_08N204W.sup',\n",
" 'P01_001540_1889_XI_08N204W.sup',\n",
" 'P01_001606_1897_XI_09N203W.sup',\n",
" 'P03_002226_1895_XI_09N203W.sup'],\n",
" 'PATH': '/home/tthatcher/Desktop/Projects/Plio/plio/notebooks',\n",
" 'PROJECT': 'D:\\\\data\\\\CTX_Athabasca_Middle.prj'}"
]
},
"execution_count": 67,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import os\n",
"import numpy as np\n",
"\n",
"# Reads a .atf file and outputs all of the \n",
"# .ipf, .gpf, .sup, .prj, and path to locate the \n",
"# .apf file (should be the same as all others) \n",
"def read_atf(atf_file):\n",
" with open(atf_file) as f:\n",
"\n",
" files = []\n",
" ipf = []\n",
" sup = []\n",
" files_dict = []\n",
" \n",
" # Grabs every PRJ, GPF, SUP, and IPF image from the ATF file\n",
" for line in f:\n",
" 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':\n",
" files.append(line)\n",
" \n",
" files = np.array(files)\n",
" \n",
" # Creates appropriate arrays for certain files in the right format\n",
" for file in files:\n",
" file = file.strip()\n",
" file = file.split(' ')\n",
"\n",
" # Grabs all the IPF files\n",
" if file[1].endswith('.ipf'):\n",
" ipf.append(file[1])\n",
"\n",
" # Grabs all the SUP files\n",
" if file[1].endswith('.sup'):\n",
" sup.append(file[1])\n",
"\n",
" files_dict.append(file)\n",
"\n",
" # Creates a dict out of file lists for GPF, PRJ, IPF, and ATF\n",
" files_dict = (dict(files_dict))\n",
" \n",
" # Sets the value of IMAGE_IPF to all IPF images\n",
" files_dict['IMAGE_IPF'] = ipf\n",
" \n",
" # Sets the value of IMAGE_SUP to all SUP images\n",
" files_dict['IMAGE_SUP'] = sup\n",
" \n",
" # Sets the value of PATH to the path of the ATF file\n",
" files_dict['PATH'] = os.path.dirname(os.path.abspath(atf_file))\n",
" \n",
" return files_dict\n",
" \n",
"read_atf('CTX_Athabasca_Middle_step0.atf')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
%% Cell type:code id: tags:
```
python
import
os
import
numpy
as
np
# 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
(
atf_file
)
as
f
:
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/notebooks',
'PROJECT': 'D:\\data\\CTX_Athabasca_Middle.prj'}
%% Cell type:code id: tags:
```
python
``
`
%%
Cell
type
:
code
id
:
tags
:
```
python
```
%% Cell type:code id: tags:
```
python
```
%% Cell type:code id: tags:
```
python
```
%% Cell type:code id: tags:
```
python
```
%% Cell type:code id: tags:
```
python
```
%% Cell type:code id: tags:
```
python
```
%% Cell type:code id: tags:
```
python
```
%% Cell type:code id: tags:
```
python
```
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