Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
Clément Haëck
submeso-color
Commits
52181308
Commit
52181308
authored
Feb 03, 2021
by
Clément Haëck
Browse files
Set root_data in config file
parent
d2633f25
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
README.md
README.md
+9
-2
lib/__init__.py
lib/__init__.py
+10
-3
No files found.
README.md
View file @
52181308
...
...
@@ -6,10 +6,17 @@ Collocate submesoscale fronts to phytoplankton levels using satellite imagery
-
Download: Scripts for downloading data
-
lib: Reusable code. Scripts for defining databases
-
Compute: The actual code that does stuff. Each python script is accompanied
by a shell script to set the python environnement and launch it.
-
Compute: Process data, compute diagnostics,... Each python script is accompanied
by a shell script to set the python environnement and launch it. If not, ./launch_python.py
can be used.
-
Plots: Plotting scripts
The root directory containing data has to be specified in the file
`lib/conf.ini`
as
```
py
[
main
]
root_data
:
'/...'
```
## Requirements
...
...
lib/__init__.py
View file @
52181308
"""General global variables."""
import
configparser
import
os
from
os
import
path
from
pathlib
import
Path
import
argparse
import
re
# Read config file
_config
=
configparser
.
ConfigParser
()
_config_file
=
path
.
join
(
path
.
dirname
(
__file__
),
'conf.ini'
)
if
not
path
.
isfile
(
_config_file
):
raise
RuntimeError
(
"Missing configuration file lib/conf.ini"
)
_config
.
read
(
_config_file
)
root
=
path
.
join
(
Path
.
home
(),
'Documents/Work/Fronts'
)
root_data
=
path
.
join
(
Path
.
home
(),
'Documents/Work/Data'
)
root_data
=
_config
.
get
(
'main'
,
'root_data'
)
if
not
path
.
isdir
(
root_data
):
raise
NameError
(
f
"root_data '
{
root_data
}
' is not a valid directory."
)
root_plot
=
path
.
join
(
root_data
,
'Plots'
)
box_lat
=
[
36.
,
41.
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment