create new tag
view all tags

Small Event Detection


  • Inputs: AIA images in multiple wavelengths.

  • Outputs: Processed images showing small event locations; total number of events. Statistical studies e.g. distribution of size, duration, intensity?

  • Problem: To take AIA images and process them to locate small events.

The table below outlines the various types of small events and their occurrence domain:

PhenomenonHorizontal domainVertical domainWavelengths
Ephemeral regionsQuiet sunPhotosphereOptical
Emerging flux eventsQuiet sun, active regionPhotosphereOptical</TD
Cancelling magnetic flux eventsQuiet sun, active regionPhotosphereOptical</TD
Explosive eventsQuiet sunTransition regionEUV
BlinkersQuiet sun, active regionTransition regionEUV
Nanoflares, microflaresQuiet sun, active regionCoronaEUV, soft X-ray
X-ray bright pointsQuiet sunCoronaSoft X-ray
Soft X-ray jetsQuiet sun, active regionCoronaSoft X-ray
Active region transient brighteningsActive regionCoronaSoft X-ray

However, when analysing images for small events, we do not need to ascribe detected events to being of a particular type.

Literature Search


  • D.Berghmans, F.Clette, and D.Moses. Astron.Astrophys. 336,1039-1055 (1998)
    • Defines a background reference emission (average light curve of each pixel over a time period). Events are then defined as being pixels with intensity peaks significantly above this background value. The spatial and temporal extent of the event is then defined.
  • D.Bewsher, C.E.Parnell, and R.A.Harrison. Solar Physics. 206(1),21-43 (2002)
    • Describes the BLinker Identification Program (BLIP). Finds groups of pixels with significant simultaneous peaks.

  • T.Shimizu. Publ. Astron. Soc. Japan. 47,251-263 (1995)
    • Divides original images into macropixels and extracts average lightcurve for this macropixel. Any significant enhancements of the light curves are considered to be events.
    • Problems: smooths out smallest events, an ‘event’ may be detected after a dip in the lightcurve.

  • A.Brkovic, S.K.Solanki, and I.Ruedi. Astron.Astrophys. 373,1056-1072 (2001)
    • Identifies blinkers by finding time steps at which the intensities of individual pixels exceed that of their time-average intensity by a given threshold.

  • M.J.Aschwanden, R.W.Nightingale, T.D.Tarbell, and C.J.Wolfson. Ap.J. 535,1027-1046 (2000)
    • Spatio-temporal pattern recognition code which extracts events with significant variability.

  • C.E.Parnell, and P.E.Jupp. Ap. J. 529,554-569 (2000)
    • Uses peaks in emission measure (DEM) for each pixel to identify events.
Small events:

Routines and Libraries

Andrzej Fludra contacted David Berghmans who sent us the IDL code he used for his papers.

Test Data

SOHO EIT data?


  • Do we want to make a small event catalogue? Even if we are not trying to categorise events, we could present statistics e.g. number within a certain size range, total, average over periods, total in a certain temporal range, lifetimes, intentsity ranges etc.

  • It has been suggested that it might be useful to check that detected events can be seen at various wavelengths.

  • Small events could be as small as one pixel spatially, and temporally may exist in only one image in a time series.

  • If events are as small as described above, might it be difficult to differentiate between cosmic rays and small events?

Using the Small Events Detection algorithm

This spatial-temporal pattern recognition code is based on the algorithm developed by Aschwanden et al. (2000) to detect regions on the Sun where "small events", i.e. micro- or nano-flare events have occurred. Aschwanden's code was originally written in IDL. This C implementation of the Aschwanden algorithm has been specially developed and adapted for the eSDO project.

The automated loop recognition algorithm is designed to receive a time incremented series of flatfield images in the form of a datacube as input. Each full image is rebinned into a number of macropixels. For instance a 256x256 pixel image could be binned into 128x128 macropixel image if each macropixel consists of 2x2 pixels.

An "event" is then spatially defined to include a number of neighbouring macro-pixels that undergo coherent time variability. These macropixels are marked so as not to be included in subsequent event searches and examination of the image continues. In this way a number of events are defined and relevent statistical information can be derived. The output is written to a copy of the input FITS file and can be be viewed with any standard FITS viewer.

The code makes extensive use of NASA's HEASARC cfitsio library for FITS file manipulation.

The code has been built and tested on the following Linux platforms:

RedHat Enterprise 4

      • gcc (version 3.4.6)
      • cfitsio (version 3.04)


      • gcc (version 3.4.4)
      • cfitsio (version 3.04)

Files and Directories Checklist:

The following lists the necessary source, include, library and miscellaneous files required to build the Small Events Detection executable. The main sources are held in the $BASE directory. Within $BASE directory are two more directories, $BASE/headers (containing many of the include files) and $BASE/ndArray, which contain code which allow a basic emulation of IDL array type structures and manipulation.

Sources: ($BASE)

  • dyn_mem_alloc_fns.c
  • event_struct.c
  • math_fns.c
  • printerror.c
  • small_events_ascii_output.c
  • small_events_detection.c
  • small_events_fits_lightcurve.c
  • small_events_fits_output.c
  • structure_pattern.c
  • trace_ellipse.c
  • trace_variable.c

Includes: ($BASE/headers)

  • fitsio.h (cfitsio include)
  • longnam.h (cfitsio include)
  • array_struct.h
  • dyn_mem_alloc_fns.h
  • eSDOfits.h
  • event_struct.h
  • math_fns.h
  • ndArray.h
  • print_struct.h
  • structure_pattern.h
  • trace_ellipse.h
  • trace_variable.h
  • where.h

