|
1 | 1 | # 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) 02/05/2024, 10:40. Copyright (c) The Contributors |
| 2 | +# Last modified by David J Turner (turne540@msu.edu) 27/05/2024, 10:48. Copyright (c) The Contributors |
3 | 3 |
|
4 | 4 | import os
|
5 | 5 | import pickle
|
@@ -1004,12 +1004,18 @@ def parse_lightcurve(inven_entry: pd.Series) -> LightCurve:
|
1004 | 1004 | # those objects and add them to the storage structure
|
1005 | 1005 | if len(ann_spec_constituents) != 0:
|
1006 | 1006 | for set_id in ann_spec_constituents:
|
1007 |
| - if ann_spec_usable[set_id]: |
1008 |
| - ann_spec_obj = AnnularSpectra(ann_spec_constituents[set_id]) |
1009 |
| - if self._redshift is not None: |
1010 |
| - # If we know the redshift we will add the radii to the annular spectra in proper distance units |
1011 |
| - ann_spec_obj.proper_radii = self.convert_radius(ann_spec_obj.radii, 'kpc') |
1012 |
| - self.update_products(ann_spec_obj, update_inv=False) |
| 1007 | + try: |
| 1008 | + if ann_spec_usable[set_id]: |
| 1009 | + ann_spec_obj = AnnularSpectra(ann_spec_constituents[set_id]) |
| 1010 | + if self._redshift is not None: |
| 1011 | + # If we know the redshift we will add the radii to the annular spectra in proper |
| 1012 | + # distance units |
| 1013 | + ann_spec_obj.proper_radii = self.convert_radius(ann_spec_obj.radii, 'kpc') |
| 1014 | + self.update_products(ann_spec_obj, update_inv=False) |
| 1015 | + except AttributeError: |
| 1016 | + # This should hopefully act to catch the NoneType has no attribute problems that have plagued this |
| 1017 | + # class - while I find a better general solution that should solve this properly |
| 1018 | + pass |
1013 | 1019 |
|
1014 | 1020 | # Here we load in any combined images and exposure maps that may have been generated
|
1015 | 1021 | os.chdir(OUTPUT + 'combined')
|
|
0 commit comments