-
Notifications
You must be signed in to change notification settings - Fork 0
/
CANDELS_Combining_Fields_SFR.py
34 lines (28 loc) · 1.47 KB
/
CANDELS_Combining_Fields_SFR.py
1
from astropy.table import vstack, Tablefrom astropy.io import asciifields = ['COSMOS', 'EGS', 'GOODSN', 'GOODSS', 'UDS']SFR_Combined_Fields = Table()for each_field in fields: catalog = ascii.read('/Users/laurenhiggins/Dropbox/GEG_Research/Key_Parameters_Catalogs_Per_Field/Star_Formation_Rate_Catalogs_old/CANDELS.%s.F160W.v1.IRUV_SFRs.cat'%each_field) SFR_subset = catalog[['id','flag_prox', 'flag_lum', 'id_mips', 'sfr_best', 'sfr_flag']] SFR_subset['Field_flag'] = each_field SFR_Combined_Fields = vstack([SFR_Combined_Fields, SFR_subset])ascii.write(SFR_Combined_Fields, '/Users/laurenhiggins/Dropbox/GEG_Research/Key_Parameters_Catalogs_Per_Field/Star_Formation_Rate_Catalogs_old/CANDELS.ALL.FIELDS.F160W.v1.IRUV_SFRs.cat', names=('id', 'flag_prox', 'flag_lum', 'id_mips', 'sfr_best', 'sfr_flag', 'Field_Flag'), format='csv', overwrite=True)'''2. id3. flag_prox4. flag_lum6. id_mips8. sfr_best7. sfr_flag''''''for each_field in fields: catalog = ascii.read('/Users/laurenhiggins/Dropbox/GEG_Research/Key_Parameters_Catalogs_Per_Field/Star_Formation_Rate_Catalogs_old/CANDELS.%s.F160W.v1.IRUV_SFRs.cat'%each_field) SFR_subset = Table(catalog[['id','flag_prox', 'flag_lum', 'id_mips', 'sfr_best', 'sfr_flag']], names=('id','flag_prox', 'flag_lum', 'id_mips', 'sfr_best', 'sfr_flag')) SFR_subset['Field_flag'] = each_field SFR_Combined_Fields = vstack([SFR_subset]) print(SFR_Combined_Fields.dtype)print(SFR_Combined_Fields)'''