NdArray: ($BASE/ndArray)

  • array_struct.h
  • ndArray.c
  • ndArray.h
  • where.c
  • where.h

Libraries: (/usr/local/lib)

  • libcfitsio.a (cfitsio library)

Miscellaneous: ($BASE)

  • fov.txt
  • Makefile


1) Place the listed files in the desired working directory ($BASE).

2) Modify the BASE and BASE2 directives in the Makefile to reflect the user's own working directory.

3) Make sure that the fitsio.h version number is the same as that used in creating your libcfitsio.a file when you installed cfitsio.

4) Run 'make force'.

Assuming there are no errors, an executable called 'SmallEventsDetection' is created under the working directory.

Running SmallEventsDetection

1) At the command prompt type:

% ./SmallEventsDetection <input filename><Size of Macropixel><FOV restrictions>

  • <input filename>
    is the filename of the input FITS file.

The file doesn not need to reside in the same directory as the executable. However if this is the case, the filename must be prefixed with the relative or absolute pathname. Maximum pathname length (including the filename) is 250 characters. This is the only required input parameter.

  • <Size of Macropixel>
    this is the length of one side of a macropixel. For instance if the original image size is 1024x1024 pixels, a user specified macropixel size of 4 will bin the original image into a 256x256 macropixel image, where each macropixel is made up of 4x4 pixels. This input parameter is optional, with a default value of 4 for the macropixel size.

  • <FOV restrictions>
    This is another optional input parameter, and flags whether or not to restrict the field of view of the image. The default value is "No". If field of view restrictions are required (for instance the user is only interested in the central two-thirds of the image or if the outer regions of the image are saturated), then a "YES" input parameter is required here. (This can be input as Y,YES,y,yes, or any combination of these as long as the first letter is Y or y). If this option is selected the user needs to supply a file called "fov.txt" and this needs to reside in the directory where the executable is being run.

If FOV restrictions are required, then the macropixel size option MUST also be included.

The "fov.txt "file comprises 5 numbers of type double which give the bottom left and top right X and Y positions of the bounding box, restriciting the field of view as a fraction of the X,Y-axes respectively. The fifth number gives the difference between the radius of the restricted field of view and the edge of the image in macropixels. For instance in our example above we start with an original image of 1024x1024 pixels. If this is binned into macropixels of 4x4 pixels, we get an image of 256x256 macropixels. If the bottom left and top right coordinates of our bounding box are (0.0,0.25),(0.9785,1.0) then the first 4 numbers of fov.txt are:


If the difference between the radius of the the restricted field of view and the edge of the image is 20 macropixels, then this becomes your fifth number. So your fov.txt will look like this:


(An example fov.txt file is included in the distribution).

Example Inputs are:

./SmallEventsDetection ../qs171ad.fits
./SmallEventsDetection qs171ad.fits 4
./SmallEventsDetection ~/data/qs171ad.fits 4 Yes
./SmallEventsDetection ../../qs171ad.fits 4 YES
./SmallEventsDetection ../qs171ad.fits 4 yES
./SmallEventsDetection ../qs171ad.fits 4 yESsireeBob

The above are all valid inputs.

If the executable is called without a fits file to process then the program terminates with the following message listing the required inputs:

Usage: <input filename><Size of Macropixel><FOV restrictions>

          Input parameters:

          1: Name of the FITS file to be processed
             -include pathname if file is not in current
             directory (Required).
          2: Size of one side of a Macropixel in pixels.
          3: Flag denoting whether to constrain FOV.
             - 'Y' denotes FOV restrictions required.
             - <No FOV restrictions is the default>.

2) Processing takes a few seconds and then returns the user to the commandline prompt. Any errors encountered during processing will be displayed on screen.

3) If processing is successful, then two output files are produced. One is an ASCII file containing the output for each event in tabular form. The second is a fits file comprising three extensions. The main fits header unit is a copy of the input datacube image. The first extension is an ASCII table containing the same output as the ASCII file. The second extension contains the lightcurves for each event.

The tabular output for both the ascii and fits outputs are as follows:

         nr:      The event number in the output list. 
         nstruc:  The number of macropixels comprising the event.
         tmini:   Time series array element number at which minimum occurs.
         tmax:    Time series array element number at which maximum occurs.
         xc:      X-coordinate of the center of ellipse enveloping event.
         yc:      X-coordinate of the center of ellipse enveloping event.
         len:     Length of major axis of ellipse.    
         wid:     Width of minor axis of ellipse.     
         al:      Orientation of ellipse major-axis to the image x-axis 
                  (in degrees).    
         flux:    Total Flux contained within the event.
         fluxavg: Average flux within the macropixels of an event. 
         fill:    Filling factor. 

The output ascii file name is the same as the input file name, minus the fits extension of course, and appended with

. The Fits output file is appended with
. For example if the input file was named
, the output files would be named
for the ascii and fits outputs respectively. Make sure that fits files with these names do not already exist in the working directory.
The input FITS file remains unmodified.

-- VitoGraffagnino - 15 Oct 2007

-- SimonMartin - 22 Apr 2005

-- ElizabethAuden - 11 Jan 2005

Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | More topic actions
Topic revision: r11 - 2007-10-15 - VitoGraffagnino
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback