예제 #1
0
    else:
        hdul = fits.open(args.data)
        data = pd.DataFrame(hdul[1].data)

    if args.signal_table is not None:
        signal_pts = pd.read_hdf(args.signal, args.signal_table)
    else:
        hdul = fits.open(args.signal)
        signal_pts = pd.DataFrame(hdul[1].data)

    signal_columns = args.signal_columns
    if signal_columns is None:
        signal_columns = signal_pts.columns
    
    signal_filter = PointFilter(
        signal_pts,
        filtered_columns=signal_columns,
        sigma_vec=np.repeat(0.2, len(signal_columns)))

    dsr = data
    weights = signal_filter.get_weights(dsr)

    dsr['weights'] = weights
    dsr.to_hdf('output.h5', 'photometry')

    if args.create_image is not None:
        out_img = cubeify(
            dsr,
            n=(int(args.nra), int(args.ndec)),
            columns=['RA', 'DEC'],
            target='weights')
예제 #2
0
    else:
        hdul = fits.open(args.signal)
        signal_pts = pd.DataFrame(hdul[1].data)

    if args.noise_table is not None:
        noise_pts = pd.read_hdf(args.noise, args.noise_table)
    else:
        hdul = fits.open(args.noise)
        noise_pts = pd.DataFrame(hdul[1].data)

    signal_columns = args.signal_columns
    if signal_columns is None:
        signal_columns = signal_pts.columns

    signal_filter = PointFilter(
        signal_pts,
        filtered_columns=signal_columns,
        sigma_vec=np.repeat(0.2, len(signal_columns)))

    noise_filter = PointFilter(
        noise_pts,
        filtered_columns=signal_columns,
        sigma_vec=np.repeat(0.2, len(signal_columns)))

    print('fitering')
    dsr = data
    print('signal')
    signal_weights = signal_filter.get_weights(dsr)
    print('noise')
    noise_weights = noise_filter.get_weights(dsr)
    weights = signal_weights - noise_weights