Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
redpitaya-MCPHA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Günter Quast
redpitaya-MCPHA
Commits
788fe3cc
Commit
788fe3cc
authored
1 year ago
by
Guenter Quast
Browse files
Options
Downloads
Patches
Plain Diff
mcpha: added two lines with meta data to histogram file
parent
0495396f
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
mcpha.py
+7
-2
7 additions, 2 deletions
mcpha.py
with
7 additions
and
2 deletions
mcpha.py
+
7
−
2
View file @
788fe3cc
...
...
@@ -684,12 +684,17 @@ class HstDisplay(QWidget, Ui_HstDisplay):
try
:
dialog
=
QFileDialog
(
self
,
"
Save hst file
"
,
path
,
"
*.hst
"
)
dialog
.
setDefaultSuffix
(
"
hst
"
)
name
=
"
histogram-%s.hst
"
%
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
timestamp
=
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
name
=
"
histogram-%s.hst
"
%
timestamp
dialog
.
selectFile
(
name
)
dialog
.
setAcceptMode
(
QFileDialog
.
AcceptSave
)
if
dialog
.
exec
()
==
QDialog
.
Accepted
:
name
=
dialog
.
selectedFiles
()
np
.
savetxt
(
name
[
0
],
self
.
buffer
,
fmt
=
"
%u
"
,
newline
=
os
.
linesep
)
np
.
savetxt
(
name
[
0
],
self
.
buffer
,
fmt
=
"
%u
"
,
header
=
'
mcpha spectrum
'
+
timestamp
+
'
\n
counts per channel
'
,
newline
=
os
.
linesep
)
self
.
log
.
print
(
"
histogram %d saved to file %s
"
%
((
self
.
number
+
1
),
name
[
0
]))
except
:
self
.
log
.
print
(
"
error: %s
"
%
sys
.
exc_info
()[
1
])
...
...
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