Skip to content

crura/CoronaMETRIC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

668 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoronaMETRIC - Corona Magnetic-field Evaluation Through Real Image-model Comparison

Description

This package, given a PSI MAS model and a coronagraph input image generates co-aligned electron density and magnetic field from the perspective of the input image. This framework uses QRaFT, a global coronal feature tracing algorithm, to compare quasi-radial features identified from in white-light coronagraph images to the outputs of the MAS Model using the FORWARD toolset. This package geometrically compare features segmented in artificial images generated from FORWARD to those segmented in white-light coronagraph observations against the plane-of-sky projected MAS coronal magnetic field. A series of useful metrics are calculated from this comparison, which allows for further quantitative evaluations of image-based coronal segmentation methods against magnetic field models, and vice-versa. A further description is available in my paper, which I will link once accepted and published.

Package Layout

Main IDL Scripts

  • run_code.pro : main IDL program file, sets main input variables from config.json and executes program
  • generate_forward_model.pro : responsible for generating forward model from PSI data cube given input model_parameters
  • get_fordump.pro : responsible for transforming forward data (electron density, bx, by, bz) into cartesian coordinates, saving data slices for later integration
  • image_coalignment.pro : responsible for co-aligning model data to input observatory data
  • save_parameters.pro : reads and writes MHD output files during image co-alignment and integration
  • run_qraft_test.pro : looks for input files based on filename and feeds them into QRaFT for analysis

Main Python Scripts

  • Python_Scripts/integrate.py : responsible for integrating data slices generated by get_fordump.pro to produce integrated electron desnity, magnetic field data
  • Python_Scripts/coalign.py : responsible for generating output image co-alignment plots
  • Python_Scripts/functions.py : place for most utility functions that are executed throughout analysis portion of program
  • Python_Scripts/print_results.py : defines and prints SQL output queries into output txt file
  • Python_Scripts/Test_Plot_3_0_Features.py : Main python program for calculating metrics and generating output plots

Other Notable Scripts

  • config.json : main configuration file for program. Defines input PSI MAS data cube path and input paths to COR-1/K-COR data files.
  • setupDB.sql : defines and creates the necessary tables needed to store input data from QRaFT/FORWARD as well as output data such as metrics. Ran as sqlite3 [dbName] < setupDB.sql, (in this repository dbName is set to tutorial.db)

NOTE: In the below scripts, the hard coded paths in the IDL compile statements must be reset by the user, besides the dynamically controlled paths, given by the $git_repo variable. Each of the below files must be run in sequence for a local workflow.

  • test_run_forward.sh : script that compiles all necessary IDL functions and generates forward model and data slices from MAS output. Equivalent to Generate forward model and data slices job in CI.
  • test_run_qraft3-0.sh : script that compiles necessary IDL files and runs QRaFT. Equivalent to Run QRaFT job in CI.
  • test_run_python.sh : script that runs all necessary Python script to generate statistics and plots in my paper. Equivalent to Plot Figures for Paper job in CI.

Python Dependencies

Note: full list of dependencies are listed in requirements.txt

  • os
  • numpy
  • pandas
  • matplotlib
  • astropy
  • sunpy
  • gitpython

IDL Dependencies

  • SSW IDL
    • Note: package FORWARD must be installed with SolarSoft Install script

Submodules Used

  • V. Uritsky. Quasi-Radial Field-line Tracing (QRaFT v2.0): an image analysis package for reconstructing the magnetic field geometry of the open-flux solar corona, GitHub / Zenode, 2022, URL: github.com/uritsky/QRaFT, DOI:10.5281/zenodo.7410948.

Data Used

  • Predictive Science Inc. 2017 solar eclipse prediction raw simulation data. Data is available at this link. Follow the instructions in ExampleCommands_FORWARD.txt to generate data cube used in this analysis. Citation: Mikić, Z., Downs, C., Linker, J.A. et al. Predicting the corona for the 21 August 2017 total solar eclipse. Nat Astron 2, 913–921 (2018). https://doi.org/10.1038/s41550-018-0562-5

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors