Question
Write a Python function called integrateSpectrum . The first few lines of its definition are outlined here. Its up to you to fill in the
Write a Python function called
integrateSpectrum
. The first few lines of its definition
are outlined here. Its up to you to fill in the rest of the function with code:
def integrateSpectrum(wavelengths, fluxes, w_lower, w_upper):
"""
This function performs a numerical integral of a spectrum.
Arguments:
wavelengths = a numpy array of wavelengths, in nanometers
fluxes = a numpy array of fluxes, corresponding to w
w_lower = the lower wavelength limit of the integration
w_upper = the upper wavelength limit of the integration
Returns:
the integral of fluxes, with wavelength limits from w_lower to w_upper
(this should be one floating point number)
"""
# now you write the rest
Im having issues on how to write the rest of the function.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started