Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
analysis
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
Model registry
Operate
Environments
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
Due to inactivity, this project is scheduled to be deleted on 2037-01-11.
Why is this scheduled?
Show more breadcrumbs
Leo Bosse
analysis
Commits
ca4b8ab4
Commit
ca4b8ab4
authored
4 years ago
by
Leo Bosse
Browse files
Options
Downloads
Patches
Plain Diff
use panda to write to file
parent
a340390a
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
vendange/__pycache__/bottle.cpython-36.pyc
+0
-0
0 additions, 0 deletions
vendange/__pycache__/bottle.cpython-36.pyc
vendange/bottle.py
+12
-1
12 additions, 1 deletion
vendange/bottle.py
with
12 additions
and
1 deletion
vendange/__pycache__/bottle.cpython-36.pyc
+
0
−
0
View file @
ca4b8ab4
No preview for this file type
This diff is collapsed.
Click to expand it.
vendange/bottle.py
+
12
−
1
View file @
ca4b8ab4
...
@@ -625,6 +625,8 @@ class Bottle:
...
@@ -625,6 +625,8 @@ class Bottle:
# return self.rotations[-1].time + self.datetime + self.head_jump + delta
# return self.rotations[-1].time + self.datetime + self.head_jump + delta
elif
moment
==
"
config
"
:
#Datetime written in the config file (== first bad rotation, before head_jump)
elif
moment
==
"
config
"
:
#Datetime written in the config file (== first bad rotation, before head_jump)
return
self
.
datetime
+
delta
+
norm
return
self
.
datetime
+
delta
+
norm
elif
moment
==
"
midnight
"
:
#Datetime written in the config file (== first bad rotation, before head_jump)
return
dt
.
datetime
(
year
=
self
.
datetime
.
year
,
month
=
self
.
datetime
.
month
,
day
=
self
.
datetime
.
day
)
+
delta
+
norm
def
__add__
(
self
,
bottle_to_add
):
def
__add__
(
self
,
bottle_to_add
):
...
@@ -769,6 +771,7 @@ class PTCUBottle(Bottle):
...
@@ -769,6 +771,7 @@ class PTCUBottle(Bottle):
Bottle
.
LoadData
(
self
)
Bottle
.
LoadData
(
self
)
def
GetTimeFromDateTime
(
self
,
date
):
def
GetTimeFromDateTime
(
self
,
date
):
"""
Return list self.all_times shifted so that 0 is date.
"""
shift
=
self
.
DateTime
(
moment
=
"
start
"
)
-
date
shift
=
self
.
DateTime
(
moment
=
"
start
"
)
-
date
return
self
.
all_times
+
shift
return
self
.
all_times
+
shift
...
@@ -858,10 +861,18 @@ class PTCUBottle(Bottle):
...
@@ -858,10 +861,18 @@ class PTCUBottle(Bottle):
self
.
nb_rot
=
len
(
self
.
rotations
)
self
.
nb_rot
=
len
(
self
.
rotations
)
def
SaveTXT
(
self
):
def
SaveTXT
(
self
):
# times = [t.total_seconds() / 3600. for t in self.GetTimeFromDateTime(self.DateTime(moment="midnight", format="LT"))]
times
=
[
t
.
total_seconds
()
*
1000
for
t
in
self
.
GetTimeFromDateTime
(
self
.
DateTime
(
moment
=
"
config
"
))]
times
=
[
t
.
total_seconds
()
*
1000
for
t
in
self
.
GetTimeFromDateTime
(
self
.
DateTime
(
moment
=
"
config
"
))]
print
(
"
Saving as .txt in
"
,
self
.
data_file_name
+
"
/
"
+
self
.
saving_name
+
'
_results.txt
'
)
print
(
"
Saving as .txt in
"
,
self
.
data_file_name
+
"
/
"
+
self
.
saving_name
+
'
_results.txt
'
)
np
.
savetxt
(
self
.
data_file_name
+
"
/
"
+
self
.
saving_name
+
'
_results.txt
'
,
np
.
array
([
times
,
self
.
all_V
,
self
.
all_Vcos
,
self
.
all_Vsin
,
self
.
all_I0
,
self
.
all_DoLP
,
self
.
all_AoLP
,
self
.
smooth_V
,
self
.
smooth_Vcos
,
self
.
smooth_Vsin
,
self
.
smooth_I0
,
self
.
smooth_DoLP
,
self
.
smooth_AoLP
,
self
.
std_I0
,
self
.
std_DoLP
,
self
.
std_AoLP
,
self
.
std_smooth_I0
,
self
.
std_smooth_DoLP
,
self
.
std_smooth_AoLP
]).
transpose
(),
delimiter
=
"
\t
"
,
header
=
"
time
\t
V
\t
Vcos
\t
Vsin
\t
I0
\t
DoLP
\t
AoLP
\t
SV
\t
SVcos
\t
SVsin
\t
SI0
\t
SDoLP
\t
SAoLP
\t
errI0
\t
errDoLP
\t
errAoLP
\t
errSI0
\t
errSDoLP
\t
errSAoLP
"
)
data
=
pd
.
DataFrame
(
np
.
array
([
times
,
self
.
all_V
,
self
.
all_Vcos
,
self
.
all_Vsin
,
self
.
all_I0
,
self
.
all_DoLP
,
self
.
all_AoLP
,
self
.
smooth_V
,
self
.
smooth_Vcos
,
self
.
smooth_Vsin
,
self
.
smooth_I0
,
self
.
smooth_DoLP
,
self
.
smooth_AoLP
,
self
.
std_I0
,
self
.
std_DoLP
,
self
.
std_AoLP
,
self
.
std_smooth_I0
,
self
.
std_smooth_DoLP
,
self
.
std_smooth_AoLP
]).
transpose
())
data
.
columns
=
[
"
time
"
,
"
V
"
,
"
Vcos
"
,
"
Vsin
"
,
"
I0
"
,
"
DoLP
"
,
"
AoLP
"
,
"
SV
"
,
"
SVcos
"
,
"
SVsin
"
,
"
SI0
"
,
"
SDoLP
"
,
"
SAoLP
"
,
"
errI0
"
,
"
errDoLP
"
,
"
errAoLP
"
,
"
errSI0
"
,
"
errSDoLP
"
,
"
errSAoLP
"
]
data
.
to_csv
(
elf
.
data_file_name
+
"
/
"
+
self
.
saving_name
+
'
_results.txt
'
,
sep
=
"
\t
"
,
index
=
False
)
# np.savetxt(self.data_file_name + "/" + self.saving_name + '_results.txt', np.array([times, self.smooth_DoLP, self.smooth_AoLP, self.std_smooth_DoLP, self.std_smooth_AoLP]).transpose(), delimiter = "\t", header = "time\tSDoLP\tSAoLP\terrSDoLP\terrSAoLP")
# np.savetxt(self.data_file_name + "/" + self.saving_name + '_results.txt', np.array([times, self.all_V, self.all_Vcos, self.all_Vsin, self.all_I0, self.all_DoLP, self.all_AoLP, self.smooth_V, self.smooth_Vcos, self.smooth_Vsin, self.smooth_I0, self.smooth_DoLP, self.smooth_AoLP, self.std_I0, self.std_DoLP, self.std_AoLP, self.std_smooth_I0, self.std_smooth_DoLP, self.std_smooth_AoLP]).transpose(), delimiter = "\t", header = "time\tV\tVcos\tVsin\tI0\tDoLP\tAoLP\tSV\tSVcos\tSVsin\tSI0\tSDoLP\tSAoLP\terrI0\terrDoLP\terrAoLP\terrSI0\terrSDoLP\terrSAoLP")
def
LoadPTCUData
(
self
):
def
LoadPTCUData
(
self
):
...
...
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