diff --git a/corkit/lasco.py b/corkit/lasco.py index a8756f9..d3f273b 100644 --- a/corkit/lasco.py +++ b/corkit/lasco.py @@ -88,7 +88,7 @@ def level_1( if img0 is None: print("FITS file doesn't contain image data, avorting and deleting...") os.remove(fits_files) - return None, None + return None detector: str = header["detector"].strip().upper() header.add_history( f"corkit/lasco.py level_1: (function) {__version__}, 12/04/24" @@ -145,14 +145,11 @@ def level_1( img, header = final_step( target_path, format, b, header, xsumming, ysumming, **kwargs ) - header["level_1"] = 1 - if target_path is not None: save(target_path, filename.replace(".", ""), format, img, header) - - print("Done!") - return img, header + else: + return img, header elif isinstance(fits_files, list): _, sample_hdr = FITS(fits_files[0]) @@ -164,7 +161,7 @@ def level_1( vig_fn = os.path.join(DEFAULT_SAVE_DIR, "c2vig_final.fts") vig_full = fits.getdata(vig_fn) for filepath in fits_files: - level_1( + o = level_1( filepath, target_path, format, @@ -172,6 +169,8 @@ def level_1( detector=detector, vig_full=vig_full, ) + if o is not None: + out.append(o) case "C3": vig_pre, vig_post = _read_vig_full() mask = _read_mask_full() @@ -190,7 +189,7 @@ def level_1( model = cross_model_reconstruction() args = (vig_pre, vig_post, mask, ramp, bkg, model, forward, inverse) for filepath in fits_files: - level_1( + o = level_1( filepath, target_path, format, @@ -198,11 +197,13 @@ def level_1( **kwargs, detector=detector, ) + if o is not None: + out.append(o) return out def final_step( - target_path: str, + target_path: Optional[str], filetype: str, img: NDArray, header: fits.Header, @@ -258,7 +259,7 @@ def final_step( f"CorKit Level 1 calibration with python modules: level_1.py, open source level 1 implementation." ) header["date"] = datetime.now().strftime("%Y/%m/%d %H:%M:%S.%f") - header["filename"] = os.path.basename(target_path) + header["filename"] = os.path.basename(target_path) if target_path is not None else 'null' header["CRPIX1"] = crpix_x header["CRPIX2"] = crpix_y header["CROTA"] = r_hdr diff --git a/paper/agujournaltemplate.fdb_latexmk b/paper/agujournaltemplate.fdb_latexmk index 2994fbe..ac740ca 100644 --- a/paper/agujournaltemplate.fdb_latexmk +++ b/paper/agujournaltemplate.fdb_latexmk @@ -1,5 +1,5 @@ # Fdb version 4 -["pdflatex"] 1731701986.84058 "agujournaltemplate.tex" "agujournaltemplate.pdf" "agujournaltemplate" 1731701987.21366 2 +["pdflatex"] 1731683146.3169 "agujournaltemplate.tex" "agujournaltemplate.pdf" "agujournaltemplate" 1731683146.66491 2 "/usr/share/texmf-dist/fonts/map/fontname/texfonts.map" 1727349926 3524 cb3e574dea2d1052e39280babc910dc8 "" "/usr/share/texmf-dist/fonts/tfm/jknappen/ec/ectt1000.tfm" 1727349926 1536 06717a2b50de47d4087ac0e6cd759455 "" "/usr/share/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmbsy5.tfm" 1727349926 1120 1e8878807317373affa7f7bba4cf2f6a "" @@ -88,12 +88,12 @@ "/usr/share/texmf-dist/tex/latex/url/url.sty" 1727349926 12796 8edb7d69a20b857904dd0ea757c14ec9 "" "/usr/share/texmf-dist/tex/latex/xcolor/xcolor.sty" 1727349926 55487 80a65caedd3722f4c20a14a69e785d8f "" "/usr/share/texmf-dist/web2c/texmf.cnf" 1727349926 41588 b43d3e860a4f94167ee1e725ff526a72 "" - "/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map" 1731200593.38001 5312047 b07fcd2a9090df96fc745b92a3db793b "" - "/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1731200550 7112990 ced10c4021316592138165990aff6dc5 "" - "agujournal2019.cls" 1731690459.7938 40688 b442a0d4e8a299883855595037ff6651 "" - "agujournaltemplate.aux" 1731701987.1502 1176 cc8d5671406d2e473c4040645671c316 "pdflatex" - "agujournaltemplate.tex" 1731701984.92353 13822 c2235b334d13fd061c2323325a2704cb "" - "trackchanges.sty" 1731690459.80047 26287 09689e5e9db973d136f0537b8570fadf "" + "/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map" 1730886873.20255 5312047 b07fcd2a9090df96fc745b92a3db793b "" + "/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1730886860 7112992 df1b11a02f5c3ca462c6cbb5ab44f133 "" + "agujournal2019.cls" 1731367162 40688 b442a0d4e8a299883855595037ff6651 "" + "agujournaltemplate.aux" 1731683146.60324 1176 cc8d5671406d2e473c4040645671c316 "pdflatex" + "agujournaltemplate.tex" 1731683145.89658 13822 e2654476056d73422bf881ceda2de39f "" + "trackchanges.sty" 1731367162 26287 09689e5e9db973d136f0537b8570fadf "" (generated) "agujournaltemplate.aux" "agujournaltemplate.log" diff --git a/paper/agujournaltemplate.pdf b/paper/agujournaltemplate.pdf index 84a0154..dbb7f22 100644 Binary files a/paper/agujournaltemplate.pdf and b/paper/agujournaltemplate.pdf differ diff --git a/paper/agujournaltemplate.synctex.gz b/paper/agujournaltemplate.synctex.gz index c07225d..0e4caae 100644 Binary files a/paper/agujournaltemplate.synctex.gz and b/paper/agujournaltemplate.synctex.gz differ diff --git a/paper/agujournaltemplate.tex b/paper/agujournaltemplate.tex index 311ba7b..d9529f6 100644 --- a/paper/agujournaltemplate.tex +++ b/paper/agujournaltemplate.tex @@ -30,11 +30,11 @@ \section{Introduction} Thanks to the imagery received from coronagraphs, our knowledge about solar phenomena and the dynamics of several types of solar outbursts has been cleared out throughout the years. -SOHO, a joint project of ESA and NASA, was launched in 1995. It is designed to study the Sun from its core to the outer corona and the solar wind. The Large Angle and Spectrometric Corongraph (LASCO) is one of the instruments on SOHO; it observes the solar corona through the coronagraph ideation of light blockage. It is a foundamental tool to detect hazardous CMEs that can alter our geomagnetic field. +SOHO, a joint project of ESA and NASA, was launched in 1995. It is designed to study the Sun from its core to the outer corona and the solar wind. The Large Angle and Spectrometric Corongraph (LASCO) is one of the instruments on SOHO; it observes the solar corona through the coronagraph ideation of light blockage. It is a fundamental tool to detect hazardous CMEs that can alter our geomagnetic field. Spacecrafts instruments' data products are ordered by level of processing: Level 0 (Raw data and telemetry), Level 1 (Data Calibrated in physical units), and Level 2,3,... (Further feature engineered data products for diverse purposes). Generally, the non-calibrated products (Level 0 or intermediate representations) are stored in large databases, with personalized access for scientific research. The SolarSoftware library of IDL is used to calibrate the raw data into Level 1 using the `reduce_level_1.pro` routine. -This is a well stablished tool for scientifc computing, yet the access to it is constrained by the programming language licensing and usage requirements. As long as IDL is licensed, open science for astrophysics is not possible. Therefore, the development of an open-source alternative would be beneficial for the scientific comunity. +This is a well established tool for scientifc computing, yet the access to it is constrained by the programming language licensing and usage requirements. As long as IDL is licensed, open science for astrophysics is not possible. Therefore, the development of an open-source alternative would be beneficial for the scientific comunity. On the other hand, the calibration process of coronagraphs were adapted to the computing and reconstruction knowledge known by 2000. Data loss, tipically on 32 by 32 blocks, were reconstructed with fuzzy recompositors to recreated the dynamics around the missing block. However, modern deep learning architectures are more suitable for image reconstruction empirically.