Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yymao committed Dec 13, 2023
1 parent 07e4d85 commit 44c0d62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions SAGA/objects/build2.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,9 @@ def get_tel_rank(
set(specs_to_merge["TELNAME"][mask_within_dz & mask_same_zq_class])
)
specs["SPEC_REPEAT_ALL"][best_spec_index] = "+".join(set(specs_to_merge["TELNAME"]))
log_MHI = specs_to_merge["LOG_MHI"][mask_within_dz & np.isfinite(specs_to_merge["LOG_MHI"])]
if len(log_MHI):
specs["LOG_MHI"][best_spec_index] = log_MHI[0]

nsa_specs = specs_to_merge[specs_to_merge["TELNAME"] == "NSA"]
specs["OBJ_NSAID"][best_spec_index] = int(nsa_specs["SPECOBJID"][0]) if len(nsa_specs) else -1
Expand Down
2 changes: 1 addition & 1 deletion SAGA/spectra/read_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def read_fashi(file_path):
specs.rename_column("z_err", "SPEC_Z_ERR")
specs.rename_column("log10Mass", "LOG_MHI")

valid_oc_coord = Query("abs(RA_oc) + abs(DEC_oc) > 0").mask(specs)
valid_oc_coord = Query("oc_flag > 0.9995", "abs(RA_oc) + abs(DEC_oc) > 0").mask(specs)
specs["RA"] = np.where(valid_oc_coord, specs["RA_oc"], specs["RA"])
specs["DEC"] = np.where(valid_oc_coord, specs["DEC_oc"], specs["DEC"])
specs["ZQUALITY"] = np.where(valid_oc_coord, 3, 2)
Expand Down

0 comments on commit 44c0d62

Please sign in to comment.