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
5da2071a
Commit
5da2071a
authored
6 years ago
by
Adam Paquette
Browse files
Options
Downloads
Patches
Plain Diff
Update to bin script and moved read atf.
parent
f9d9e9a6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/Socetnet2ISIS.py
+1
-46
1 addition, 46 deletions
bin/Socetnet2ISIS.py
plio/io/io_bae.py
+60
-0
60 additions, 0 deletions
plio/io/io_bae.py
with
61 additions
and
46 deletions
bin/Socetnet2ISIS.py
+
1
−
46
View file @
5da2071a
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
from
plio.io.io_bae
import
read_atf
,
read_gpf
,
read_ipf
This diff is collapsed.
Click to expand it.
plio/io/io_bae.py
+
60
−
0
View file @
5da2071a
...
...
@@ -271,3 +271,63 @@ def save_gpf(df, output_file):
outGPF
.
close
()
return
def
read_atf
(
atf_file
):
"""
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)
Parameters
----------
atf_file : str
Full path to a socet atf file
Returns
-------
files_dict : dict
Dict of files and data associated with a socet
project
"""
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.
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