Skip to content

Commit

Permalink
Add HI source col
Browse files Browse the repository at this point in the history
  • Loading branch information
yymao committed Jan 12, 2024
1 parent 87c517f commit f45c6f8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SAGA/objects/build2.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ def get_tel_rank(
has_HI = mask_within_dz & (specs_to_merge["HI_FLUX"] > 0)
if has_HI.any():
has_HI = np.argmax(has_HI)
for c in ["HI_FLUX", "HI_FLUX_ERR"]:
for c in ["HI_FLUX", "HI_FLUX_ERR", "HI_SOURCE"]:
specs[c][best_spec_index] = specs_to_merge[c][has_HI]

nsa_specs = specs_to_merge[specs_to_merge["TELNAME"] == "NSA"]
Expand Down
1 change: 1 addition & 0 deletions SAGA/spectra/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
("HELIO_CORR", "|b1"),
("HI_FLUX", "<f4"),
("HI_FLUX_ERR", "<f4"),
("HI_SOURCE", "<U8"),
)

SPECS_COLUMNS = dict(_SPECS_COLUMNS)
Expand Down
2 changes: 2 additions & 0 deletions SAGA/spectra/read_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ def read_alfalfa(file_path):
specs["SPEC_Z_ERR"] = specs["sigW"].astype(np.float64) * 0.5 / SPEED_OF_LIGHT
specs["ZQUALITY"] = np.where(valid_oc_coord, 3, 2)

specs["HI_SOURCE"] = "ALFALFA"
specs["TELNAME"] = "ALFALF"
specs["MASKNAME"] = "ALFALFA"
specs["HELIO_CORR"] = True
Expand Down Expand Up @@ -346,6 +347,7 @@ def read_fashi(file_path):
specs["ZQUALITY"] = np.where(valid_oc_coord, 3, 2)
specs["HI_FLUX"] *= 1.0e-3 # convret from mJy to Jy
specs["HI_FLUX_ERR"] *= 1.0e-3 # convret from mJy to Jy
specs["HI_SOURCE"] = "FASHI"

specs["TELNAME"] = "FASHI"
specs["MASKNAME"] = "FASHI"
Expand Down

0 comments on commit f45c6f8

Please sign in to comment.