コード例 #1
0
print("You'll use")
print("NSIDE      : {} (2**{})".format(params['NSIDE'], nside))
del nside, nside_max
strips = pixels
len_strips = len(strips)
print("\n\n")
time0 = time()
for num, pix in enumerate(strips):
    timei = time()
    theta, phi = hp.pix2ang(params['NSIDE'], pix, lonlat=True, nest=False)

    params['pixel'] = pix

    if not ver.exist_or_not_file(params, restart):
        print(ver.exist_or_not_file(params, restart))
        tab, job = qr.query_function(params, constraints)
        tab = gal.galaxies_pixel(tab, params)
        if params_flags['use']:
            tab = fl.flags_constraints(tab, hexa_query, params_flags)

        timef = strftime('%H:%M:%S', gmtime(time() - timei))

        print("Program's time (hh:mm:ss): {}".format(timef))
        print("Pixel {}".format(pix))

        if len(tab) > 0: wr.write_fits(tab, params)
        else: print("Not save. 0 galaxies")
        print("\n\n")

print("End Programm: {0}".format(time0 - time()))
コード例 #2
0
else:
    print('Exist\nReading\n')
    read = np.loadtxt('PIXELS/PixelList.txt')
    pixel = pd.DataFrame(read, columns=['HPIX_' + str(params['NSIDE'])])
    strips = pixel['HPIX_' + str(params['NSIDE'])].astype(int)
    len_strips = len(strips)

print("\n\n")
time0 = time()
for num, pix in enumerate(strips):
    timei = time()
    theta, phi = hp.pix2ang(params['NSIDE'], pix, lonlat=True, nest=False)

    params['pixel'] = pix

    if not ver.exist_or_not_file(params, restart):
        print(ver.exist_or_not_file(params, restart))
        tab = qr.query_function(params)

        timef = strftime('%H:%M:%S', gmtime(time() - timei))

        print("Program's time (hh:mm:ss): {}".format(timef))
        print("Pixel {}".format(pix))
        params['pixel'] = hp.nest2ring(params['NSIDE'], pix)
        if len(tab) > 0: wr.write_fits(tab, params)
        else: print("Not save. 0 galaxies")

        print("\n\n")

print("End Programm: {0}".format(time0 - time()))