if not opts.input_file: parser.error('Input filename not provided.') if (not opts.ra_bin) or (not opts.dec_bin): parser.error('Number of RA or Dec bins not provided.') if (opts.ra_bin == 1) and (opts.dec_bin == 1): parser.error('Number of RA or Dec bins must be greater than one.') #Check for errors errors.file_name_error(opts.input_file) #Read catalogue print 'Reading data from ' + opts.input_file if opts.input_type == 'fits': catalogue = fileio.read_fits(opts.input_file) else: catalogue = fileio.read_ascii(opts.input_file) id = np.array(catalogue[opts.id_col - 1, :]) ra = np.array(catalogue[opts.ra_col - 1, :], dtype="float") dec = np.array(catalogue[opts.dec_col - 1, :], dtype="float") z = np.array(catalogue[opts.z_col - 1, :], dtype="float") if opts.mode == 'phot': dz = np.array(catalogue[opts.dz_col - 1, :], dtype="float") #Set bin sizes if opts.ra_lower == None: opts.ra_lower = min(ra) if opts.ra_upper == None: opts.ra_upper = max(ra) if opts.dec_lower == None: opts.dec_lower = min(dec)
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 # ############# #make sure files exit errors.file_name_error(opts.input_file) #read input file print 'Reading file:', opts.input_file if opts.input_type == 'fits': data = fileio.read_fits(opts.input_file) else: data = fileio.read_ascii(opts.input_file) ################ # SET DEFAULTS # ################ all_gal_z = np.array(data[opts.z_col - 1]).astype('float') #set redshift limits if not opts.z_min or not opts.z_max: if not opts.z_min: opts.z_min = np.min(all_gal_z) if not opts.z_max: opts.z_max = np.max(all_gal_z) #restrict data to redshift limits