Fitting a curve then subtracting that curve

199 views
Skip to first unread message

Alex H

unread,
Aug 11, 2020, 10:58:21 PM8/11/20
to fityk-users
I'm trying to fit a polynomial curve to my data and then subtract it from the data. Each set of data I have has a slightly different background so I want to fit a function to each one and then subtract the individual background from each. If possible, I would like to make a script for it so I can batch process the data since I can have many data sets per experiment. I have close to zero background in programming so it might be difficult for me which is why I need help. Below is me figuring out how to write a script for making a polynomial for each data set and fitting it. I just don't know the rest of it. Would anyone know how to subtract a function from your data set and each data set has a different function to subtract? From there, I will hopefully be able to figure out the rest of the data analysis. Thank you to anyone who can help.

@*: guess Polynomial6
@*: fit

Alexander Selyutin

unread,
Aug 12, 2020, 2:12:46 AM8/12/20
to fityk...@googlegroups.com
If you use only one function to use that.
@*: guess Polynomial6
@*: fit
@*: Y=Y-F(x)

if you use several functions and only one of that you want to subtract you should use a half automatic method.
@*: guess Polynomial6
@*: fit
create function that fit your "information data" (you can use another function type or more functions with another initial fit parameters)
@*: guess PseudoVoigtA(height=~397.3, center=~39.99, area=~460.868, hwhm=~0.58)
@*: guess AnotherFunctions
@*: fit

after that you should remove "information" functions by using mouse in functions panel in GUI - that is easy because functions placed with order of creation
and remove background
@*: Y=Y-F(x)


--
Regards,
Alexander Selyutin
Message has been deleted

Alex H

unread,
Aug 12, 2020, 6:51:10 PM8/12/20
to fityk-users
Alexander,

Would I be able to write it into the script to delete that polynomial function once I am done with it? 

Alexander Selyutin

unread,
Aug 13, 2020, 2:00:14 AM8/13/20
to fityk...@googlegroups.com
I dont know how to remove functions by batch processing, only by name "delete @1, @2 ,@3 "etc If functions are created by script it's not difficult to use mouse selection and deleting

чт, 13 авг. 2020 г. в 05:51, Alex H <dabrai...@gmail.com>:
Alexander,

Would I be able to write it into the script to delete that polynomial function once I am done with it? 

--
http://groups.google.com/group/fityk-users
---
You received this message because you are subscribed to the Google Groups "fityk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fityk-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fityk-users/43e6e88f-00c0-4c01-a7f2-63e6251e53f4o%40googlegroups.com.


--
Regards,
Alexander Selyutin
Reply all
Reply to author
Forward
0 new messages