Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Permasense Datamanager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Institut für Informatik
neslab
public
PermaSense
Permasense Datamanager
Commits
f397d181
Commit
f397d181
authored
4 years ago
by
perma
Browse files
Options
Downloads
Patches
Plain Diff
Improved argparse
parent
34ab6fd2
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
manage_GSNdata.py
+153
-130
153 additions, 130 deletions
manage_GSNdata.py
with
153 additions
and
130 deletions
manage_GSNdata.py
+
153
−
130
View file @
f397d181
...
@@ -32,41 +32,49 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
...
@@ -32,41 +32,49 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@date: March
19
, 2020
@date: March
27
, 2020
@author: Samuel Weber, Jan Beutel and Matthias Meyer
@author: Samuel Weber, Jan Beutel and Matthias Meyer
usage: manage_GSNdata.py [-h] [--gsn2raw] [--load] [--filter] [--clean]
usage: manage_GSNdata.py [-h] [--gsn2raw GSN2RAW] [--load LOAD]
[--aggregationInterval AGGREGATIONINTERVAL]
[--filter FILTER] [--clean CLEAN]
[--export2csv] [--sanityPlot] [--gsn2img]
[--aggregationInterval AGGREGATIONINTERVAL]
[--nImg NIMG] [-p PATH] [-y1 YEARBEGIN]
[--export2csv EXPORT2CSV]
[-m1 MONTHBEGIN] [-d1 DAYBEGIN] [-y2 YEAREND]
[--sanityPlot SANITYPLOT] [--gsn2img GSN2IMG]
[-m2 MONTHEND] [-d2 DAYEND]
[--nImg NIMG] [-p PATH] [-y1 YEARBEGIN]
[-m1 MONTHBEGIN] [-d1 DAYBEGIN] [-y2 YEAREND]
[-m2 MONTHEND] [-d2 DAYEND]
optional arguments:
optional arguments:
-h, --help show this help message and exit
-h, --help show this help message and exit
--gsn2raw Get raw data from GSN and store locally (step1)
--gsn2raw GSN2RAW Get raw data from GSN and store locally (step1,
--load Load locally stored data (step2)
default: True)
--filter Filter data (according reference values, step3)
--load LOAD Load locally stored data (step2, default: True)
--clean Clean data manually (step4)
--filter FILTER Filter data (according reference values, step3,
default: True)
--clean CLEAN Clean data manually (step4, default: True)
--aggregationInterval AGGREGATIONINTERVAL
--aggregationInterval AGGREGATIONINTERVAL
Aggregate data over timewindows of X minutes (step5)
Aggregate data over timewindows of X minutes (step5,
--export2csv Export data in yearly csv files (step6)
default: 60)
--sanityPlot Plot for sanity check (step7)
--export2csv EXPORT2CSV
--gsn2img Downlod images from GSN and convert NEF to JPEG
Export data in yearly csv files (step6, default: True)
--nImg NIMG Number of images to download and convert
--sanityPlot SANITYPLOT
-p PATH, --path PATH Relative path for the data output
Plot for sanity check (step7, default: True)
--gsn2img GSN2IMG Downlod images from GSN and convert NEF to JPEG
(default: True)
--nImg NIMG Number of images to download and convert (default: 10)
-p PATH, --path PATH Relative path for the data output (default: ./data)
-y1 YEARBEGIN, --yearBegin YEARBEGIN
-y1 YEARBEGIN, --yearBegin YEARBEGIN
Year begin
Year begin
(default: 2008)
-m1 MONTHBEGIN, --monthBegin MONTHBEGIN
-m1 MONTHBEGIN, --monthBegin MONTHBEGIN
Month begin
Month begin
(default: 1)
-d1 DAYBEGIN, --dayBegin DAYBEGIN
-d1 DAYBEGIN, --dayBegin DAYBEGIN
Day begin
Day begin
(default: 1)
-y2 YEAREND, --yearEnd YEAREND
-y2 YEAREND, --yearEnd YEAREND
Year end
Year end
(default: today)
-m2 MONTHEND, --monthEnd MONTHEND
-m2 MONTHEND, --monthEnd MONTHEND
Month end
Month end
(default: today)
-d2 DAYEND, --dayEnd DAYEND
-d2 DAYEND, --dayEnd DAYEND
Day end
Day end
(default: today)
'''
'''
def
main
():
def
main
():
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
...
@@ -132,6 +140,7 @@ def main():
...
@@ -132,6 +140,7 @@ def main():
DOWNLOAD_LIMIT
=
30000
DOWNLOAD_LIMIT
=
30000
#DOWNLOAD_MAX_SIZE = 20000
#DOWNLOAD_MAX_SIZE = 20000
DOWNLOAD_MAX_SIZE
=
1000000
DOWNLOAD_MAX_SIZE
=
1000000
#DOWNLOAD_MAX_SIZE = 800
RESIZE
=
False
RESIZE
=
False
#resize_w, resize_h = 356, 536
#resize_w, resize_h = 356, 536
RESIZE_WIDTH
=
712
RESIZE_WIDTH
=
712
...
@@ -151,61 +160,61 @@ def main():
...
@@ -151,61 +160,61 @@ def main():
#'AD08': {'temperature_rock'}, #OK
#'AD08': {'temperature_rock'}, #OK
#'AD09': {'temperature_rock'}, #OK
#'AD09': {'temperature_rock'}, #OK
#
'DH00': {'RD01': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, # OK
#
'DH00': {'RD01': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, # OK
#
'DH05': {'DI55': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, # OK
#
'DH05': {'DI55': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, # OK
#
'DH06': {'RA01': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg, OK
#
'DH06': {'RA01': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg, OK
#
'DH07': {'DI57': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, # OK
#
'DH07': {'DI57': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, # OK
#
'DH09': {'RA02': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg, OK
#
'DH09': {'RA02': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg, OK
#
'DH12': {'BH03': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, # OK
#
'DH12': {'BH03': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, # OK
#
'DH15': {'DI02': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #225/131/281/246deg, OK
#
'DH15': {'DI02': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #225/131/281/246deg, OK
#
'DH17': {'DI07': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #105/277/321/334deg, OK
#
'DH17': {'DI07': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #105/277/321/334deg, OK
#
'DH21': {'LS01': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #110deg, OK
#
'DH21': {'LS01': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #110deg, OK
#
'DH23': {'LS04': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #225deg, OK
#
'DH23': {'LS04': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #225deg, OK
#
'DH25': {'BH07': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #240deg, OK
#
'DH25': {'BH07': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #240deg, OK
#
'DH27': {'BH09': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #130deg, OK
#
'DH27': {'BH09': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #130deg, OK
#
'DH29': {'ST02': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #004deg, OK
#
'DH29': {'ST02': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #004deg, OK
#
'DH31': {'ST05': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #124deg, OK
#
'DH31': {'ST05': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #124deg, OK
#
'DH33': {'GU02': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #335deg, OK
#
'DH33': {'GU02': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #335deg, OK
#
'DH35': {'GU03': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #010deg, OK
#
'DH35': {'GU03': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #010deg, OK
#
'DH39': {'RG01': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, # OK
#
'DH39': {'RG01': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, # OK
#
'DH41': {'GG52': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, # OK
#
'DH41': {'GG52': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, # OK
#
'DH43': {'GG01': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #325deg, OK
#
'DH43': {'GG01': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #325deg, OK
#
'DH44': {'GG02': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #205/041deg OK
#
'DH44': {'GG02': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #205/041deg OK
#
'DH55': {'BH10': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #280/270/294/312deg OK
#
'DH55': {'BH10': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #280/270/294/312deg OK
#
'DH56': {'RL01': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #309deg OK
#
'DH56': {'RL01': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #309deg OK
#
'DH57': {'GU04': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #014deg, OK
#
'DH57': {'GU04': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #014deg, OK
#
'DH62': {'BH12': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #140deg, OK
#
'DH62': {'BH12': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #140deg, OK
#
'DH63': {'BH13': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #090/000deg, OK
#
'DH63': {'BH13': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #090/000deg, OK
#
'DH64': {'LS05': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #318/330deg, OK
#
'DH64': {'LS05': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #318/330deg, OK
#
'DH66': {'GG66': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, #, OK
#
'DH66': {'GG66': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, #, OK
#
'DH67': {'GG67': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, #, OK
#
'DH67': {'GG67': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, #, OK
#
'DH70': {'RA03': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg, OK
#
'DH70': {'RA03': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg, OK
#
'DH81': {'RAND': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, #, OK
#
'DH81': {'RAND': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, #, OK
#
'DH82': {'WYS1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #170deg, OK
#
'DH82': {'WYS1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #170deg, OK
#
'DH83': {'LS11': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #262deg, OK
#
'DH83': {'LS11': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #262deg, OK
#
'DH84': {'LS12': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #006deg, OK
#
'DH84': {'LS12': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #006deg, OK
#
'DH86': {'DI03': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg, OK
#
'DH86': {'DI03': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg, OK
#
'DH87': {'DI04': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg, OK
#
'DH87': {'DI04': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg, OK
#
'DH88': {'LS06': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg, OK
#
'DH88': {'LS06': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg, OK
#
#'DH89': {'SA01': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg
#
#'DH89': {'SA01': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #000deg
#
#'DH91': {'SATT': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, #
#
#'DH91': {'SATT': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, #
#
'DH13': {'DH13': {'vaisalawxt520prec', 'vaisalawxt520windpth'}}, #
#
'DH13': {'DH13': {'vaisalawxt520prec', 'vaisalawxt520windpth'}}, #
#
'DH42': {'DH42': {'vaisalawxt520prec', 'vaisalawxt520windpth'}}, #
#
'DH42': {'DH42': {'vaisalawxt520prec', 'vaisalawxt520windpth'}}, #
#
'DH68': {'DH68': {'vaisalawxt520prec', 'vaisalawxt520windpth'}}, #
#
'DH68': {'DH68': {'vaisalawxt520prec', 'vaisalawxt520windpth'}}, #
#
'DH69': {'DH69': {'vaisalawxt520prec', 'vaisalawxt520windpth'}}, #
#
'DH69': {'DH69': {'vaisalawxt520prec', 'vaisalawxt520windpth'}}, #
#
'DH73': {'DH73': {'radiometer__conv'}}, #
#
'DH73': {'DH73': {'radiometer__conv'}}, #
#
'PE01': {'DIS1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE01': {'DIS1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE02': {'DIS2': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE02': {'DIS2': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE03': {'RIT1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE03': {'RIT1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE04': {'GRU1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE04': {'GRU1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE05': {'JAE1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE05': {'JAE1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE06': {'SCH1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE06': {'SCH1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE07': {'MUA1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE07': {'MUA1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE08': {'LAR1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE08': {'LAR1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE09': {'LAR2': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE09': {'LAR2': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE10': {'COR1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#
'PE10': {'COR1': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #, OK
#'JJ01': {'resistivity_rock', 'temperature_rock'}, #OK
#'JJ01': {'resistivity_rock', 'temperature_rock'}, #OK
#'JJ02': {'resistivity_rock', 'temperature_rock'}, #OK
#'JJ02': {'resistivity_rock', 'temperature_rock'}, #OK
...
@@ -224,43 +233,43 @@ def main():
...
@@ -224,43 +233,43 @@ def main():
#'JJ25': {'temperature_rock'}, #
#'JJ25': {'temperature_rock'}, #
'
MH01
'
:
{
'
MH01
'
:
{
'
displacement
'
,
'
temperature_fracture
'
,
'
temperature_rock
'
}},
#ok
#
'MH01': {'MH01': {'displacement', 'temperature_fracture', 'temperature_rock'}}, #ok
'
MH02
'
:
{
'
MH02
'
:
{
'
displacement
'
,
'
temperature_fracture
'
,
'
temperature_rock
'
}},
#ok
#
'MH02': {'MH02': {'displacement', 'temperature_fracture', 'temperature_rock'}}, #ok
'
MH03
'
:
{
'
MH03
'
:
{
'
displacement
'
,
'
temperature_fracture
'
,
'
temperature_rock
'
}},
#ok
#
'MH03': {'MH03': {'displacement', 'temperature_fracture', 'temperature_rock'}}, #ok
'
MH04
'
:
{
'
MH04
'
:
{
'
displacement
'
,
'
temperature_fracture
'
,
'
temperature_rock
'
}},
#ok
#
'MH04': {'MH04': {'displacement', 'temperature_fracture', 'temperature_rock'}}, #ok
'
MH05
'
:
{
'
MH05
'
:
{
'
resistivity_fracture
'
,
'
temperature_fracture
'
}},
#ok but resistivity
#
'MH05': {'MH05': {'resistivity_fracture', 'temperature_fracture'}}, #ok but resistivity
'
MH06
'
:
{
'
MH06
'
:
{
'
displacement
'
,
'
temperature_rock
'
}},
#ok
#
'MH06': {'MH06': {'displacement', 'temperature_rock'}}, #ok
'
MH07
'
:
{
'
MH07
'
:
{
'
resistivity_fracture
'
,
'
temperature_fracture
'
}},
#ok but resistivity
#
'MH07': {'MH07': {'resistivity_fracture', 'temperature_fracture'}}, #ok but resistivity
'
MH08
'
:
{
'
MH08
'
:
{
'
displacement
'
,
'
temperature_rock
'
}},
#ok
#
'MH08': {'MH08': {'displacement', 'temperature_rock'}}, #ok
'
MH09
'
:
{
'
MH09
'
:
{
'
displacement
'
,
'
temperature_fracture
'
}},
#ok
#
'MH09': {'MH09': {'displacement', 'temperature_fracture'}}, #ok
'
MH10
'
:
{
'
MH10
'
:
{
'
resistivity_rock
'
,
'
temperature_rock
'
}},
#ok but resistivity
#
'MH10': {'MH10': {'resistivity_rock', 'temperature_rock'}}, #ok but resistivity
'
MH11
'
:
{
'
MH11
'
:
{
'
resistivity_rock
'
,
'
temperature_rock
'
}},
#ok but resistivity_rock
#
'MH11': {'MH11': {'resistivity_rock', 'temperature_rock'}}, #ok but resistivity_rock
'
MH12
'
:
{
'
MH12
'
:
{
'
resistivity_rock
'
,
'
temperature_rock
'
}},
#ok but resistivity
#
'MH12': {'MH12': {'resistivity_rock', 'temperature_rock'}}, #ok but resistivity
'
MH18
'
:
{
'
MH18
'
:
{
'
displacement
'
}},
#ok
#
'MH18': {'MH18': {'displacement'}}, #ok
'
MH20
'
:
{
'
MH20
'
:
{
'
displacement
'
}},
#ok
#
'MH20': {'MH20': {'displacement'}}, #ok
'
MH21
'
:
{
'
MH21
'
:
{
'
displacement
'
}},
#ok
#
'MH21': {'MH21': {'displacement'}}, #ok
'
MH22
'
:
{
'
MH22
'
:
{
'
displacement
'
}},
#ok
#
'MH22': {'MH22': {'displacement'}}, #ok
'
MH27
'
:
{
'
MH27
'
:
{
'
temperature_rock
'
}},
#ok
#
'MH27': {'MH27': {'temperature_rock'}}, #ok
'
MH30
'
:
{
'
MH30
'
:
{
'
temperature_rock
'
}},
#ok
#
'MH30': {'MH30': {'temperature_rock'}}, #ok
'
MH46
'
:
{
'
MH46
'
:
{
'
temperature_rock
'
}},
#ok
#
'MH46': {'MH46': {'temperature_rock'}}, #ok
'
MH47
'
:
{
'
MH47
'
:
{
'
temperature_rock
'
}},
#ok
#
'MH47': {'MH47': {'temperature_rock'}}, #ok
#
'
MH15
'
:
{
'
MH15
'
:
{
'
radiometer__conv
'
}},
#ok
#
'MH15': {'MH15': {'radiometer__conv'}}, #ok
'
MH25
'
:
{
'
MH25
'
:
{
'
vaisalawxt520prec
'
,
'
vaisalawxt520windpth
'
}},
#ok
#
'MH25': {'MH25': {'vaisalawxt520prec', 'vaisalawxt520windpth'}}, #ok
#
'
MH33
'
:
{
'
MH33
'
:
{
'
gps_differential__batch__daily
'
,
'
gps_differential__rtklib__daily
'
,
'
gps_inclinometer
'
}},
#ok
#
'MH33': {'MH33': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #ok
'
MH34
'
:
{
'
MH34
'
:
{
'
gps_differential__batch__daily
'
,
'
gps_differential__rtklib__daily
'
,
'
gps_inclinometer
'
}},
#ok
#
'MH34': {'MH34': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #ok
'
MH35
'
:
{
'
MH35
'
:
{
'
gps_differential__batch__daily
'
,
'
gps_differential__rtklib__daily
'
,
'
gps_inclinometer
'
}},
#ok
#
'MH35': {'MH35': {'gps_differential__batch__daily','gps_differential__rtklib__daily','gps_inclinometer'}}, #ok
'
MH40
'
:
{
'
MH40
'
:
{
'
gps_differential__batch__daily
'
,
'
gps_differential__rtklib__daily
'
}},
#ok
#
'MH40': {'MH40': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, #ok
'
MH42
'
:
{
'
MH42
'
:
{
'
gps_differential__batch__daily
'
,
'
gps_differential__rtklib__daily
'
}},
#ok
#
'MH42': {'MH42': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}}, #ok
'
MH43
'
:
{
'
MH43
'
:
{
'
gps_differential__batch__daily
'
,
'
gps_differential__rtklib__daily
'
}},
#
'MH43': {'MH43': {'gps_differential__batch__daily','gps_differential__rtklib__daily'}},
}
}
DEPO_GPS
=
[
'
MH33
'
,
'
MH34
'
,
'
MH35
'
,
'
MH40
'
,
'
MH42
'
,
'
MH43
'
]
DEPO_GPS
=
[
'
MH33
'
,
'
MH34
'
,
'
MH35
'
,
'
MH40
'
,
'
MH42
'
,
'
MH43
'
]
DEPO_IMG
=
{
DEPO_IMG
=
{
#'MH19': {'camera_pos19__scaled'}
#'MH19': {'camera_pos19__scaled'}
#
'MH19': {'binary__mapped'}
'
MH19
'
:
{
'
binary__mapped
'
}
}
}
...
@@ -462,6 +471,8 @@ def main():
...
@@ -462,6 +471,8 @@ def main():
#plt.figure(figsize=(24/2.54, 18/2.54), facecolor='w', edgecolor='k')
#plt.figure(figsize=(24/2.54, 18/2.54), facecolor='w', edgecolor='k')
fig
=
plt
.
figure
(
figsize
=
(
40
/
2.54
,
18
/
2.54
),
facecolor
=
'
w
'
,
edgecolor
=
'
k
'
)
fig
=
plt
.
figure
(
figsize
=
(
40
/
2.54
,
18
/
2.54
),
facecolor
=
'
w
'
,
edgecolor
=
'
k
'
)
plt
.
subplots_adjust
(
left
=
0.05
,
right
=
0.95
,
bottom
=
0.05
,
top
=
0.85
)
# left=0.125, right=0.9, bottom=0.1, top=0.9, wspace=0.2, hspace=0.2
for
i
,
col
in
enumerate
(
df_agg
):
for
i
,
col
in
enumerate
(
df_agg
):
if
col
not
in
[
'
device_id
'
,
'
device_type
'
,
'
position
'
,
'
label
'
,
'
ref1
'
,
'
ref2
'
,
'
ref3
'
,
'
ref4
'
,
'
ref5
'
,
'
ref6
'
,
'
sd_e
'
,
'
sd_n
'
,
'
sd_h
'
,
'
version
'
,
'
reference_label
'
,
'
processing_time
'
,
'
ratio_of_fixed_ambiguities
'
]:
if
col
not
in
[
'
device_id
'
,
'
device_type
'
,
'
position
'
,
'
label
'
,
'
ref1
'
,
'
ref2
'
,
'
ref3
'
,
'
ref4
'
,
'
ref5
'
,
'
ref6
'
,
'
sd_e
'
,
'
sd_n
'
,
'
sd_h
'
,
'
version
'
,
'
reference_label
'
,
'
processing_time
'
,
'
ratio_of_fixed_ambiguities
'
]:
#print(df_agg[col])
#print(df_agg[col])
...
@@ -473,10 +484,11 @@ def main():
...
@@ -473,10 +484,11 @@ def main():
# any legend location is too slow
# any legend location is too slow
# #plt.legend()
# #plt.legend()
plt
.
legend
(
loc
=
"
upper left
"
)
plt
.
legend
(
loc
=
"
upper left
"
)
plt
.
xlim
([
TBEG
,
TEND
])
if
deployment
==
'
matterhorn
'
:
plt
.
tight_layout
()
plt
.
xlim
([
TBEG
,
TEND
])
if
fig
.
get_axes
():
# Do stuff when the figure isn't empty.
#plt.tight_layout()
plt
.
savefig
(
'
{:s}/timeseries_sanity_plots/{:s}_{:s}_all.png
'
.
format
(
PATH_DATA
,
label
,
vsensor
),
dpi
=
300
)
#if fig.get_axes(): # Do stuff when the figure isn't empty.
plt
.
savefig
(
'
{:s}/timeseries_sanity_plots/{:s}_{:s}_all.png
'
.
format
(
PATH_DATA
,
label
,
vsensor
),
dpi
=
300
)
# plt.close('all')
# plt.close('all')
print
()
print
()
...
@@ -502,6 +514,15 @@ def parseArguments():
...
@@ -502,6 +514,15 @@ def parseArguments():
import
argparse
import
argparse
import
datetime
as
dt
import
datetime
as
dt
def
true_or_false
(
arg
):
ua
=
str
(
arg
).
upper
()
if
'
TRUE
'
.
startswith
(
ua
):
return
True
elif
'
FALSE
'
.
startswith
(
ua
):
return
False
else
:
pass
#error condition maybe?
# Create argument parser
# Create argument parser
parser
=
argparse
.
ArgumentParser
()
parser
=
argparse
.
ArgumentParser
()
...
@@ -509,23 +530,25 @@ def parseArguments():
...
@@ -509,23 +530,25 @@ def parseArguments():
#parser.add_argument("positionalArgument1", help="Positional argument 1", type=float)
#parser.add_argument("positionalArgument1", help="Positional argument 1", type=float)
# Optional arguments
# Optional arguments
parser
.
add_argument
(
"
--gsn2raw
"
,
help
=
"
Get raw data from GSN and store locally (step1)
"
,
action
=
'
store_false
'
)
parser
.
add_argument
(
"
--gsn2raw
"
,
help
=
"
Get raw data from GSN and store locally (step1, default: %(default)s)
"
,
type
=
true_or_false
,
default
=
True
)
parser
.
add_argument
(
"
--load
"
,
help
=
"
Load locally stored data (step2)
"
,
action
=
'
store_false
'
)
#parser.add_argument("--gsn2raw", dest='gsn2raw', help="Get raw data from GSN and store locally (step1)", action='store_true')
parser
.
add_argument
(
"
--filter
"
,
help
=
"
Filter data (according reference values, step3)
"
,
action
=
'
store_false
'
)
#parser.add_argument("--no-gsn2raw", dest='gsn2raw', help=argparse.SUPPRESS, action='store_false')
parser
.
add_argument
(
"
--clean
"
,
help
=
"
Clean data manually (step4)
"
,
action
=
'
store_false
'
)
#parser.set_defaults(gsn2raw=True)
parser
.
add_argument
(
"
--aggregationInterval
"
,
help
=
"
Aggregate data over timewindows of X minutes (step5)
"
,
type
=
int
,
default
=
60
)
parser
.
add_argument
(
"
--load
"
,
help
=
"
Load locally stored data (step2, default: %(default)s)
"
,
type
=
true_or_false
,
default
=
True
)
parser
.
add_argument
(
"
--export2csv
"
,
help
=
"
Export data in yearly csv files (step6)
"
,
action
=
'
store_false
'
)
parser
.
add_argument
(
"
--filter
"
,
help
=
"
Filter data (according reference values, step3, default: %(default)s)
"
,
type
=
true_or_false
,
default
=
True
)
parser
.
add_argument
(
"
--sanityPlot
"
,
help
=
"
Plot for sanity check (step7)
"
,
action
=
'
store_false
'
)
parser
.
add_argument
(
"
--clean
"
,
help
=
"
Clean data manually (step4, default: %(default)s)
"
,
type
=
true_or_false
,
default
=
True
)
parser
.
add_argument
(
"
--gsn2img
"
,
help
=
"
Downlod images from GSN and convert NEF to JPEG
"
,
action
=
'
store_false
'
)
parser
.
add_argument
(
"
--aggregationInterval
"
,
help
=
"
Aggregate data over timewindows of X minutes (step5, default: %(default)s)
"
,
type
=
int
,
default
=
60
)
parser
.
add_argument
(
"
--nImg
"
,
help
=
"
Number of images to download and convert
"
,
type
=
int
,
default
=
10
)
parser
.
add_argument
(
"
--export2csv
"
,
help
=
"
Export data in yearly csv files (step6, default: %(default)s)
"
,
type
=
true_or_false
,
default
=
True
)
parser
.
add_argument
(
"
-p
"
,
"
--path
"
,
help
=
"
Relative path for the data output
"
,
type
=
str
,
default
=
'
./data
'
)
parser
.
add_argument
(
"
--sanityPlot
"
,
help
=
"
Plot for sanity check (step7, default: %(default)s)
"
,
type
=
true_or_false
,
default
=
True
)
parser
.
add_argument
(
"
-y1
"
,
"
--yearBegin
"
,
help
=
"
Year begin
"
,
type
=
int
,
default
=
2008
)
parser
.
add_argument
(
"
--gsn2img
"
,
help
=
"
Downlod images from GSN and convert NEF to JPEG (default: %(default)s)
"
,
type
=
true_or_false
,
default
=
True
)
#parser.add_argument("-y1", "--yearBegin", help="Year begin", type=int, default=2018)
parser
.
add_argument
(
"
--nImg
"
,
help
=
"
Number of images to download and convert (default: %(default)s)
"
,
type
=
int
,
default
=
10
)
parser
.
add_argument
(
"
-m1
"
,
"
--monthBegin
"
,
help
=
"
Month begin
"
,
type
=
int
,
default
=
1
)
parser
.
add_argument
(
"
-p
"
,
"
--path
"
,
help
=
"
Relative path for the data output (default: %(default)s)
"
,
type
=
str
,
default
=
'
./data
'
)
parser
.
add_argument
(
"
-d1
"
,
"
--dayBegin
"
,
help
=
"
Day begin
"
,
type
=
int
,
default
=
1
)
parser
.
add_argument
(
"
-y1
"
,
"
--yearBegin
"
,
help
=
"
Year begin (default: %(default)s)
"
,
type
=
int
,
default
=
2008
)
parser
.
add_argument
(
"
-y2
"
,
"
--yearEnd
"
,
help
=
"
Year end
"
,
type
=
int
,
default
=
dt
.
datetime
.
now
().
year
)
parser
.
add_argument
(
"
-m1
"
,
"
--monthBegin
"
,
help
=
"
Month begin (default: %(default)s)
"
,
type
=
int
,
default
=
1
)
parser
.
add_argument
(
"
-m2
"
,
"
--monthEnd
"
,
help
=
"
Month end
"
,
type
=
int
,
default
=
dt
.
datetime
.
now
().
month
)
parser
.
add_argument
(
"
-d1
"
,
"
--dayBegin
"
,
help
=
"
Day begin (default: %(default)s)
"
,
type
=
int
,
default
=
1
)
parser
.
add_argument
(
"
-d2
"
,
"
--dayEnd
"
,
help
=
"
Day end
"
,
type
=
int
,
default
=
dt
.
datetime
.
now
().
day
)
parser
.
add_argument
(
"
-y2
"
,
"
--yearEnd
"
,
help
=
"
Year end (default: today)
"
,
type
=
int
,
default
=
dt
.
datetime
.
now
().
year
)
parser
.
add_argument
(
"
-m2
"
,
"
--monthEnd
"
,
help
=
"
Month end (default: today)
"
,
type
=
int
,
default
=
dt
.
datetime
.
now
().
month
)
parser
.
add_argument
(
"
-d2
"
,
"
--dayEnd
"
,
help
=
"
Day end (default: today)
"
,
type
=
int
,
default
=
dt
.
datetime
.
now
().
day
)
# Print version
# Print version
#parser.add_argument("--version", action="version", version='%(prog)s - Version 1.0')
#parser.add_argument("--version", action="version", version='%(prog)s - Version 1.0')
...
...
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