How to calculate area under the curve of the data

360 views
Skip to first unread message

Reinaldo Chacon

unread,
Apr 8, 2020, 10:51:42 AM4/8/20
to fityk-users
Hello

   I have doubts about calculating the area under the curve of my dataset in certain ranges. darea does not seem to work so well.
  Best regards,
  Reinaldo

Marcin Wojdyr

unread,
Apr 8, 2020, 10:54:35 AM4/8/20
to fityk...@googlegroups.com
> I have doubts about calculating the area under the curve of my dataset in certain ranges. darea does not seem to work so well.

Could you be more specific? What exactly means that it works not so well?

Reinaldo Chacon

unread,
Apr 8, 2020, 12:33:34 PM4/8/20
to fityk...@googlegroups.com
Hello,

     See the spectrum below. I want to calculate the area of each peak. What I tried to do was to activate the data points that I wanted. When I do that the output windows tells me that a range e.g. @0: A = a and not (495.5 < x and x < 507.4) for the first peak. Then I tried 'p darea(A)' and I obtain a number in this case 6.38795 which I suppose is the area in that range.
 
FullSpectra.png
The number I obtain from the peak at the right of 550 nm is roughly the same as the peak at the left of 600, (10.3731 and 14.643 respectively), when I was expecting at least three times larger.  I am using the wrong function for this?
Thank you.
Best regards,
Reinaldo

On Wed, Apr 8, 2020 at 4:54 PM Marcin Wojdyr <woj...@gmail.com> wrote:
>    I have doubts about calculating the area under the curve of my dataset in certain ranges. darea does not seem to work so well.

Could you be more specific? What exactly means that it works not so well?

--
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/CACaHzQXEWG1OC5sAtQ-dU4fxSO5Ag6J_4HhFUX7kW-Lsx5JiEg%40mail.gmail.com.


--
Reinaldo Chacon

Marcin Wojdyr

unread,
Apr 8, 2020, 12:45:40 PM4/8/20
to fityk...@googlegroups.com
Hi Reinaldo,
you can calculate area under active points with:
p darea(y if a)
Alternatively, you can specify x-axis range with:
p darea(y if x > 550 and x < 570)


On Wed, 8 Apr 2020 at 18:33, Reinaldo Chacon <evil...@gmail.com> wrote:
>
> Hello,
>
> See the spectrum below. I want to calculate the area of each peak. What I tried to do was to activate the data points that I wanted. When I do that the output windows tells me that a range e.g. @0: A = a and not (495.5 < x and x < 507.4) for the first peak. Then I tried 'p darea(A)' and I obtain a number in this case 6.38795 which I suppose is the area in that range.
>
>
> The number I obtain from the peak at the right of 550 nm is roughly the same as the peak at the left of 600, (10.3731 and 14.643 respectively), when I was expecting at least three times larger. I am using the wrong function for this?
> Thank you.
> Best regards,
> Reinaldo
>
> On Wed, Apr 8, 2020 at 4:54 PM Marcin Wojdyr <woj...@gmail.com> wrote:
>>
>> > I have doubts about calculating the area under the curve of my dataset in certain ranges. darea does not seem to work so well.
>>
>> Could you be more specific? What exactly means that it works not so well?
>>
>> --
>> 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/CACaHzQXEWG1OC5sAtQ-dU4fxSO5Ag6J_4HhFUX7kW-Lsx5JiEg%40mail.gmail.com.
>
>
>
> --
> Reinaldo Chacon
>
> --
> 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/CADYE%3DvTQu1jUjKD9HZ%2BO8WuTprOqFRtukj22aTYV-zp8sWo3Dw%40mail.gmail.com.

Reinaldo Chacon

unread,
Apr 8, 2020, 12:53:08 PM4/8/20
to fityk...@googlegroups.com
Thank you very much.
It seems I learned how to do it.




--
Reinaldo Chacon
Reply all
Reply to author
Forward
0 new messages