Skip to content

Commit e0a6257

Browse files
author
David Turner
committed
Altered the ClusterSample init to store the messages from NoValidObservationError in the failed_reason property of the sample.
1 parent 525a82e commit e0a6257

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

xga/samples/extended.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This code is a part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS).
2-
# Last modified by David J Turner (turne540@msu.edu) 18/07/2025, 10:21. Copyright (c) The Contributors
2+
# Last modified by David J Turner (djturner@umbc.edu) 11/12/2025, 17:08. Copyright (c) The Contributors
33

44
from typing import List
55

@@ -274,18 +274,13 @@ def __init__(self, ra: np.ndarray, dec: np.ndarray, redshift: np.ndarray, name:
274274
peak_find_method, True, telescope, search_distance,
275275
cur_inc_core_pnt_src)
276276
final_names.append(n)
277-
except NoValidObservationsError:
278-
# warn("After a failed attempt to find an X-ray peak, and after applying the criteria for "
279-
# "the minimum amount of cluster required on an observation, {} cannot be declared as "
280-
# "all potential observations were removed".format(n))
281-
self._failed_sources[n] = "Failed ObsClean"
282-
283-
except NoValidObservationsError:
284-
# warn("After applying the criteria for the minimum amount of cluster required on an "
285-
# "observation, {} cannot be declared as all potential observations were removed".format(n))
277+
except NoValidObservationsError as err:
278+
self._failed_sources[n] = str(err)
279+
280+
except NoValidObservationsError as err:
286281
# Note we don't append n to the final_names list here, as it is effectively being
287282
# removed from the sample
288-
self._failed_sources[n] = "Failed ObsClean"
283+
self._failed_sources[n] = str(err)
289284
dec_lb.update(1)
290285

291286
self._names = final_names

0 commit comments

Comments
 (0)