Skip to content

Commit

Permalink
LF dependent sch functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelJwilson committed Dec 17, 2021
1 parent b416fba commit 39ae5e2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gen_gold_lf.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@ def process_cat(fpath, vmax_opath):

print()
print(ddp_fpath)
print(ddp_opath)

process_cat(fpath, ddp_opath)
process_cat(ddp_fpath, ddp_opath)
15 changes: 14 additions & 1 deletion gen_rand_ddp_N8.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
from astropy.table import Table
from scipy.spatial import KDTree
from cartesian import cartesian
from delta8_limits import dd8_limits, delta8_tier


field = 'G9'
realz = 0

fpath = os.environ['CSCRATCH'] + '/norberg/GAMA4/gama_gold_ddp_n8.fits'
dat = Table.read(fpath)
#dat = dat[:1000]
# dat = dat[:1000]

fpath = os.environ['CSCRATCH'] + '/desi/BGS/Sam/randoms_bd_{}_{:d}.fits'.format(field, realz)
rand = Table.read(fpath)
Expand All @@ -38,6 +40,17 @@

rand['DDP{:d}_N8'.format(ddp_idx)] = np.array([len(idx) for idx in indexes_ddp])

# HACK: can be removed after full randoms run through.
rand.meta['NRAND8'] = 1072.33029242

rand['FILLFACTOR'] = rand['N8'] / rand.meta['NRAND8']

rand['DDP1_DELTA8'] = (rand['DDP1_N8'] / (dat.meta['VOL8'] * dat.meta['DDP1_DENS']) / rand['FILLFACTOR']) - 1.
rand['DDP2_DELTA8'] = (rand['DDP2_N8'] / (dat.meta['VOL8'] * dat.meta['DDP2_DENS']) / rand['FILLFACTOR']) - 1.
rand['DDP3_DELTA8'] = (rand['DDP3_N8'] / (dat.meta['VOL8'] * dat.meta['DDP3_DENS']) / rand['FILLFACTOR']) - 1.

rand['DDP1_DELTA8_TIER'] = delta8_tier(rand['DDP1_DELTA8'])

print('Writing {}'.format(fpath.replace('bd', 'bd_ddp_n8')))

rand.write(fpath.replace('bd', 'bd_ddp_n8'), format='fits', overwrite=True)

0 comments on commit 39ae5e2

Please sign in to comment.