User Manual: Code: Misc: fluxon placement fs

From FLUX

Jump to: navigation, search

fluxon_placement_fs is a PDL routine that uses Floyd-Steinberg dithering to place fluxons on a boundary image. It works reasonably well for fields that have sufficient detail to randomize the placement of individual fluxons, but for fields without sufficient detail it fails miserably. See also fluxon_placement_hilbert.

Usage:

  $points = fluxon_placement_fs($mag, $est_count)
-or-
  $points = fluxon_placement_fs($mag, -$flux)

You supply a magnetogram image and either a desired total fluxon count or a desired flux per fluxon (in magnetogram count-pixels), and you get back a 3xn array of point locations and some ancillary information. The total fluxon count is an upper bound on the number of fluxons placed; typical fluxon counts are close to half of the specified count.

Floyd-Steinberg dithering works by error diffusion -- each pixel (or subpixel: fluxon_placement_fs subdivides pixels if necessary to accomodate the densest parts of the image) may be either -1, 0, or 1 in units of the fluxon flux; the quantization error (residual after matching the magnetogram signal) is diffused from the subject pixel to surrounding pixels as the algorithm makes its way through the image, effectively lowering the threshold in large, weak regions of the magnetogram).

Floyd-Steinberg only approximately conserves signed flux, and certainly doesn't conserve unsigned flux -- but it gives a good apparent match with the underlying data and does not introduce periodic structure (other than the pixel grid) into the fluxon placements.

Here are some sample images showing the quality of match between the dithering algorithm and an MDI magnetogram with different values of the approximate fluxon count parameter:

Personal tools