Exporting Peak Parameters

299 views
Skip to first unread message

Alex H

unread,
Sep 5, 2019, 2:55:45 PM9/5/19
to fityk-users
When I export the peak parameters, they look like the image. Is there a way to make it look like a nice columned text file without all the duplicate header lines and spaces in between? This is a huge pain to go through and get the useful data when I have 100 or more peaks I need to look at. I am exporting one to peak from multiple data sets so that might be why it looks weird. If anyone has a solution to this, please let me know. I am not great with writing or using scripts but I can learn if I need to. Thanks. 


2019-09-05 11_31_57-C6_Cu_peak.peaks - Notepad.png

Valentín Alba Aparicio

unread,
Sep 6, 2019, 7:46:03 AM9/6/19
to fityk-users
You can use the function info in conjuction with the argument peaks in the command line in order to create a tab separated file.

For example,

info peaks

or

info peaks > /home/valentin/peaks.txt

As shown in the attached picture.

I hope it helps.
Screenshot from 2019-09-06 13-39-12.png

Alex H

unread,
Sep 6, 2019, 3:04:44 PM9/6/19
to fityk-users
I am looking at multiple data sets. When I have more than one peak on a single data set it shows a tab separated file, but not when I want to export peak info from multiple data sets at one time. What I'm trying to do is track a few peaks in multiple data sets. But the data files always look like what I showed earlier.
2019-09-06 12_01_01-Amazon Music.png

Valentín Alba Aparicio

unread,
Sep 7, 2019, 4:53:15 AM9/7/19
to fityk-users
Exporting peak data givess the same results as the following commands:

@*: info peaks

or

@*: lua F:execute("info peaks >>'peaks.txt'")

As far as I know, you can't avoid printing header lines per file.

You could use a sed script in a shell to get rid of undesirable lines once the peaks file is exported:

$ cat peaks.txt
# PeakType    Center    Height    Area    FWHM    parameters...
%_1  VoigtA    1320.52    3.1331    105.127    30.1162     105.127 1320.52 16.9704 0.1

# PeakType    Center    Height    Area    FWHM    parameters...
%_2  VoigtA    1320.52    3.13303    105.124    30.1162     105.124 1320.52 16.9704 0.1

# PeakType    Center    Height    Area    FWHM    parameters...
%_3  VoigtA    1320.52    3.1331    105.127    30.1162     105.127 1320.52 16.9704 0.1

# PeakType    Center    Height    Area    FWHM    parameters...
%_4  VoigtA    1027.15    1.68812    42.4811    22.5868     42.4811 1027.15 12.7276 0.1

$ sed -i.bak '/^#/d; /^$/d' peaks.txt

$ cat peaks.txt
%_1  VoigtA    1320.52    3.1331    105.127    30.1162     105.127 1320.52 16.9704 0.1
%_2  VoigtA    1320.52    3.13303    105.124    30.1162     105.124 1320.52 16.9704 0.1
%_3  VoigtA    1320.52    3.1331    105.127    30.1162     105.127 1320.52 16.9704 0.1
%_4  VoigtA    1027.15    1.68812    42.4811    22.5868     42.4811 1027.15 12.7276 0.1

Please, remember than first column in the file %_n corresponds to channel #(n-1)

I hope it helps

Rafa

unread,
Sep 14, 2019, 2:39:18 PM9/14/19
to fityk-users
Thank you Valentin

I don't get to do "$ sed -i.bak '/^#/d; /^$/d' peaks.txt " I suppose that this comand is for Linux. Are there any similar command in windows?

I read in one post that
"p title, '%f1', %f1.center, %f1.FWHM, %f1.Area, %f1.Height,  '%f2', %f2.center, %f2.FWHM, %f2.Area, %f2.Height >> '{{ FILE_OUT }}'
where {{ FILE_OUT }} is destination file"

But It doesn't work.

Valentín Alba Aparicio

unread,
Sep 19, 2019, 3:59:20 AM9/19/19
to fityk-users
If you are using MS-Windows, you can get sed from the following link: Sed for Windows

I hope it helps.

Rafael Barea Del Cerro

unread,
Sep 20, 2019, 10:45:21 AM9/20/19
to fityk...@googlegroups.com

Gracias!

Thank you

--
http://groups.google.com/group/fityk-users
---
You received this message because you are subscribed to a topic in the Google Groups "fityk-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fityk-users/yhrnZTLEKEQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fityk-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fityk-users/4c24a64d-31e6-45f3-bdaa-b437182ceddb%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages