From 3ef3766ef355ba6fe7ddc01c936ded98a30d0974 Mon Sep 17 00:00:00 2001 From: CI Bot <astrowisegitlab@rug.nl> Date: Wed, 12 Oct 2022 08:31:28 +0000 Subject: [PATCH] Auto-format files with abstractautoformatter --- reflex/micado_si_wkf.py | 331 ++++++++++++++++++---------------------- 1 file changed, 152 insertions(+), 179 deletions(-) diff --git a/reflex/micado_si_wkf.py b/reflex/micado_si_wkf.py index 0156297c8..badb0a997 100644 --- a/reflex/micado_si_wkf.py +++ b/reflex/micado_si_wkf.py @@ -1,3 +1,4 @@ + from edps.generator.task_builder import data_source, task from edps.generator.task import ClassificationRule, ProductClassificationRule @@ -5,227 +6,210 @@ from edps.generator.task import ClassificationRule, ProductClassificationRule def is_raw(f): return f["dpr.catg"] == "NODEFAULT" and f["dpr.tech"] == "" and f["dpr.type"] == "" - raw_class = ClassificationRule("RAW", is_raw) -raw = data_source().with_classification_rule(raw_class).build() +raw = ( + data_source() + .with_classification_rule(raw_class) + .build() +) def is_raw_dark(f): - return ( - f["dpr.catg"] == "CALIB" - and f["dpr.tech"] == "IMAGE,SI" - and f["dpr.type"] == "DARK" - ) - + return f["dpr.catg"] == "CALIB" and f["dpr.tech"] == "IMAGE,SI" and f["dpr.type"] == "DARK" raw_dark_class = ClassificationRule("I_DARK_RAW", is_raw_dark) -raw_dark = data_source().with_classification_rule(raw_dark_class).build() +raw_dark = ( + data_source() + .with_classification_rule(raw_dark_class) + .build() +) + + + + + def is_cat_photomref(f): return f["pro.catg"] == "CAT_PHOTOMREF" - cat_photomref_class = ClassificationRule("REF_I_PHOTOM_CAT", is_cat_photomref) -cat_photomref = data_source().with_classification_rule(cat_photomref_class).build() +cat_photomref = ( + data_source() + .with_classification_rule(cat_photomref_class) + .build() +) + -def is_raw_opt_flat(f): - return ( - f["dpr.catg"] == "CALIB" - and f["dpr.tech"] == "IMAGE,SI" - and f["dpr.type"] == "FLAT,LAMP" - ) +def is_raw_opt_flat(f): + return f["dpr.catg"] == "CALIB" and f["dpr.tech"] == "IMAGE,SI" and f["dpr.type"] == "FLAT,LAMP" + raw_opt_flat_class = ClassificationRule("I_FLAT_RAW", is_raw_opt_flat) -raw_opt_flat = data_source().with_classification_rule(raw_opt_flat_class).build() +raw_opt_flat = ( + data_source() + .with_classification_rule(raw_opt_flat_class) + .build() +) def is_raw_opt_nonlin(f): - return ( - f["dpr.catg"] == "CALIB" - and f["dpr.tech"] == "IMAGE,SI" - and f["dpr.type"] == "NONLIN,LAMP" - ) - + return f["dpr.catg"] == "CALIB" and f["dpr.tech"] == "IMAGE,SI" and f["dpr.type"] == "NONLIN,LAMP" raw_opt_nonlin_class = ClassificationRule("I_NONLIN_RAW", is_raw_opt_nonlin) -raw_opt_nonlin = data_source().with_classification_rule(raw_opt_nonlin_class).build() +raw_opt_nonlin = ( + data_source() + .with_classification_rule(raw_opt_nonlin_class) + .build() +) + def is_cat_distortionref_astromref(f): return f["pro.catg"] == "CAT_DISTORTIONREF_ASTROMREF" - -cat_distortionref_astromref_class = ClassificationRule( - "REF_I_ASTROM_CAT", is_cat_distortionref_astromref -) +cat_distortionref_astromref_class = ClassificationRule("REF_I_ASTROM_CAT", is_cat_distortionref_astromref) cat_distortionref_astromref = ( - data_source().with_classification_rule(cat_distortionref_astromref_class).build() + data_source() + .with_classification_rule(cat_distortionref_astromref_class) + .build() ) def is_cat_distortionref_wamref(f): return f["pro.catg"] == "CAT_DISTORTIONREF_WAMREF" - -cat_distortionref_wamref_class = ClassificationRule( - "REF_I_WAM_CAT", is_cat_distortionref_wamref -) +cat_distortionref_wamref_class = ClassificationRule("REF_I_WAM_CAT", is_cat_distortionref_wamref) cat_distortionref_wamref = ( - data_source().with_classification_rule(cat_distortionref_wamref_class).build() + data_source() + .with_classification_rule(cat_distortionref_wamref_class) + .build() ) -def is_raw_opt_sky_astromfield(f): - return ( - f["dpr.catg"] == "CALIB" - and f["dpr.tech"] == "IMAGE,SI" - and f["dpr.type"] == "STD,ASTROMETRY" - ) -raw_opt_sky_astromfield_class = ClassificationRule( - "I_ASTROMFIELD_RAW", is_raw_opt_sky_astromfield -) + + +def is_raw_opt_sky_astromfield(f): + return f["dpr.catg"] == "CALIB" and f["dpr.tech"] == "IMAGE,SI" and f["dpr.type"] == "STD,ASTROMETRY" + +raw_opt_sky_astromfield_class = ClassificationRule("I_ASTROMFIELD_RAW", is_raw_opt_sky_astromfield) raw_opt_sky_astromfield = ( - data_source().with_classification_rule(raw_opt_sky_astromfield_class).build() + data_source() + .with_classification_rule(raw_opt_sky_astromfield_class) + .build() ) def is_raw_opt_sky_bkgfield(f): - return ( - f["dpr.catg"] == "CALIB" - and f["dpr.tech"] == "IMAGE,AI" - and f["dpr.type"] == "OBJECT,BCKGRND" - ) + return f["dpr.catg"] == "CALIB" and f["dpr.tech"] == "IMAGE,AI" and f["dpr.type"] == "OBJECT,BCKGRND" - -raw_opt_sky_bkgfield_class = ClassificationRule( - "I_BKGFIELD_RAW", is_raw_opt_sky_bkgfield -) +raw_opt_sky_bkgfield_class = ClassificationRule("I_BKGFIELD_RAW", is_raw_opt_sky_bkgfield) raw_opt_sky_bkgfield = ( - data_source().with_classification_rule(raw_opt_sky_bkgfield_class).build() + data_source() + .with_classification_rule(raw_opt_sky_bkgfield_class) + .build() ) def is_raw_opt_wamcam_cam(f): - return ( - f["dpr.catg"] == "CALIB" - and f["dpr.tech"] == "IMAGE,AI" - and f["dpr.type"] == "PINHOLE,CAM" - ) - + return f["dpr.catg"] == "CALIB" and f["dpr.tech"] == "IMAGE,AI" and f["dpr.type"] == "PINHOLE,CAM" raw_opt_wamcam_cam_class = ClassificationRule("I_CAM_RAW", is_raw_opt_wamcam_cam) raw_opt_wamcam_cam = ( - data_source().with_classification_rule(raw_opt_wamcam_cam_class).build() + data_source() + .with_classification_rule(raw_opt_wamcam_cam_class) + .build() ) def is_raw_opt_sky_illum(f): - return ( - f["dpr.catg"] == "CALIB" - and f["dpr.tech"] == "IMAGE,SI" - and f["dpr.type"] == "STD,ILLUM" - ) - + return f["dpr.catg"] == "CALIB" and f["dpr.tech"] == "IMAGE,SI" and f["dpr.type"] == "STD,ILLUM" raw_opt_sky_illum_class = ClassificationRule("I_ILLUM_RAW", is_raw_opt_sky_illum) raw_opt_sky_illum = ( - data_source().with_classification_rule(raw_opt_sky_illum_class).build() + data_source() + .with_classification_rule(raw_opt_sky_illum_class) + .build() ) def is_raw_opt_sky_stdfield(f): - return ( - f["dpr.catg"] == "CALIB" - and f["dpr.tech"] == "IMAGE,SI" - and f["dpr.type"] == "STD,PHOTOM" - ) + return f["dpr.catg"] == "CALIB" and f["dpr.tech"] == "IMAGE,SI" and f["dpr.type"] == "STD,PHOTOM" - -raw_opt_sky_stdfield_class = ClassificationRule( - "I_STDFIELD_RAW", is_raw_opt_sky_stdfield -) +raw_opt_sky_stdfield_class = ClassificationRule("I_STDFIELD_RAW", is_raw_opt_sky_stdfield) raw_opt_sky_stdfield = ( - data_source().with_classification_rule(raw_opt_sky_stdfield_class).build() + data_source() + .with_classification_rule(raw_opt_sky_stdfield_class) + .build() ) def is_raw_opt_wamcam_wam(f): - return ( - f["dpr.catg"] == "CALIB" - and f["dpr.tech"] == "IMAGE,AI" - and f["dpr.type"] == "PINHOLE,WAM" - ) - + return f["dpr.catg"] == "CALIB" and f["dpr.tech"] == "IMAGE,AI" and f["dpr.type"] == "PINHOLE,WAM" raw_opt_wamcam_wam_class = ClassificationRule("I_WAM_RAW", is_raw_opt_wamcam_wam) raw_opt_wamcam_wam = ( - data_source().with_classification_rule(raw_opt_wamcam_wam_class).build() + data_source() + .with_classification_rule(raw_opt_wamcam_wam_class) + .build() ) -def is_raw_opt_sky_skysiai_science(f): - return ( - f["dpr.catg"] == "SCIENCE" - and f["dpr.tech"] == "IMAGE,SI" - and f["dpr.type"] == "OBJECT,SKY" - ) +def is_raw_opt_sky_skysiai_science(f): + return f["dpr.catg"] == "SCIENCE" and f["dpr.tech"] == "IMAGE,SI" and f["dpr.type"] == "OBJECT,SKY" -raw_opt_sky_skysiai_science_class = ClassificationRule( - "I_SCI_RAW", is_raw_opt_sky_skysiai_science -) +raw_opt_sky_skysiai_science_class = ClassificationRule("I_SCI_RAW", is_raw_opt_sky_skysiai_science) raw_opt_sky_skysiai_science = ( - data_source().with_classification_rule(raw_opt_sky_skysiai_science_class).build() + data_source() + .with_classification_rule(raw_opt_sky_skysiai_science_class) + .build() ) def is_raw_opt_sky_skysiai_scienceai(f): - return ( - f["dpr.catg"] == "SCIENCE" - and f["dpr.tech"] == "IMAGE,AI" - and f["dpr.type"] == "OBJECT,SKY" - ) - + return f["dpr.catg"] == "SCIENCE" and f["dpr.tech"] == "IMAGE,AI" and f["dpr.type"] == "OBJECT,SKY" -raw_opt_sky_skysiai_scienceai_class = ClassificationRule( - "I_SCI_AI_RAW", is_raw_opt_sky_skysiai_scienceai -) +raw_opt_sky_skysiai_scienceai_class = ClassificationRule("I_SCI_AI_RAW", is_raw_opt_sky_skysiai_scienceai) raw_opt_sky_skysiai_scienceai = ( - data_source().with_classification_rule(raw_opt_sky_skysiai_scienceai_class).build() + data_source() + .with_classification_rule(raw_opt_sky_skysiai_scienceai_class) + .build() ) -def is_raw_opt_sky_skyhci_coro_corobackground(f): - return ( - f["dpr.catg"] == "CALIB" - and f["dpr.tech"] == "CORONOGRAPHY" - and f["dpr.type"] == "BACKGROUND" - ) -raw_opt_sky_skyhci_coro_corobackground_class = ClassificationRule( - "I_CORO_BGD_RAW", is_raw_opt_sky_skyhci_coro_corobackground -) + + + + + + + +def is_raw_opt_sky_skyhci_coro_corobackground(f): + return f["dpr.catg"] == "CALIB" and f["dpr.tech"] == "CORONOGRAPHY" and f["dpr.type"] == "BACKGROUND" + +raw_opt_sky_skyhci_coro_corobackground_class = ClassificationRule("I_CORO_BGD_RAW", is_raw_opt_sky_skyhci_coro_corobackground) raw_opt_sky_skyhci_coro_corobackground = ( data_source() @@ -235,16 +219,9 @@ raw_opt_sky_skyhci_coro_corobackground = ( def is_raw_opt_sky_skyhci_coro_corooffset(f): - return ( - f["dpr.catg"] == "CALIB" - and f["dpr.tech"] == "CORONOGRAPHY" - and f["dpr.type"] == "STAR" - ) + return f["dpr.catg"] == "CALIB" and f["dpr.tech"] == "CORONOGRAPHY" and f["dpr.type"] == "STAR" - -raw_opt_sky_skyhci_coro_corooffset_class = ClassificationRule( - "I_CORO_OFFSET_RAW", is_raw_opt_sky_skyhci_coro_corooffset -) +raw_opt_sky_skyhci_coro_corooffset_class = ClassificationRule("I_CORO_OFFSET_RAW", is_raw_opt_sky_skyhci_coro_corooffset) raw_opt_sky_skyhci_coro_corooffset = ( data_source() @@ -254,16 +231,9 @@ raw_opt_sky_skyhci_coro_corooffset = ( def is_raw_opt_sky_skyhci_coro_sciencecoropupil(f): - return ( - f["dpr.catg"] == "SCIENCE" - and f["dpr.tech"] == "CORONOGRAPHY" - and f["dpr.type"] == "PUPIL" - ) - + return f["dpr.catg"] == "SCIENCE" and f["dpr.tech"] == "CORONOGRAPHY" and f["dpr.type"] == "PUPIL" -raw_opt_sky_skyhci_coro_sciencecoropupil_class = ClassificationRule( - "I_SCI_CORO_PUPIL_RAW", is_raw_opt_sky_skyhci_coro_sciencecoropupil -) +raw_opt_sky_skyhci_coro_sciencecoropupil_class = ClassificationRule("I_SCI_CORO_PUPIL_RAW", is_raw_opt_sky_skyhci_coro_sciencecoropupil) raw_opt_sky_skyhci_coro_sciencecoropupil = ( data_source() @@ -273,16 +243,9 @@ raw_opt_sky_skyhci_coro_sciencecoropupil = ( def is_raw_opt_sky_skyhci_coro_sciencecorowaffle(f): - return ( - f["dpr.catg"] == "SCIENCE" - and f["dpr.tech"] == "CORONOGRAPHY,WAFFLE" - and f["dpr.type"] == "OBJECT" - ) + return f["dpr.catg"] == "SCIENCE" and f["dpr.tech"] == "CORONOGRAPHY,WAFFLE" and f["dpr.type"] == "OBJECT" - -raw_opt_sky_skyhci_coro_sciencecorowaffle_class = ClassificationRule( - "I_SCI_CORO_WAFFLE_RAW", is_raw_opt_sky_skyhci_coro_sciencecorowaffle -) +raw_opt_sky_skyhci_coro_sciencecorowaffle_class = ClassificationRule("I_SCI_CORO_WAFFLE_RAW", is_raw_opt_sky_skyhci_coro_sciencecorowaffle) raw_opt_sky_skyhci_coro_sciencecorowaffle = ( data_source() @@ -291,32 +254,33 @@ raw_opt_sky_skyhci_coro_sciencecorowaffle = ( ) -def is_raw_opt_sky_skyhci_skyhcionline_dpsicsoptsci_dpsicsopt(f): - return ( - f["dpr.catg"] == "CALIB" - and f["dpr.tech"] == "CORONOGRAPHY" - and f["dpr.type"] == "HCIOPT" - ) -raw_opt_sky_skyhci_skyhcionline_dpsicsoptsci_dpsicsopt_class = ClassificationRule( - "I_DPSICS_OPT_RAW", is_raw_opt_sky_skyhci_skyhcionline_dpsicsoptsci_dpsicsopt -) + + +def is_raw_opt_sky_skyhci_skyhcionline_dpsicsoptsci_dpsicsopt(f): + return f["dpr.catg"] == "CALIB" and f["dpr.tech"] == "CORONOGRAPHY" and f["dpr.type"] == "HCIOPT" + +raw_opt_sky_skyhci_skyhcionline_dpsicsoptsci_dpsicsopt_class = ClassificationRule("I_DPSICS_OPT_RAW", is_raw_opt_sky_skyhci_skyhcionline_dpsicsoptsci_dpsicsopt) raw_opt_sky_skyhci_skyhcionline_dpsicsoptsci_dpsicsopt = ( data_source() - .with_classification_rule( - raw_opt_sky_skyhci_skyhcionline_dpsicsoptsci_dpsicsopt_class - ) + .with_classification_rule(raw_opt_sky_skyhci_skyhcionline_dpsicsoptsci_dpsicsopt_class) .build() ) -img_masterdark = task("micado_det_dark").with_main_input(raw_dark).build() + +img_masterdark = ( + task('micado_det_dark') + .with_main_input(raw_dark) + + .build() +) img_masterflat = ( - task("micado_img_flat") + task('micado_img_flat') .with_main_input(raw_opt_flat) .with_associated_input(img_masterdark) .build() @@ -324,12 +288,15 @@ img_masterflat = ( img_nonlinearity = ( - task("micado_img_nonlinearity").with_main_input(raw_opt_nonlin).build() + task('micado_img_nonlinearity') + .with_main_input(raw_opt_nonlin) + + .build() ) img_persistence = ( - task("micado_det_persistence") + task('micado_det_persistence') .with_main_input(raw) .with_associated_input(raw) .build() @@ -337,7 +304,7 @@ img_persistence = ( img_fnl_catalogable_dt_dtsiai_dt = ( - task("micado_img_detrend") + task('micado_img_detrend') .with_main_input(raw_opt_sky_skysiai_science) .with_associated_input(img_masterdark) .with_associated_input(img_masterflat) @@ -348,7 +315,7 @@ img_fnl_catalogable_dt_dtsiai_dt = ( img_fnl_catalogable_dt_dtbkgfield = ( - task("micado_img_detrend") + task('micado_img_detrend') .with_main_input(raw_opt_sky_bkgfield) .with_associated_input(img_masterdark) .with_associated_input(img_masterflat) @@ -359,14 +326,15 @@ img_fnl_catalogable_dt_dtbkgfield = ( img_background = ( - task("micado_img_background") + task('micado_img_background') .with_main_input(img_fnl_catalogable_dt_dtbkgfield) + .build() ) img_fnl_catalogable_dt_dtillum = ( - task("micado_img_detrend") + task('micado_img_detrend') .with_main_input(raw_opt_sky_illum) .with_associated_input(img_masterdark) .with_associated_input(img_masterflat) @@ -377,7 +345,7 @@ img_fnl_catalogable_dt_dtillum = ( hdr_statictable_illumcorr = ( - task("micado_img_illum") + task('micado_img_illum') .with_main_input(img_fnl_catalogable_dt_dtillum) .with_associated_input(cat_photomref) .build() @@ -385,7 +353,7 @@ hdr_statictable_illumcorr = ( img_fnl_catalogable_dtfnl_dtfnlsiai_dtfnl = ( - task("micado_img_detrend_final") + task('micado_img_detrend_final') .with_main_input(img_fnl_catalogable_dt_dtsiai_dt) .with_associated_input(img_background) .with_associated_input(hdr_statictable_illumcorr) @@ -394,7 +362,7 @@ img_fnl_catalogable_dtfnl_dtfnlsiai_dtfnl = ( img_fnl_catalogable_dt_dtsiai_dtai = ( - task("micado_img_detrend") + task('micado_img_detrend') .with_main_input(raw_opt_sky_skysiai_scienceai) .with_associated_input(img_masterdark) .with_associated_input(img_masterflat) @@ -405,7 +373,7 @@ img_fnl_catalogable_dt_dtsiai_dtai = ( img_fnl_catalogable_dtfnl_dtfnlsiai_dtfnlai = ( - task("micado_img_detrend_final") + task('micado_img_detrend_final') .with_main_input(img_fnl_catalogable_dt_dtsiai_dtai) .with_associated_input(img_background) .with_associated_input(hdr_statictable_illumcorr) @@ -414,7 +382,7 @@ img_fnl_catalogable_dtfnl_dtfnlsiai_dtfnlai = ( img_fnl_catalogable_dt_dtwam = ( - task("micado_img_detrend") + task('micado_img_detrend') .with_main_input(raw_opt_wamcam_wam) .with_associated_input(img_masterdark) .with_associated_input(img_masterflat) @@ -425,7 +393,7 @@ img_fnl_catalogable_dt_dtwam = ( img_fnl_catalogable_dtfnl_dtfnlwam = ( - task("micado_img_detrend_final") + task('micado_img_detrend_final') .with_main_input(img_fnl_catalogable_dt_dtwam) .with_associated_input(img_background) .with_associated_input(hdr_statictable_illumcorr) @@ -434,7 +402,7 @@ img_fnl_catalogable_dtfnl_dtfnlwam = ( hdr_distortion_distortionwam = ( - task("micado_img_distortion") + task('micado_img_distortion') .with_main_input(img_fnl_catalogable_dtfnl_dtfnlwam) .with_associated_input(cat_distortionref_wamref) .build() @@ -442,7 +410,7 @@ hdr_distortion_distortionwam = ( img_fnl_catalogable_dt_dtastromfield = ( - task("micado_img_detrend") + task('micado_img_detrend') .with_main_input(raw_opt_sky_astromfield) .with_associated_input(img_masterdark) .with_associated_input(img_masterflat) @@ -453,7 +421,7 @@ img_fnl_catalogable_dt_dtastromfield = ( img_fnl_catalogable_dtfnl_dtfnlastromfield = ( - task("micado_img_detrend_final") + task('micado_img_detrend_final') .with_main_input(img_fnl_catalogable_dt_dtastromfield) .with_associated_input(img_background) .with_associated_input(hdr_statictable_illumcorr) @@ -462,7 +430,7 @@ img_fnl_catalogable_dtfnl_dtfnlastromfield = ( hdr_distortion_distortionelt = ( - task("micado_img_distortion") + task('micado_img_distortion') .with_main_input(img_fnl_catalogable_dtfnl_dtfnlastromfield) .with_associated_input(cat_distortionref_astromref) .build() @@ -470,7 +438,7 @@ hdr_distortion_distortionelt = ( hdr_astrom = ( - task("micado_img_astrom") + task('micado_img_astrom') .with_main_input(img_fnl_catalogable_dtfnl_dtfnlsiai_dtfnl) .with_associated_input(cat_distortionref_astromref) .with_associated_input(hdr_distortion_distortionwam) @@ -480,7 +448,7 @@ hdr_astrom = ( hdr_photom_photomscience = ( - task("micado_img_photom") + task('micado_img_photom') .with_main_input(img_fnl_catalogable_dtfnl_dtfnlsiai_dtfnl) .with_associated_input(hdr_astrom) .with_associated_input(cat_photomref) @@ -489,7 +457,7 @@ hdr_photom_photomscience = ( img_fnl_catalogable_dt_dtstdfield = ( - task("micado_img_detrend") + task('micado_img_detrend') .with_main_input(raw_opt_sky_stdfield) .with_associated_input(img_masterdark) .with_associated_input(img_masterflat) @@ -500,7 +468,7 @@ img_fnl_catalogable_dt_dtstdfield = ( img_fnl_catalogable_dtfnl_dtfnlstdfield = ( - task("micado_img_detrend_final") + task('micado_img_detrend_final') .with_main_input(img_fnl_catalogable_dt_dtstdfield) .with_associated_input(img_background) .with_associated_input(hdr_statictable_illumcorr) @@ -509,7 +477,7 @@ img_fnl_catalogable_dtfnl_dtfnlstdfield = ( hdr_photom_photomstdfield = ( - task("micado_img_photom") + task('micado_img_photom') .with_main_input(img_fnl_catalogable_dtfnl_dtfnlstdfield) .with_associated_input(hdr_astrom) .with_associated_input(cat_photomref) @@ -518,7 +486,7 @@ hdr_photom_photomstdfield = ( img_fnl_catalogable_calibrated = ( - task("micado_img_calibrate") + task('micado_img_calibrate') .with_main_input(img_fnl_catalogable_dtfnl_dtfnlsiai_dtfnl) .with_associated_input(hdr_photom_photomscience) .with_associated_input(hdr_astrom) @@ -527,5 +495,10 @@ img_fnl_catalogable_calibrated = ( img_stack = ( - task("micado_img_stack").with_main_input(img_fnl_catalogable_calibrated).build() + task('micado_img_stack') + .with_main_input(img_fnl_catalogable_calibrated) + + .build() ) + + -- GitLab