Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomag-algorithms
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
ghsc
National Geomagnetism Program
geomag-algorithms
Commits
105a8d32
Commit
105a8d32
authored
10 years ago
by
Hal Simpson
Browse files
Options
Downloads
Patches
Plain Diff
Fixed linting errors, and added comments to uncommented methods.
parent
7bce2122
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/geomag.py
+41
-4
41 additions, 4 deletions
bin/geomag.py
with
41 additions
and
4 deletions
bin/geomag.py
+
41
−
4
View file @
105a8d32
...
...
@@ -5,7 +5,7 @@ import sys
# ensure geomag is on the path before importing
try
:
import
geomagio
import
geomagio
# noqa
except
:
from
os
import
path
script_dir
=
path
.
dirname
(
path
.
abspath
(
__file__
))
...
...
@@ -25,7 +25,7 @@ def main():
Inputs
------
se
e --help from commandline.
u
se
geomag.py --help to see inputs
Notes
-----
...
...
@@ -104,6 +104,7 @@ def main():
controller
.
run
(
UTCDateTime
(
args
.
starttime
),
UTCDateTime
(
args
.
endtime
))
def
parse_args
():
"""
parse input arguments
...
...
@@ -117,10 +118,10 @@ def parse_args():
fromfile_prefix_chars
=
'
@
'
,)
parser
.
add_argument
(
'
--input
'
,
choices
=
[
'
iaga
'
,
'
edge
'
],
help
=
'
Input type.
'
,
required
=
True
)
help
=
'
Input type.
'
,
required
=
True
)
parser
.
add_argument
(
'
--output
'
,
choices
=
[
'
iaga
'
],
help
=
'
Input type.
'
,
required
=
True
)
help
=
'
Input type.
'
,
required
=
True
)
parser
.
add_argument
(
'
--starttime
'
,
default
=
UTCDateTime
(),
help
=
'
UTC date YYYY-MM-DD HH:MM:SS
'
)
...
...
@@ -181,13 +182,49 @@ def parse_args():
return
parser
.
parse_args
()
def
_get_iaga_input_url
(
args
):
"""
get iaga input url
Parameters
----------
args: argparse.Namespace
all the arguments passed to geomag.py
input_iaga_url: string
the start of the url to read from
input_iaga_urltemplate: string
the template for the subdirectories to be read from
input_iaga_filetemplate:string
the template for the file
Returns
-------
complete template for the input url
"""
url
=
args
.
input_iaga_url
or
'
file://./
'
urltemplate
=
args
.
input_iaga_urltemplate
or
''
filetemplate
=
args
.
input_iaga_filetemplate
or
IAGA_FILE_PATTERN
return
url
+
urltemplate
+
filetemplate
def
_get_iaga_output_url
(
args
):
"""
get iaga input url
Parameters
----------
args: argparse.Namespace
all the arguments passed to geomag.py
output_iaga_url: string
the start of the url to read from
output_iaga_urltemplate: string
the template for the subdirectories to be read from
output_iaga_filetemplate:string
the template for the file
Returns
-------
complete template for the output url
"""
url
=
args
.
output_iaga_url
or
'
file://./
'
urltemplate
=
args
.
output_iaga_urltemplate
or
''
filetemplate
=
args
.
output_iaga_filetemplate
or
IAGA_FILE_PATTERN
...
...
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