def METHOD_NAME(img, mask, label):
    """This extracts the hyperspectral reflectance values of each pixel.
    Inputs:
    img          = Hyperspectral data instance
    mask         = Binary mask made from selected contours
    label        = optional label parameter, modifies the variable name of observations recorded
    Returns:
    analysis_img = output image
    :param array: __main__.Spectral_data
    :param mask: numpy array
    :param histplot: bool
    :param label: str
    :return img: plantcv.plantcv.Spectral_data
    """
    array_data = img.array_data
    # List of wavelengths recorded created from parsing the header file will be string, make list of floats
    wavelength_data = array_data[np.where(mask > 0)]
    # Calculate mean reflectance across wavelengths
    wavelength_means = wavelength_data.mean(axis=0)
    max_per_band = wavelength_data.max(axis=0)
    min_per_band = wavelength_data.min(axis=0)
    std_per_band = wavelength_data.std(axis=0)
    # Create lists with wavelengths in float format rather than as strings
    # and make a list of the frequencies since they are in an array
    new_wavelengths = []
    band_averages = []
    new_std_per_band = []
    new_max_per_band = []
    new_min_per_band = []
    for i, wavelength in enumerate(img.wavelength_dict):
        new_wavelengths.append(wavelength)
        band_averages.append((wavelength_means[i]).astype(float))
        new_std_per_band.append(std_per_band[i].astype(float))
        new_max_per_band.append(max_per_band[i].astype(float))
        new_min_per_band.append(min_per_band[i].astype(float))
    # Calculate reflectance statistics
    avg_reflectance = np.average(wavelength_data)
    std_reflectance = np.std(wavelength_data)
    median_reflectance = np.median(wavelength_data)
    wavelength_labels = []
    for i in img.wavelength_dict.keys():
        wavelength_labels.append(i)
    # Store data into outputs class
    outputs.add_observation(sample=label, variable='global_mean_reflectance', trait='global mean reflectance',
                            method='plantcv.plantcv.analyze.spectral_reflectance', scale='reflectance',
                            datatype=float, value=float(avg_reflectance), label='reflectance')
    outputs.add_observation(sample=label, variable='global_median_reflectance', trait='global median reflectance',
                            method='plantcv.plantcv.analyze.spectral_reflectance', scale='reflectance',
                            datatype=float, value=float(median_reflectance), label='reflectance')
    outputs.add_observation(sample=label, variable='global_spectral_std',
                            trait='pixel-wise standard deviation per band',
                            method='plantcv.plantcv.analyze.spectral_reflectance', scale='None', datatype=float,
                            value=float(std_reflectance), label='reflectance')
    outputs.add_observation(sample=label, variable='wavelength_means', trait='mean reflectance per band',
                            method='plantcv.plantcv.analyze.spectral_reflectance', scale='reflectance', datatype=list,
                            value=band_averages, label=wavelength_labels)
    outputs.add_observation(sample=label, variable='max_reflectance', trait='maximum reflectance per band',
                            method='plantcv.plantcv.analyze.spectral_reflectance', scale='reflectance', datatype=list,
                            value=new_max_per_band, label=wavelength_labels)
    outputs.add_observation(sample=label, variable='min_reflectance', trait='minimum reflectance per band',
                            method='plantcv.plantcv.analyze.spectral_reflectance', scale='reflectance', datatype=list,
                            value=new_min_per_band, label=wavelength_labels)
    outputs.add_observation(sample=label, variable='spectral_std', trait='pixel-wise standard deviation per band',
                            method='plantcv.plantcv.analyze.spectral_reflectance', scale='None', datatype=list,
                            value=new_std_per_band, label=wavelength_labels)
    return img