|
1 | 1 | # This code is part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS). |
2 | | -# Last modified by David J Turner (djturner@umbc.edu) 5/5/26, 1:46 PM. Copyright (c) The Contributors. |
| 2 | +# Last modified by David J Turner (djturner@umbc.edu) 5/5/26, 10:40 PM. Copyright (c) The Contributors. |
3 | 3 |
|
4 | 4 | import gc |
5 | 5 | import os |
@@ -2309,6 +2309,12 @@ def _get_phot_prod(self, prod_type: str, obs_id: str = None, inst: str = None, l |
2309 | 2309 | telescope=telescope) |
2310 | 2310 | matched_prods = [p[-1] for p in broad_matches if extra_key in p[-2]] |
2311 | 2311 |
|
| 2312 | + # This part of the code ensures that if inst is None (the default), only products for 'real' |
| 2313 | + # instruments are returned. To retrieve a multi-instrument combined product, the user must |
| 2314 | + # explicitly specify inst='combined'. |
| 2315 | + if inst is None: |
| 2316 | + matched_prods = [m_prod for m_prod in matched_prods if m_prod.instrument != 'combined'] |
| 2317 | + |
2312 | 2318 | if len(matched_prods) == 1: |
2313 | 2319 | matched_prods = matched_prods[0] |
2314 | 2320 | elif len(matched_prods) == 0: |
@@ -2345,6 +2351,12 @@ def _get_prof_prod(self, search_key: str, obs_id: str = None, inst: str = None, |
2345 | 2351 | # Fetch all the matching profiles for the specified telescope |
2346 | 2352 | matched_prods = self.get_products(search_key, obs_id, inst, just_obj=True, telescope=telescope) |
2347 | 2353 |
|
| 2354 | + # This part of the code ensures that if inst is None (the default), only products for 'real' |
| 2355 | + # instruments are returned. To retrieve a multi-instrument combined product, the user must |
| 2356 | + # explicitly specify inst='combined'. |
| 2357 | + if inst is None: |
| 2358 | + matched_prods = [m_prod for m_prod in matched_prods if m_prod.instrument != 'combined'] |
| 2359 | + |
2348 | 2360 | matched_prods: List[BaseProfile1D] |
2349 | 2361 |
|
2350 | 2362 | # Matching the radii is going to take a maybe slightly (but practically not really) dangerous approach. The |
@@ -2443,6 +2455,12 @@ def _get_lc_prod(self, outer_radius: Union[str, Quantity] = None, obs_id: str = |
2443 | 2455 | # user (None by default) - we'll then sweep through whatever list is returned and narrow them down |
2444 | 2456 | matched_prods = self.get_products(search_key, obs_id, inst, telescope=telescope) |
2445 | 2457 |
|
| 2458 | + # This part of the code ensures that if inst is None (the default), only products for 'real' |
| 2459 | + # instruments are returned. To retrieve a multi-instrument combined product, the user must |
| 2460 | + # explicitly specify inst='combined'. |
| 2461 | + if inst is None: |
| 2462 | + matched_prods = [m_prod for m_prod in matched_prods if m_prod.instrument != 'combined'] |
| 2463 | + |
2446 | 2464 | matched_prods: List[LightCurve] |
2447 | 2465 |
|
2448 | 2466 | # Checking for matching radii first - this will likely whittle down the LCs best of all. We have |
@@ -3354,6 +3372,12 @@ def _get_spec_prod(self, outer_radius: Union[str, Quantity], obs_id: str = None, |
3354 | 3372 | else: |
3355 | 3373 | matched_prods = self.get_products('spectrum', obs_id=obs_id, inst=inst, telescope=telescope) |
3356 | 3374 |
|
| 3375 | + # This part of the code ensures that if inst is None (the default), only products for 'real' |
| 3376 | + # instruments are returned. To retrieve a multi-instrument combined product, the user must |
| 3377 | + # explicitly specify inst='combined'. |
| 3378 | + if inst is None: |
| 3379 | + matched_prods = [m_prod for m_prod in matched_prods if m_prod.instrument != 'combined'] |
| 3380 | + |
3357 | 3381 | # Checking for matching radii first - this will likely whittle down the spectra best of all. We have |
3358 | 3382 | # had matching problems sometimes because of float precision (the last digit flips and is no longer |
3359 | 3383 | # an exact match to the other radius) |
|
0 commit comments