def scale_image_data(img_header, img_data):
    """ Scales data as one would expect if "do_not_scale_image_data = False" in
    astropy.io.fits. The default behaviour in astropy.io.fits is to
    scale_image_data data automatically. This function provides a way to
    carry out scaling explicitly.

    Sometimes an image is scaled, i.e. the data stored in the file is not the
    image’s physical (true) values, but linearly transformed according to the
    equation:

    physical value = BSCALE * (storage value) + BZERO

    BSCALE and BZERO are stored as keywords of the same names in the header of
    the same HDU. The most common use of scaled image is to store unsigned
    16-bit integer data because FITS standard does not allow it.

    Parameters
    ----------
    img_header :
        Header from the Header Data Unit of a fits file image.
    img_data :  array-like
        Data array from the Header Data Unit of a fits file image.

    Returns
    ----------
    scaled_data: array-like
        The image data after carrying out the scaling transformation.

    """
    bzero, bscale = img_header['BZERO'], img_header['BSCALE']
    scaled_data = bscale * (img_data) + bzero
    return scaled_data