77from datetime import date , timedelta
88from concurrent .futures import ProcessPoolExecutor
99
10+ from stixpy .net .client import STIXClient
11+
1012from stixcore .config .config import CONFIG
1113from stixcore .ephemeris .manager import Spice , SpiceKernelManager
1214from stixcore .io .fits .processors import (
1517 FitsL3Processor ,
1618 PlotProcessor ,
1719)
18- from stixcore .io .FlareListManager import SDCFlareListManager
20+ from stixcore .io .FlareListManager import SCFlareListManager , SDCFlareListManager
1921from stixcore .io .ProcessingHistoryStorage import ProcessingHistoryStorage
2022from stixcore .io .RidLutManager import RidLutManager
2123from stixcore .processing .AspectANC import AspectANC
22- from stixcore .processing .FlareListANC import FlareListANC
24+ from stixcore .processing .FlareListL3 import FlareListL3
2325from stixcore .processing .FLtoFL import FLtoFL
2426from stixcore .processing .LL import LL03QL
2527from stixcore .processing .pipeline import PipelineStatus
26- from stixcore .processing .SingleStep import SingleProcessingStepResult , TestForProcessingResult
27- from stixcore .products .ANC .flarelist import FlarelistSDCLoc , FlarelistSDCLocImg
28+ from stixcore .processing .SingleStep import SingleProcessingStepResult
2829from stixcore .products .level1 .quicklookL1 import LightCurve
30+ from stixcore .products .level3 .flarelist import (
31+ FlarelistSC ,
32+ FlarelistSCLoc ,
33+ FlarelistSCLocImg ,
34+ FlarelistSDC ,
35+ FlarelistSDCLoc ,
36+ FlarelistSDCLocImg ,
37+ )
2938from stixcore .products .lowlatency .quicklookLL import LightCurveL3
3039from stixcore .soop .manager import SOOPManager
3140from stixcore .util .logging import STX_LOGGER_DATE_FORMAT , STX_LOGGER_FORMAT , get_logger
@@ -184,6 +193,13 @@ def run_daily_pipeline(args):
184193
185194 Path (CONFIG .get ('Paths' , 'fits_archive' ))
186195
196+ fido_url = CONFIG .get ('Paths' , 'fido_search_url' ,
197+ fallback = 'https://pub099.cs.technik.fhnw.ch/data/fits' )
198+ fido_client = STIXClient (source = fido_url )
199+
200+ flare_lut_file = Path (CONFIG .get ('Pipeline' , 'flareid_sc_lut_file' ))
201+ SCFlareListManager .instance = SCFlareListManager (flare_lut_file , fido_client , update = True )
202+
187203 flare_lut_file = Path (CONFIG .get ('Pipeline' , 'flareid_sdc_lut_file' ))
188204 SDCFlareListManager .instance = SDCFlareListManager (flare_lut_file , update = False )
189205
@@ -218,11 +234,14 @@ def run_daily_pipeline(args):
218234
219235 aspect_anc_processor = AspectANC (fits_in_dir , fits_out_dir )
220236
221- flarelist_sdc = FlareListANC (SDCFlareListManager .instance , fits_out_dir )
237+ flarelist_sdc = FlareListL3 (SDCFlareListManager .instance , fits_out_dir )
238+ flarelist_sc = FlareListL3 (SCFlareListManager .instance , fits_out_dir )
222239 fl_to_fl = FLtoFL (fits_in_dir ,
223240 fits_out_dir ,
224- products_in_out = [ # (FlarelistSDC, FlarelistSDCLoc),
225- (FlarelistSDCLoc , FlarelistSDCLocImg )],
241+ products_in_out = [(FlarelistSDC , FlarelistSDCLoc ),
242+ (FlarelistSDCLoc , FlarelistSDCLocImg ),
243+ (FlarelistSC , FlarelistSCLoc ),
244+ (FlarelistSCLoc , FlarelistSCLocImg )],
226245 cadence = timedelta (seconds = 1 ))
227246
228247 ll03ql = LL03QL (fits_in_dir , fits_out_dir , in_product = LightCurve , out_product = LightCurveL3 ,
@@ -233,23 +252,20 @@ def run_daily_pipeline(args):
233252 l3_fits_writer = FitsL3Processor (fits_out_dir )
234253 anc_fits_writer = FitsANCProcessor (fits_out_dir )
235254
236- # should be done later: internally
255+ # hk_in_files = aspect_anc_processor.get_processing_files(phs)
237256 hk_in_files = []
238- candidates = list () # aspect_anc_processor.find_processing_candidates()
239- v_candidates = aspect_anc_processor .get_version (candidates , version = "latest" )
240- for fc in v_candidates :
241- tr = aspect_anc_processor .test_for_processing (fc , phs )
242- if tr == TestForProcessingResult .Suitable :
243- hk_in_files .append (fc )
244257
245- fl_months = flarelist_sdc .find_processing_months (phs )
246- fl_months = []
258+ fl_sdc_months = flarelist_sdc .find_processing_months (phs )
259+ # fl_sdc_months = []
260+
261+ # fl_sc_months = flarelist_sc.find_processing_months(phs)
262+ fl_sc_months = []
247263
248- ll_candidates = ll03ql .get_processing_files (phs )
264+ # ll_candidates = ll03ql.get_processing_files(phs)
249265 ll_candidates = []
250266
251267 fl_to_fl_files = fl_to_fl .get_processing_files (phs )
252- # flsdc_to_flcdspos_files = []
268+ # fl_to_fl_files = []
253269
254270 # all processing files should be terminated before the next step as the different
255271 # processing steeps might create new candidates
@@ -262,10 +278,16 @@ def run_daily_pipeline(args):
262278 processor = l2_fits_writer ,
263279 config = CONFIG ))
264280
265- jobs .append (executor .submit (flarelist_sdc .process_fits_files , fl_months ,
281+ jobs .append (executor .submit (flarelist_sdc .process_fits_files , fl_sdc_months ,
282+ soopmanager = SOOPManager .instance ,
283+ spice_kernel_path = Spice .instance .meta_kernel_path ,
284+ processor = l3_fits_writer ,
285+ config = CONFIG ))
286+
287+ jobs .append (executor .submit (flarelist_sc .process_fits_files , fl_sc_months ,
266288 soopmanager = SOOPManager .instance ,
267289 spice_kernel_path = Spice .instance .meta_kernel_path ,
268- processor = anc_fits_writer ,
290+ processor = l3_fits_writer ,
269291 config = CONFIG ))
270292
271293 # TODO a owen processing step for each flarelist file?
0 commit comments