Esempio n. 1
0
def gal_count(clusters):
    """
    Function that computes the total number of galaxies in clusters.
    """
    sum = 0
    for x in clusters:
        sum += x.ngal
    return sum


# Read Arguments:

parser = optparse.OptionParser()
options.multiple_input(parser)
options.single_output(parser)
options.merge(parser)
(opts, args) = parser.parse_args()

if not opts.input_files and not opts.input_file_list:
    parser.error('Input filename(s) not provided.')
if not opts.output_file:
    parser.error('Output filename not provided.')
if not opts.bg_expect:
    parser.error('Expected background density not provided.')

# Read List of Files:

if opts.input_file_list:
    errors.file_name_error(opts.input_file_list)
    file_list = np.genfromtxt(opts.input_file_list, dtype="S", unpack=True)
elif opts.input_files:
Esempio n. 2
0
        cluster_list[i].unique()
        cluster_list[i].props(None)
        if cluster_list[i].ngal < opts.min_mem:
            del cluster_list[i]
    return cluster_list

##################
# READ ARGUMENTS #
##################

parser = optparse.OptionParser()
options.single_input(parser)
options.single_output(parser)
options.cosmo(parser)
options.fof(parser)
options.merge(parser)
(opts, args) = parser.parse_args()
  
if not opts.input_file:
    parser.error('Input file name not provided.')
if not opts.output_file:
    opts.output_file = opts.input_file + '_clusters.dat'
if not opts.link_r:
    parser.error('Transverse linking length not provided.')
if not opts.link_z:
    parser.error('Line-of-sight linking length not provided.')
    
#############
# READ DATA #
#############