Spaces:
Sleeping
Sleeping
alexandergagliano
commited on
Commit
·
afe7319
1
Parent(s):
6358e17
Fix theoretical light curve search
Browse files- README.md +1 -0
- notebooks/01_basic_usage.ipynb +0 -0
- notebooks/02_advanced_usage.ipynb +0 -0
- src/relaiss/search.py +6 -2
README.md
CHANGED
|
@@ -78,3 +78,4 @@ archivePrefix = {arXiv},
|
|
| 78 |
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
|
| 79 |
}
|
| 80 |
```
|
|
|
|
|
|
| 78 |
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
|
| 79 |
}
|
| 80 |
```
|
| 81 |
+
|
notebooks/01_basic_usage.ipynb
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
notebooks/02_advanced_usage.ipynb
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
src/relaiss/search.py
CHANGED
|
@@ -95,7 +95,7 @@ def primer(
|
|
| 95 |
if features and arr.size == 0:
|
| 96 |
arr_ts, coords_ts = _extract_timeseries(
|
| 97 |
ztf_id,
|
| 98 |
-
None if features is host_features
|
| 99 |
features,
|
| 100 |
dataset_bank_path,
|
| 101 |
path_to_timeseries_folder,
|
|
@@ -111,14 +111,17 @@ def primer(
|
|
| 111 |
|
| 112 |
if (lc_ztf_id is None) == (theorized_lightcurve_df is None):
|
| 113 |
raise ValueError("Provide exactly one of lc_ztf_id or theorized_lightcurve_df.")
|
|
|
|
| 114 |
if theorized_lightcurve_df is not None and host_ztf_id is None:
|
| 115 |
raise ValueError("Providing theorized_lightcurve_df requires host_ztf_id.")
|
|
|
|
| 116 |
lc_features = lc_features or []
|
| 117 |
host_features = host_features or []
|
| 118 |
feature_names = lc_features + host_features
|
| 119 |
df_bank = _load_dataset_bank(dataset_bank_path, preprocessed_df)
|
| 120 |
-
|
| 121 |
lc_arr, lc_coords, lc_tns, lc_id = _get_entity(lc_ztf_id, lc_features)
|
|
|
|
| 122 |
if host_ztf_id:
|
| 123 |
host_arr, host_coords, host_tns, host_id = _get_entity(host_ztf_id, host_features)
|
| 124 |
elif len(host_features) > 0:
|
|
@@ -131,6 +134,7 @@ def primer(
|
|
| 131 |
host_id = None
|
| 132 |
|
| 133 |
combined = np.concatenate([lc_arr, host_arr]) if host_arr.size else lc_arr
|
|
|
|
| 134 |
if drop_nan_features and combined.size:
|
| 135 |
print("Dropping nan features")
|
| 136 |
mask = ~pd.isna(combined)
|
|
|
|
| 95 |
if features and arr.size == 0:
|
| 96 |
arr_ts, coords_ts = _extract_timeseries(
|
| 97 |
ztf_id,
|
| 98 |
+
None if features is host_features else theorized_lightcurve_df,
|
| 99 |
features,
|
| 100 |
dataset_bank_path,
|
| 101 |
path_to_timeseries_folder,
|
|
|
|
| 111 |
|
| 112 |
if (lc_ztf_id is None) == (theorized_lightcurve_df is None):
|
| 113 |
raise ValueError("Provide exactly one of lc_ztf_id or theorized_lightcurve_df.")
|
| 114 |
+
|
| 115 |
if theorized_lightcurve_df is not None and host_ztf_id is None:
|
| 116 |
raise ValueError("Providing theorized_lightcurve_df requires host_ztf_id.")
|
| 117 |
+
|
| 118 |
lc_features = lc_features or []
|
| 119 |
host_features = host_features or []
|
| 120 |
feature_names = lc_features + host_features
|
| 121 |
df_bank = _load_dataset_bank(dataset_bank_path, preprocessed_df)
|
| 122 |
+
|
| 123 |
lc_arr, lc_coords, lc_tns, lc_id = _get_entity(lc_ztf_id, lc_features)
|
| 124 |
+
|
| 125 |
if host_ztf_id:
|
| 126 |
host_arr, host_coords, host_tns, host_id = _get_entity(host_ztf_id, host_features)
|
| 127 |
elif len(host_features) > 0:
|
|
|
|
| 134 |
host_id = None
|
| 135 |
|
| 136 |
combined = np.concatenate([lc_arr, host_arr]) if host_arr.size else lc_arr
|
| 137 |
+
|
| 138 |
if drop_nan_features and combined.size:
|
| 139 |
print("Dropping nan features")
|
| 140 |
mask = ~pd.isna(combined)
|