Skip to content

Commit

Permalink
Add desi grab.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelJwilson committed Dec 17, 2021
1 parent a46a3b0 commit b416fba
Show file tree
Hide file tree
Showing 2 changed files with 348 additions and 0 deletions.
13 changes: 13 additions & 0 deletions desi.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def tile2rosette(tile):
# e.g. 280/28027/redrock-sv3-bright-28027.fits
tabs = []

print('Gathering DESI zs.')

for x in fpaths:
zbest = Table.read(x, hdu='REDSHIFTS')
fmap = Table.read(x, hdu='FIBERMAP')
Expand Down Expand Up @@ -78,6 +80,8 @@ def tile2rosette(tile):
# DESI
c = SkyCoord(ra=desi_zs['TARGET_RA']*u.degree, dec=desi_zs['TARGET_DEC']*u.degree)

print('Matching DESI to GAMA Gold.')

# GAMA
catalog = SkyCoord(ra=gold['RA'], dec=gold['DEC'])
idx, d2d, d3d = c.match_to_catalog_3d(catalog)
Expand All @@ -88,5 +92,14 @@ def tile2rosette(tile):
desi_zs = hstack([desi_zs, gold_match])
desi_zs['GAMA_SEP'] = d2d

max_sep = 1.0 * u.arcsec

print(np.mean(desi_zs['GAMA_SEP'] < max_sep))

opath = fpath.replace('gama', 'desi')

print('Writing {}'.format(opath))

desi_zs.write(opath, format='fits', overwrite=True)

print('Done.')
Loading

0 comments on commit b416fba

Please sign in to comment.