Skip to content
Snippets Groups Projects
Commit a2891d18 authored by Daniel Nemergut's avatar Daniel Nemergut
Browse files

Setting *pbcor.tt0.fits to be the science products, everything else is...

Setting *pbcor.tt0.fits to be the science products, everything else is currently an ancillary on both products
parent 1de5e503
No related branches found
No related tags found
2 merge requests!1452Merge 2.8.2 to main,!1383WS-1769 VLA manifest creation
......@@ -37,6 +37,7 @@ RMS = "rms"
PB = "pb"
MASK = "mask"
ALPHA = "alpha"
PBCOR = "pbcor"
# pylint: disable=R1721
......@@ -68,15 +69,13 @@ class ImageIngestionProductsFinder:
if file.name.endswith(FITS) and TT0 in file.name and RMS not in file.name
]
else:
# The science products will be named *pbcor.tt0.fits
sp_image_files = [
file
for file in self.files_found
if file.name.endswith(FITS)
and TT0 in file.name # make sure tt1 is NOT a sp
and RMS not in file.name
and PB not in file.name
and MASK not in file.name
and ALPHA not in file.name
and PBCOR in file.name
and TT0 in file.name
]
self.logger.info(f"Science Product(s) to ingest: {sp_image_files}")
image_files = [
......@@ -95,7 +94,7 @@ class ImageIngestionProductsFinder:
science_products = []
for file in sp_image_files:
# For the case where there are two image science products, all ancillaries should be attached to only one
if TT0 in file.name:
if PBCOR in file.name and TT0 in file.name:
science_products.append(
OutputScienceProduct(
product_type=AncillaryProductType.FITS,
......@@ -171,6 +170,8 @@ class ImageIngestionProductsFinder:
return AncillaryProduct(type=AncillaryProductType.FITS_MASK, filename=filename)
if ALPHA in filename:
return AncillaryProduct(type=AncillaryProductType.ALPHA_FITS, filename=filename)
else:
return AncillaryProduct(type=AncillaryProductType.FITS, filename=filename)
if filename.endswith(CSV):
return AncillaryProduct(type=AncillaryProductType.COMPONENT_LIST, filename=filename)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment