From 39ae5e25c07ab23830ffd3a7c3338c8d51a8a00a Mon Sep 17 00:00:00 2001 From: michaelJwilson Date: Fri, 17 Dec 2021 11:15:27 -0800 Subject: [PATCH] LF dependent sch functions. --- gen_gold_lf.py | 3 ++- gen_rand_ddp_N8.py | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gen_gold_lf.py b/gen_gold_lf.py index e796088a..8bd96d90 100644 --- a/gen_gold_lf.py +++ b/gen_gold_lf.py @@ -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) diff --git a/gen_rand_ddp_N8.py b/gen_rand_ddp_N8.py index fdce4c2f..f830637d 100644 --- a/gen_rand_ddp_N8.py +++ b/gen_rand_ddp_N8.py @@ -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) @@ -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)