Skip to content

Commit

Permalink
added changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsh-um committed Apr 22, 2024
1 parent 1ff8ad2 commit 1742b93
Show file tree
Hide file tree
Showing 3 changed files with 600 additions and 16 deletions.
21 changes: 6 additions & 15 deletions py/LSS/cosmodesi_io_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,41 +253,32 @@ def get_clustering_positions_weights(catalog, distance, zlim=(0., np.inf),maglim
print('multiplying weights by WEIGHT_focal')

if name == 'data' and 'bitwise' in weight_type:
print("Doing bitwise")
if 'default' in weight_type:
<<<<<<< HEAD
weights /= catalog['WEIGHT_COMP'][mask]
print('dividing weights by WEIGHT_COMP')
=======
#weights /= catalog['WEIGHT_COMP'][mask]
weights = catalog['WEIGHT_SYS'][mask]*catalog['WEIGHT_ZFAIL'][mask]#/(129/(1+128*catalog['PROB_OBS'][mask]))
#print('dividing weights by WEIGHT_COMP')
>>>>>>> main
print("Doing default bitwise")
weights = _format_bitweights(catalog['BITWEIGHTS'][mask]) + [weights]
if name == 'data' and 'IIP' in weight_type:
weights = 129/(1+128*catalog['PROB_OBS'][mask])
#weights = 129/(1+128*catalog['PROB_OBS'][mask])
print("Doing IIP")
weights = catalog['WEIGHT_IIP'][mask]
if 'default' in weight_type:
#weights /= catalog['WEIGHT_COMP'][mask]
print("Doing default IIP.")
weights *= catalog['WEIGHT_SYS'][mask]*catalog['WEIGHT_ZFAIL'][mask]

if name == 'randoms':
#if 'default' in weight_type:
# weights *= catalog['WEIGHT'][mask]
if 'bitwise' in weight_type and 'default' in weight_type:
<<<<<<< HEAD
weights /= catalog['FRAC_TLOBS_TILES'][mask]
print('dividing weights by FRAC_TLOBS_TILES')

# if name == 'randoms':
# if 'default' in weight_type:
# weights *= catalog['WEIGHT'][mask]
=======
weights = np.ones_like(positions[0])#catalog['WEIGHT_SYS'][mask]*catalog['WEIGHT_ZFAIL'][mask]
if 'IIP' in weight_type and 'default' in weight_type:
weights = np.ones_like(positions[0])#catalog['WEIGHT_SYS'][mask]*catalog['WEIGHT_ZFAIL'][mask]
logger.info('all random weights set to 1')
#weights /= catalog['FRAC_TLOBS_TILES'][mask]
#print('dividing weights by FRAC_TLOBS_TILES')
>>>>>>> main
# if 'RF' in weight_type:
# weights *= catalog['WEIGHT_RF'][mask]*catalog['WEIGHT_COMP'][mask]
# if 'zfail' in weight_type:
Expand Down
3 changes: 2 additions & 1 deletion scripts/Combined_Emulator_AbV4.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
parser.add_argument("--emubeta0", default = '0.7')
parser.add_argument("--emubeta1", default = '0.')
parser.add_argument("--adj_qref", default = 'n')
parser.add_argument("--skipntilespec", default = 'n')
#parser.add_argument("--deco", help = "anticorrelation parameter for emulator", default = 0.1)
args = parser.parse_args()
tracer_arr = np.array(args.tracer)
Expand Down Expand Up @@ -69,7 +70,7 @@
# else:
# cmd_string1 = "python %s --rbandcut 19.5 --mockver %s --prog %s --downsampling n --overwrite 1 --realmin %s --realmax %s --base_output %s" %(prep_script, args.mockver, args.prog.lower(), args.real, int(args.real) + 1, args.base_output)
# cmd_string2 = "python /global/homes/s/sikandar/PerlmutterLSS/LSS/scripts/getpotaY1_mock.py --base_output %s --prog %s --realization %s --base_input %s --mock %s --tile-temp-dir %s"%(getpota_outdir, args.prog.upper(), args.real, getpota_indir, args.mockver,getpota_tiledir)
cmd_string3 = "python /global/common/software/desi/users/sikandar/LSS/scripts/mock_tools/NTILE_assign.py --indir %s --tracer %s --tileloc_add y --prog %s"%(NTILE_assign_indir, tracer_string, args.prog.upper())
cmd_string3 = "python /global/common/software/desi/users/sikandar/LSS/scripts/mock_tools/NTILE_assign.py --indir %s --tracer %s --tileloc_add y --prog %s --skip_spec %s"%(NTILE_assign_indir, tracer_string, args.prog.upper(), args.skipntilespec)

cmd_string4 = {}
for i in range(len(tracer_arr)):
Expand Down
Loading

0 comments on commit 1742b93

Please sign in to comment.