Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions stixcore/processing/L1toL2.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,20 @@ def process_type(files, *, processor, soopmanager, spice_kernel_path, config):
for l2 in tmp.from_level1(
l1, parent=complete_file_name, idlprocessor=idlprocessor, ecc_manager=ecc_manager
):
new_files = processor.write_fits(l2)
all_files.extend(new_files)
try:
new_files = processor.write_fits(l2)
all_files.extend(new_files)
# we have to check in the for loop as some products might create
# multiple files and some of them might be combinable and some not
except NotCombineException as nc:
logger.warning(nc)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the email alerts trigger on warning or just info?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no just on error


# if a batch of X files have summed up run the IDL processing
if idlprocessor.opentasks >= max_idlbatch:
all_files.extend(idlprocessor.process())
idlprocessor = SSWIDLProcessor(processor)
except (NoMatchError, KeyError):
logger.warning("No L2 product match for product %s", l1)
except NotCombineException as nc:
logger.info(nc)
except Exception as e:
logger.error("Error processing file %s", file, exc_info=True)
logger.error("%s", e)
Expand Down
4 changes: 4 additions & 0 deletions stixcore/products/CAL/energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from stixcore.calibration.ecc_post_fit import ecc_post_fit_on_fits
from stixcore.calibration.elut_manager import ELUTManager
from stixcore.config.config import CONFIG
from stixcore.products.level0.scienceL0 import NotCombineException
from stixcore.products.product import EnergyChannelsMixin, GenericProduct, L2Mixin
from stixcore.time import SCETimeRange
from stixcore.util.logging import get_logger
Expand Down Expand Up @@ -412,3 +413,6 @@ def from_level1(cls, l1product, parent="", idlprocessor=None, ecc_manager=None):
# end of for each spectrum

return products

def __add__(self, other):
raise NotCombineException(f"Tried to combine 2 cal_energy products: \n{self} and \n{other}")