'Integrating a curve in python between two points

I need to integrate a curve I created using data points because I want to find the value in a particular region. So, I want to integrate it only between two points. scipy.trapz doesn't take endpoints. scipy.integrate doesn't let me do that because my x-axis is not as simple as linspace(a, b, n). Is there any way I could still integrate between just two points? The brute force way of defining an interval between those two points won't work because my function is created from interpolating over the range.

To be clearer, my function is the flux sed and my x-axis is the wavelength. In my integration, I will convert wavelength to frequency, but I'm not sure how to do the integration itself with the limits.

Thank you so much!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source