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
41bab951
Commit
41bab951
authored
7 years ago
by
Kelvin Rodriguez
Browse files
Options
Downloads
Patches
Plain Diff
updated test
parent
86a90adb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test.py
+22
-7
22 additions, 7 deletions
test.py
with
22 additions
and
7 deletions
test.py
+
22
−
7
View file @
41bab951
import
sys
import
os
import
argparse
import
plio
from
plio.io.io_tes
import
Tes
...
...
@@ -85,14 +86,13 @@ def clamp_longitude(angle):
"""
return
((
angle
+
180
)
%
360
)
-
180
def
to_mongodb
(
chunk_size
=
60
):
data_dir
=
'
/scratch/jlaura/tes/tes_data/
'
def
to_mongodb
(
data_dir
,
out_dir
,
sl
):
folders
=
[
folder
for
folder
in
os
.
listdir
(
data_dir
)
if
folder
[:
4
]
==
"
mgst
"
]
search_len
=
len
(
data_dir
)
+
9
print
(
"
search len: {}
"
.
format
(
search_len
))
folders
=
sorted
(
folders
,
key
=
lambda
x
:
int
(
x
[
5
:]))[
4
:
]
folders
=
sorted
(
folders
,
key
=
lambda
x
:
int
(
x
[
5
:]))[
sl
]
print
(
"
first 20 Folders:
"
)
print
(
"
\n
"
.
join
(
folders
[:
20
]))
...
...
@@ -135,9 +135,24 @@ def to_mongodb(chunk_size=60):
processed
=
processed
+
length
print
()
single_key_sets
=
{
'
ATM
'
,
'
POS
'
,
'
TLM
'
,
'
OBS
'
}
compound_key_sets
=
{
'
BOL
'
,
'
CMP
'
,
'
GEO
'
,
'
IFG
'
,
'
PCT
'
,
'
RAD
'
}
dfs
=
dict
.
fromkeys
(
single_key_sets
|
compound_key_sets
,
0
)
for
tes
in
outliers
:
dfs
[
tes
.
dataset
]
=
dfs
[
tes
.
dataset
]
+
1
tes
.
data
.
to_hdf5
(
out_dir
+
"
/
"
+
tes
.
dataset
+
str
(
dfs
[
tes
.
dataset
]))
if
__name__
==
"
__main__
"
:
to_mongodb
()
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'
data_dir
'
,
action
=
'
store
'
,
help
=
'
The location of the MGST folders for TES
'
,
default
=
'
/scratch/jlaura/tes/tes_data/
'
)
parser
.
add_argument
(
'
to
'
,
action
=
'
store
'
,
help
=
'
Python style slice of the folders to process.
\
Folders are ordered (e.g. [mgst1100, mgst1101 ...])
'
,
default
=
None
)
parser
.
add_argument
(
'
from
'
,
action
=
'
store
'
,
help
=
'
Python style slice of the folders to process.
\
Folders are ordered (e.g. [mgst1100, mgst1101 ...])
'
,
default
=
None
)
parser
.
add_argument
(
'
out_dir
'
,
action
=
'
store
'
,
help
=
'
The location of where to place outliers.
'
)
args
=
parser
.
parse_args
()
args
=
args
.
__dict__
()
to_mongodb
(
args
[
"
data_dir
"
],
args
[
"
out_dir
"
],
slice
(
args
[
"
from
"
],
args
[
"
to
"
]))
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