Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion py/picca/bin/picca_export_co.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def main(cmdargs):
sys.exit()

w = np.logical_not(
np.in1d(data[type_corr1]['HEALPID'],
np.isin(data[type_corr1]['HEALPID'],
data[type_corr2]['HEALPID']))
if w.sum() != 0:
userprint("WARNING: HEALPID are different by {} for {}:{} "
Expand Down
2 changes: 1 addition & 1 deletion py/picca/bin/picca_export_cross_covariance.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def main(cmdargs):
# Add unshared healpix as empty data
for key in sorted(list(data.keys())):
key2 = (key + 1) % 2
w = np.logical_not(np.in1d(data[key2]['HEALPID'], data[key]['HEALPID']))
w = np.logical_not(np.isin(data[key2]['HEALPID'], data[key]['HEALPID']))
if w.sum() > 0:
new_healpix = data[key2]['HEALPID'][w]
num_new_healpix = new_healpix.size
Expand Down
2 changes: 1 addition & 1 deletion py/picca/bin/picca_reduce_spall.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
qso_catalog = Table.read(args.qso_catalog)
print(f'{len(qso_catalog)} entries found in QSO catalog')

w = np.in1d(spall['THING_ID'], qso_catalog['THING_ID'])
w = np.isin(spall['THING_ID'], qso_catalog['THING_ID'])
spall_qso = spall[w]
#-- Columns required for picca_deltas.py for spec, spplate formats and usage of multiple observations
spall_qso.keep_columns(
Expand Down
2 changes: 1 addition & 1 deletion py/picca/cf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,7 @@ def compute_xi_1d_cross(healpix):
weights1 = delta1.weights[select1]

thingids = [delta2.thingid for delta2 in data2[healpix]]
neighbours = data2[healpix][np.in1d(thingids, [delta1.thingid])]
neighbours = data2[healpix][np.isin(thingids, [delta1.thingid])]
for delta2 in neighbours:
select2 = delta2.log_lambda <= log_lambda_max
select2 &= delta2.log_lambda >= log_lambda_min
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def read_spall(self, drq_catalogue):
f"message: {str(error)}"
) from error

w = np.in1d(catalogue["THING_ID"], drq_catalogue["THING_ID"])
w = np.isin(catalogue["THING_ID"], drq_catalogue["THING_ID"])
self.logger.progress(f"Found {np.sum(w)} spectra with required THING_ID")
w &= catalogue["PLATEQUALITY"] == "good"
self.logger.progress(f"Found {np.sum(w)} spectra with 'good' plate")
Expand Down
2 changes: 1 addition & 1 deletion py/picca/pk1d/compute_pk1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def fill_masked_pixels(
lambda_or_log_lambda_index += 0.5
lambda_or_log_lambda_index = np.array(lambda_or_log_lambda_index, dtype=int)
index_all = range(lambda_or_log_lambda_index[-1] + 1)
index_ok = np.in1d(index_all, lambda_or_log_lambda_index)
index_ok = np.isin(index_all, lambda_or_log_lambda_index)

delta_new = np.zeros(len(index_all))
delta_new[index_ok] = delta
Expand Down
4 changes: 2 additions & 2 deletions py/picca/raw_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def read_transmission_file(filename, num_bins, objs_thingid, tracer='F_LYA', lam

hdul = fitsio.FITS(filename)
thingid = hdul['METADATA']['MOCKID'][:]
if np.in1d(thingid, objs_thingid).sum() == 0:
if np.isin(thingid, objs_thingid).sum() == 0:
hdul.close()
return
if 'RA' in hdul['METADATA'].get_colnames() and 'DEC' in hdul['METADATA'].get_colnames():
Expand Down Expand Up @@ -116,7 +116,7 @@ def read_transmission_file(filename, num_bins, objs_thingid, tracer='F_LYA', lam
(lambda_rest_frame < lambda_max_rest_frame)] = 1
num_pixels = np.sum(valid_pixels, axis=1)
w = num_pixels >= 50
w &= np.in1d(thingid, objs_thingid)
w &= np.isin(thingid, objs_thingid)
if w.sum() == 0:
hdul.close()
return
Expand Down
4 changes: 2 additions & 2 deletions py/picca/xcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,15 +965,15 @@ def compute_wick_terms(healpixs):
thingid4 = np.array([obj4.thingid for obj4 in neighbours])

if max_diagram == 5:
w = np.in1d(delta1.neighbours, delta3.neighbours)
w = np.isin(delta1.neighbours, delta3.neighbours)
if w.sum() == 0:
continue
aux_ang12 = ang12[w]
aux_r_comov2 = r_comov2[w]
aux_weights2 = weights2[w]
aux_thingid2 = thingid2[w]

w = np.in1d(delta3.neighbours, delta1.neighbours)
w = np.isin(delta3.neighbours, delta1.neighbours)
if w.sum() == 0:
continue
ang34 = ang34[w]
Expand Down
2 changes: 1 addition & 1 deletion tutorials/picca_export_stacked_correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
### Add unshared healpix as empty data
for i in range(nbData):
for j in range(nbData):
w = np.logical_not( np.in1d(data[j]['HEALPID'],data[i]['HEALPID']) )
w = np.logical_not( np.isin(data[j]['HEALPID'],data[i]['HEALPID']) )
if w.sum()>0:
new_healpix = data[j]['HEALPID'][w]
nb_new_healpix = new_healpix.size
Expand Down
Loading