예제 #1
0
    # Set whether we have multiple timesteps for each set
    if timesteps is 'last':
        multi_timesteps = False
    else:
        multi_timesteps = True

    fiducials, designs, timesteps_labels = \
        files_sorter(PREFIX, timesteps=timesteps,
                     append_prefix=True)

    if MULTICORE:

        use_mpi = False
        if use_mpi:
            pool = MPIPool(loadbalance=False)

            if not pool.is_master():
                # Wait for instructions from the master process.
                pool.wait()
                sys.exit(0)
        else:
            from multiprocessing import Pool
            # Default to 10 for now. Will change if this works.
            pool = Pool(processes=10)
    else:
        pool = None

    if fiducial_num == "fid_comp":  # Run all the comparisons of fiducials

        print "Fiducials to compare %s" % (fiducials[face].keys())
    else:
        cube_output = output_folder

    # Grab all of the fits files
    fits_files = glob.glob(folder+"*.fits")

    # Trying noise levels scaled by their brightness distribs
    if add_noise:
        rms_noise = 'scaled'
    elif is_obs:
        rms_noise = None
    else:
        rms_noise = 0.001

    np.random.seed(248954785)

    pool = MPIPool(loadbalance=False)

    if not pool.is_master():
        # Wait for instructions from the master process.
        pool.wait()
        sys.exit(0)

    pool.map(single_input, zip(fits_files,
                               repeat(add_noise),
                               repeat(rms_noise),
                               repeat(output_folder),
                               repeat(cube_output)))

    pool.close()
예제 #3
0
    # Set whether we have multiple timesteps for each set
    if timesteps is 'last':
        multi_timesteps = False
    else:
        multi_timesteps = True

    fiducials, designs, timesteps_labels = \
        files_sorter(PREFIX, timesteps=timesteps,
                     append_prefix=True)

    if MULTICORE:

        use_mpi = False
        if use_mpi:
            pool = MPIPool(loadbalance=False)

            if not pool.is_master():
                # Wait for instructions from the master process.
                pool.wait()
                sys.exit(0)
        else:
            from multiprocessing import Pool
            # Default to 10 for now. Will change if this works.
            pool = Pool(processes=10)
    else:
        pool = None

    if fiducial_num == "fid_comp":  # Run all the comparisons of fiducials

        print "Fiducials to compare %s" % (fiducials[face].keys())