def getAgnData(hd_agn, agn_FX_soft, redshift_limit):
    """
    Function to get the relavant data for AGNs
    @hd_agn :: table file with all relevant info on AGNs
    @AGN_FX_soft, AGN_SDSS_r_magnitude :: limits on flux, and brightness to be classified as an AGN
    @redshift_limit :: decides until which AGNs to consider in the sample
    --> typically, we are interested in the low-z universe for this project
    
    Returns:: @pos_z :: positions (ra, dec) and redshifts of the downsampled AGNs
    """
    # criteria on flux and brightness for selection of AGNs 
    downsample_agn = (hd_agn['FX_soft']>agn_FX_soft) & (hd_agn['redshift_R']<redshift_limit)
    
    # get the ra, dec and z for the AGNs
    ra_AGN = hd_agn['RA'][downsample_agn]
    dec_AGN = hd_agn['DEC'][downsample_agn]
    z_AGN = hd_agn['redshift_R'][downsample_agn]
    pos_z = [ra_AGN, dec_AGN, z_AGN]
    
    # scale factor of last major merger
    scale_merger = hd_agn['HALO_scale_of_last_MM'][downsample_agn]
    
    return pos_z, scale_merger, downsample_agn