Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1.5.1_fixes #420

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d9c5387
bump all product versions to 2
nicHoch Dec 19, 2023
f0642f9
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Dec 19, 2023
5d22466
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Feb 2, 2024
2ae68fb
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Feb 8, 2024
31cbb6d
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Mar 25, 2024
af81758
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Apr 11, 2024
47631c7
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Apr 11, 2024
9f0dfb1
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Apr 11, 2024
c020af4
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch May 13, 2024
bd2083b
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Oct 11, 2024
f4f9c5b
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Oct 11, 2024
5d0fe4f
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Nov 18, 2024
9704ff9
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Nov 18, 2024
4ec73cd
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Nov 18, 2024
eb6b5be
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Nov 25, 2024
af929ee
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Nov 25, 2024
e716f41
Merge branch 'master' of https://github.com/i4Ds/STIXCore
nicHoch Nov 29, 2024
1959e86
fix #417
nicHoch Dec 10, 2024
96833c2
fix #418
nicHoch Dec 10, 2024
85d3c6d
daily report log files could have different names if the scripts run …
nicHoch Dec 10, 2024
3466adb
fix #419
nicHoch Dec 10, 2024
28df8e9
end2end test: better report if no corresponding file found
nicHoch Dec 10, 2024
a92c687
rewrite pipeline to cronjob based approach #422
nicHoch Dec 20, 2024
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
3 changes: 2 additions & 1 deletion stixcore/io/fits/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,11 @@ def write_fits(self, product, *, version=0):
data_hdu.name = 'DATA'
hdul = fits.HDUList([primary_hdu, control_hdu, data_hdu])

logger.info(f'Writing fits file to {path / filename}')
fullpath = path / filename
logger.info(f'start writing fits file to {fullpath}')
hdul.writeto(fullpath, overwrite=True, checksum=True)
files.append(fullpath)
logger.info(f'done writing fits file to {fullpath}')

return files

Expand Down
27 changes: 16 additions & 11 deletions stixcore/processing/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import io
import os
import re
import sys
import time
Expand Down Expand Up @@ -375,18 +374,23 @@ def status_server(self):
connection.close()


def search_unprocessed_tm_files(logging_dir, tm_dir):
def search_unprocessed_tm_files(logging_dir, tm_dir, last_processed):

unprocessed_tm_files = list()
list_of_log_files = logging_dir.glob('*.out')
latest_log_file = max(list_of_log_files, key=os.path.getmtime)
print(f"{latest_log_file}: {latest_log_file.stat().st_mtime}")
latest_log_file = logging_dir / last_processed
tm_file = Path(tm_dir / str(latest_log_file.name)[0:-4])
if tm_file.exists():
ftime = tm_file.stat().st_mtime
for tmf in tm_dir.glob("*.xml"):
if TM_REGEX.match(tmf.name) and tmf.stat().st_mtime > ftime:
unprocessed_tm_files.append(tmf)
ftime = tm_file.stat().st_mtime

for tmf in tm_dir.glob("*.xml"):
log_out_file = logging_dir / (tmf.name + ".out")
log_file = logging_dir / (tmf.name + ".log")
logger.info(f"test: {tmf.name}")
if TM_REGEX.match(tmf.name) and tmf.stat().st_mtime > ftime and (not log_out_file.exists()
or not log_file.exists()):
unprocessed_tm_files.append(tmf)
logger.info(f"NOT FOUND: {log_out_file.name}")
else:
logger.info(f"found: {log_out_file.name}")
return unprocessed_tm_files


Expand All @@ -413,7 +417,8 @@ def main():
PipelineStatus.instance = PipelineStatus(tm_handler)
if CONFIG.getboolean('Pipeline', 'start_with_unprocessed', fallback=True):
logger.info("Searching for unprocessed tm files")
unprocessed_tm_files = search_unprocessed_tm_files(log_dir, tmpath)
last_processed = CONFIG.get('Pipeline', 'last_processed', fallback="")
unprocessed_tm_files = search_unprocessed_tm_files(log_dir, tmpath, last_processed)
if unprocessed_tm_files:
fl = '\n '.join([f.name for f in unprocessed_tm_files])
logger.info(f"Found unprocessed tm files: \n {fl}\nadding to queue.")
Expand Down
Loading
Loading