def get_z_diff(catalog,label='ab'):
    """Returns an array with redshift differences between two objects
    observed twice, without considering redshifts failures. It also
    returns arrays for redshift confidence and galaxy template"""
    
    unique, repetition = unique_radec(catalog.RA_MAPPING, catalog.DEC_MAPPING, 0.5)
    z_diff   = np.array([])
    z_mean   = np.array([])

    for r_ind in repetition:
        if len(r_ind)>1:
            #print r_ind
            if (label=='a')|(label=='b'):
                good_redshifts = (catalog.ZGAL_FLAG[r_ind] ==label) & (catalog.ZGAL[r_ind]>0)
            
            elif (label =='ab'):
                good_redshifts = (catalog.ZGAL_FLAG[r_ind] !='c') & (catalog.ZGAL[r_ind]>0)
                
            if np.sum(good_redshifts)==2:#only two measurements
                aux1 = np.diff(catalog.ZGAL[r_ind])
                aux2 = np.mean(catalog.ZGAL[r_ind]) 
                z_diff = np.append(z_diff, aux1[0])
                z_mean = np.append(z_mean, aux2)
                
                    
    return z_diff
Exemple #2
0
def get_z_diff(catalog, label='ab'):
    """Returns an array with redshift differences between two objects
    observed twice, without considering redshifts failures. It also
    returns arrays for redshift confidence and galaxy template"""

    unique, repetition = unique_radec(catalog.RA_MAPPING, catalog.DEC_MAPPING,
                                      0.5)
    z_diff = np.array([])
    z_mean = np.array([])

    for r_ind in repetition:
        if len(r_ind) > 1:
            #print r_ind
            if (label == 'a') | (label == 'b'):
                good_redshifts = (catalog.ZGAL_FLAG[r_ind]
                                  == label) & (catalog.ZGAL[r_ind] > 0)

            elif (label == 'ab'):
                good_redshifts = (catalog.ZGAL_FLAG[r_ind] !=
                                  'c') & (catalog.ZGAL[r_ind] > 0)

            if np.sum(good_redshifts) == 2:  #only two measurements
                aux1 = np.diff(catalog.ZGAL[r_ind])
                aux2 = np.mean(catalog.ZGAL[r_ind])
                z_diff = np.append(z_diff, aux1[0])
                z_mean = np.append(z_mean, aux2)

    return z_diff
def get_z_diff_quad(catalog,label='ab'):
    """Returns an array with redshift differences between two objects
    observed twice, without considering redshifts failures. It also
    returns arrays for redshift confidence and galaxy template"""
    
    unique, repetition = unique_radec(catalog.RA_MAPPING, catalog.DEC_MAPPING, 2.0)
    z_diff   = np.array([])
    quad     = np.array([])

    for r_ind in repetition:
        if len(r_ind)>1:
            #print r_ind
            if (label=='a')|(label=='b'):
                good_redshifts = (catalog.ZGAL_FLAG[r_ind] ==label) & (catalog.ZGAL[r_ind]>0)
            
            elif (label =='ab'):
                good_redshifts = (catalog.ZGAL_FLAG[r_ind] !='c') & (catalog.ZGAL[r_ind]>0)
                
            if np.sum(good_redshifts)>=2:
                r_ind2 = np.array(r_ind)
                template = catalog.TEMPLATE[r_ind2[good_redshifts]]
                labels   = catalog.ZGAL_FLAG[r_ind2[good_redshifts]]
                z_gal    = catalog.ZGAL[r_ind2[good_redshifts]]
                for i in range(len(r_ind2[good_redshifts])-1):
                    diff = catalog.ZGAL[r_ind2[good_redshifts]][i]-catalog.ZGAL[r_ind2[good_redshifts]][i+1:]
                    quadrant = catalog.OBJECT[r_ind2[good_redshifts]][i].split('_')[0]
                    for d in diff:
                        z_diff = np.append(z_diff, d)
                        quad   = np.append(quad,quadrant)
    return z_diff,quad
Exemple #4
0
def get_z_diff_quad(catalog, label='ab'):
    """Returns an array with redshift differences between two objects
    observed twice, without considering redshifts failures. It also
    returns arrays for redshift confidence and galaxy template"""

    unique, repetition = unique_radec(catalog.RA_MAPPING, catalog.DEC_MAPPING,
                                      2.0)
    z_diff = np.array([])
    quad = np.array([])

    for r_ind in repetition:
        if len(r_ind) > 1:
            #print r_ind
            if (label == 'a') | (label == 'b'):
                good_redshifts = (catalog.ZGAL_FLAG[r_ind]
                                  == label) & (catalog.ZGAL[r_ind] > 0)

            elif (label == 'ab'):
                good_redshifts = (catalog.ZGAL_FLAG[r_ind] !=
                                  'c') & (catalog.ZGAL[r_ind] > 0)

            if np.sum(good_redshifts) >= 2:
                r_ind2 = np.array(r_ind)
                template = catalog.TEMPLATE[r_ind2[good_redshifts]]
                labels = catalog.ZGAL_FLAG[r_ind2[good_redshifts]]
                z_gal = catalog.ZGAL[r_ind2[good_redshifts]]
                for i in range(len(r_ind2[good_redshifts]) - 1):
                    diff = catalog.ZGAL[r_ind2[good_redshifts]][
                        i] - catalog.ZGAL[r_ind2[good_redshifts]][i + 1:]
                    quadrant = catalog.OBJECT[r_ind2[good_redshifts]][i].split(
                        '_')[0]
                    for d in diff:
                        z_diff = np.append(z_diff, d)
                        quad = np.append(quad, quadrant)
    return z_diff, quad