Esempio n. 1
0
def visibility2dTo1d(tel_tracks, visibility_func, x_0, y_0):
    """
    Take the tracks generated from a 2D airy disk curve and convert them into a 1D airy disk curve
    :param x_0: The x cfoordinate 0 point of the visibility model
    :param y_0: The y coordinate 0 point of the visibility model
    :param tel_tracks: The tracks from the 2D airy disk
    :param visibility_func: The 2D visibility function used to generate the tracks
    :return: The radial x values, The amplitude at those radii, average integrated radial x values, the average
    integrated amplitude at those raddi
    """
    amps = []
    rads = []
    avg_amps = []
    avg_rads = []

    for i, track in enumerate(tel_tracks):
        try:
            utrack = track[0][:, 0] + x_0
        except:
            adsf = 34
        vtrack = track[0][:, 1] + y_0
        amps.append(visibility_func(utrack, vtrack))
        rads.append(np.sqrt((utrack - x_0)**2 + (vtrack - y_0)**2))
        airy_avg = IItools.trapezoidal_average(num_f=amps[i])
        avg_rad = IItools.trapezoidal_average(num_f=rads[i])
        avg_amps.append(airy_avg)
        avg_rads.append(avg_rad)
    return np.array(rads), np.array(amps), np.array(avg_rads), np.array(
        avg_amps)
Esempio n. 2
0
 def airy_avg(xr, r):
     mod_Int = np.array(
         [IItools.trapezoidal_average(airy1D(rad, r)) for rad in rads])
     return mod_Int.ravel()