Beispiel #1
0
def int_radius(data, cent, val_min):
    """
    Returns an array of the intensity at different radii out from the centre of an object
    Inputs: data = the image data (2D numpy array), cent = the centre point of the object (list or tuple length 2),
            val_min = minimum threshold for radius of object (int)
    Output: intensity = list of intensities for increasing radius from centre (1D numpy array)
    """
    val = data[tuple(cent)]
    rad = 0
    #finding max radius for calculating intensity
    while val >= val_min:
        #need to make sure we don't get infinity
        if rad >= 20:
            break
        val = data[cent[0], cent[1]+rad]
        rad += 1
    intensity = []
    #find intensity within circle of each radius
    for r in range(1, rad+1):
        flux, N = circ_apt_flux(data, cent, r*2)
        I_r = flux/N
        intensity.append(I_r)
    return np.array(intensity)
Beispiel #2
0
    for i in range(0, len(pointsx)):
        """
        loops through all entries in the points csv file and appends their values to the catalogue
        """
        x = int(pointsx[i])
        y = int(pointsy[i])
        #slice a section of the total image around each source to carry out flux analysis. For this, the point cannot lie too close to the edge.
        if x > 100 and y > 100 and x < (len(data[0]) - 100) and y < (
                len(data) - 100):  #cuts off edge noise within 100 pixels
            index_y.append(y)
            index_x.append(x)
            data_set = data[int(y - 15):int(y + 15), int(x - 15):int(x + 15)]
            centre = np.array(
                [14.0, 14.0])  #the centre is fixed due to the sliced section
            i_tot_flux, N = circ_apt_flux(data_set, centre, apt_size)
            tot_flux.append(i_tot_flux)  #find individual total flux
            i_err_tot_flux = np.sqrt(i_tot_flux)
            err_tot_flux.append(
                i_err_tot_flux)  #individual error in total flux
            i_loc_backgrnd, Na = ann_ref(data_set, centre, apt_size, ann_size)
            loc_backgrnd.append(i_loc_backgrnd)  #individual background
            i_source_flux = flux(data_set, centre, apt_size, ann_size)
            source_flux.append(i_source_flux)  #individual source flux
            i_mag = header["MAGZPT"] - 2.5 * np.log10(i_source_flux)
            mag.append(i_mag)  #individual apparent magnitude
            i_m_err = np.sqrt((header["MAGZRR"])**2 + (25 /
                                                       (4 * np.log(10)**2)) *
                              ((i_tot_flux + i_loc_backgrnd / Na) /
                               (i_source_flux**2)))
            m_err.append(i_m_err)  #individual error in m