def get_flux(scouseobject, indiv_spec):
    """
    Returns flux for a given spectrum

    Parameters
    ----------
    scouseobject : Instance of the scousepy class
    indiv_spec : Instance of the fit class
        the spectrum to be fit, produced by prep spec
    """
    y=scouseobject.cube[:,indiv_spec.coordinates[0],indiv_spec.coordinates[1]]
    y=y[scouseobject.trimids]
    return y