Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Frida
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coenen, Joachim
Frida
Commits
e47897ab
Commit
e47897ab
authored
13 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
import old scripts from exe/
parent
227c0089
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pub/share/old-conversions/hbfs2rda.rb
+74
-0
74 additions, 0 deletions
pub/share/old-conversions/hbfs2rda.rb
pub/share/old-conversions/wups01a-to-xy
+10
-0
10 additions, 0 deletions
pub/share/old-conversions/wups01a-to-xy
with
84 additions
and
0 deletions
pub/share/old-conversions/hbfs2rda.rb
0 → 100755
+
74
−
0
View file @
e47897ab
#!/usr/bin/ruby
require
'rlib2'
opth
=
scanarg
(
""
,
1
,
1
)
infile
=
ARGV
[
0
]
unless
infile
=~
/(.*)\.hfbs$/
exxx
(
"input file must have extension .hfbs"
)
end
fname
=
$1
outfile
=
fname
+
".a01"
fin
=
File
.
new
(
infile
)
begin
fout
=
File
.
new
(
outfile
,
"r"
)
rescue
else
exxx
(
"outfile already exists"
)
end
fout
=
File
.
new
(
outfile
,
"w"
)
## skip header
unless
fin
.
readline
=~
/^\#Comment/
then
exxx
(
"line 1 invalid"
)
end
while
true
lin
=
fin
.
readline
break
if
lin
=~
/^\# Detector/
end
## read blocks
data
=
[
[]
]
while
lin
=
fin
.
gets
if
lin
=~
/^\# Detector/
data
.
push
[]
next
end
data
[
-
1
].
push
(
lin
.
split
[
1
].
to_f
)
end
## output header
fout
.
printf
(
"ASCII-01 JWu
\n
"
)
fout
.
printf
(
"typ D
\n
"
)
fout
.
printf
(
"fil
#{
fname
}
\n
"
)
fout
.
printf
(
"doc HBFS raw data
\n
"
)
fout
.
printf
(
"x ch
\n
"
)
fout
.
printf
(
"y cnts
\n
"
)
fout
.
printf
(
"z0 det
\n
"
)
fout
.
printf
(
"#j
#{
data
.
size
-
1
}
\n
"
)
## output spectra
ni
=
0
data
[
0
][
1
..-
1
].
each
{
|
y
|
ni
+=
1
if
y!
=
0
}
jout
=
0
data
.
each_with_index
do
|
spec
,
j
|
next
if
j
==
17
fout
.
printf
(
"scn
#{
jout
}
\n
"
)
fout
.
printf
(
"Z 1
\n
"
)
fout
.
printf
(
" %2i
\n
"
,
j
)
fout
.
printf
(
"XY
#{
ni
}
\n
"
)
spec
.
each_with_index
do
|
y
,
i
|
next
if
i
==
0
||
data
[
0
][
i
]
==
0
fout
.
printf
(
"%20.15g %20.15g
\n
"
,
data
[
17
][
i
],
y
)
end
jout
+=
1
end
fout
.
printf
(
"eof
\n
"
)
This diff is collapsed.
Click to expand it.
pub/share/old-conversions/wups01a-to-xy
0 → 100755
+
10
−
0
View file @
e47897ab
#!/usr/bin/env perl
use
strict
;
use
warnings
;
while
(
<>
)
{
if
(
m/z\s*\=\s*(\S+)/
)
{
print
"
$1
\n
";
}
elsif
(
m/pstyle/
)
{}
elsif
(
m/(\S+)\s*(\S+)/
)
{
print
"
$1 $2
\n
";
}
elsif
(
m/^\s*$/
)
{
print
"
\n
";
}
}
\ No newline at end of file
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