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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!