Skip to content

Flareformer: Large-scale Solar Flare Prediction by Integrating Magnetograms and Sunspot Physical Features

License

Notifications You must be signed in to change notification settings

keio-smilab22/Flareformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flareformer

PyTorch training code for Flareformer.

model

Getting Started

Requirements

  • Python >= 3.8.10
  • CUDA >= 11.1
  • PyTorch >= 1.8.2

Installation

  1. git clone git@github.com:keio-smilab22/Flareformer.git
  2. cd Flareformer
  3. pip install -r requirements.txt

Data preparation

$ cd ~/work/flare_transformer
$ mv ~/data.zip data/
$ unzip data/data.zip
$ mv ~/magnetogram_images.tar.gz data/
$ tar -zxvf data/magnetogram_images.tar.gz

Preprocess

  • Preprocess the physical features and magnetogram images by the following procedure (parallel processing).

    • python preprocess/main.py --magnetogram --physical --label --window
  • The following data files should be created under data/.

    • data/data_20XX_magnetogram_256.npy
    • data/data_20XX_feat.csv
    • data/data_20XX_label.csv
    • data/data_20XX_window_48.csv

Training

  • To train Flareformer with warmup and cRT using params/params_2014.json:

    • python main.py --params params/params_2014.json --warmup_epochs=5 --imbalance --wandb

License

Flareformer is released under the BSD-3-Clause-Clear license. Please see the LICENSE file for more information.

Others

Qualitative Results

  • The figure below shows line-of-sight magnetograms from September 3th, 2017 23:00 UT to September 5th, 2017, 23:00 UT. An X-class solar flare occurred at 12:02 on September 6, 2017, and the model was able to predict the correct maximum solar flare class.

    magnetogram_256

Developer's env.

Hardware

  • Ubuntu 20.04LTS
  • GPU: GeForce RTX 3080 laptop
  • GPU RAM: 16GB GDDR6
  • CPU: Core i9 11980HK
  • RAM: 64 GB Libraries
  • CUDA 11.1

About

Flareformer: Large-scale Solar Flare Prediction by Integrating Magnetograms and Sunspot Physical Features

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published