This page describes the built-in functions available in ImageMath scripts.
Solar Image Reconstruction
IMG
Returns the reconstructed image at the specified pixel offset.
Argument |
Required? |
Description |
Default value |
|
Pixel shift |
||
Examples
img(0)
img(ps: 1)
img(ps: a2px(1)) // 1 Å pixel shift
RANGE
Returns the reconstructed image at the pixel offsets represented by the interval.
Argument |
Required? |
Description |
Default value |
|
|||
|
End of the interval (inclusive) |
||
|
Step of the interval |
1 |
|
Examples
range(-1;1)
range(-1;1;0.5))
range(from: -10; to: 10; step: 2)
Math functions
AVG
Computes the average of its arguments. If the arguments are images, the average is computed pixel-wise.
Argument |
Required? |
Description |
Default value |
|
Arguments |
||
Examples
avg(range(-1;1))
avg(img(0); img(1))
CONCAT
Concatenates argument lists.
Argument |
Required? |
Description |
Default value |
|
Arguments |
||
Examples
concat(list(img(0));range(-1;1))
EXP
Computes an exponential
Argument |
Required? |
Description |
Default value |
|
Value |
||
|
Exponent |
||
Examples
exp(img(0); 1.5)
exp(v:img(0), exp: 2)
exp(2, 3)
exp(v:2, exp: 3)
LOG
Computes a logarithm
Argument |
Required? |
Description |
Default value |
|
Value |
||
|
Exponent |
||
Examples
log(img(0); 1.5)
log(v:img(0), exp: 2)
log(2, 3)
log(v:2, exp: 3)
MAX
Computes the maximum of its arguments. If the arguments are images, the maximum is computed pixel-wise.
Argument |
Required? |
Description |
Default value |
|
Arguments |
||
Examples
max(range(-1;1))
max(img(0); img(1))
MEDIAN
Computes the median of its arguments. If the arguments are images, the median is computed pixel-wise.
Argument |
Required? |
Description |
Default value |
|
Arguments |
||
Examples
median(range(-1;1))
median(img(0); img(1))
MIN
Computes the minimum of its arguments. If the arguments are images, the minimum is computed pixel-wise.
Argument |
Required? |
Description |
Default value |
|
Arguments |
||
Examples
min(range(-1;1))
min(img(0); img(1))
POW
Computes a power
Argument |
Required? |
Description |
Default value |
|
Value |
||
|
Exponent |
||
Examples
pow(img(0); 1.5)
pow(v:img(0), exp: 2)
pow(2, 3)
pow(v:2, exp: 3)
WEIGHTED_AVG
Computes a weighted average of images
Argument |
Required? |
Description |
Default value |
|
Images |
||
|
Weights |
||
Examples
weighted_avg(range(-1;1);list(.5;1;.5))
weighted_avg(images: range(-1;1); weights: list(.5;1;.5)))
Utilities
AR_OVERLAY
Generates an overlay of the detected active regions. This feature will only work if active region image generation has been selected.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
0 : do not display 1 : display the regions and the labels 2 : display only the labels |
1 |
|
Examples
ar_overlay(continuum())
ar_overlay(img: img(0); labels: 2)
CHOOSE_FILE
Opens a dialog box to choose an image file.
Argument |
Required? |
Description |
Default value |
|
An ID for the file chooser. The next time the function is called with the same ID, the directory where the file chooser was opened will be used as the starting point. |
||
|
Title of the dialog box |
||
Examples
choose_file("my_id", "Choose a file")
choose_file(id: "my_id", title: "Choose a file")
CHOOSE_FILES
Opens a dialog box to choose multiple image files.
Argument |
Required? |
Description |
Default value |
|
An ID for the file chooser. The next time the function is called with the same ID, the directory where the file chooser was opened will be used as the starting point. |
||
|
Title of the dialog box |
||
Examples
choose_files("my_id", "Choose a file")
choose_files(id: "my_id", title: "Choose a file")
ELLIPSE_FIT
Triggers a new detection of the shape of the solar disk.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
ellipse_fit(img(0))
ellipse_fit(img:range(0;1))
FILTER
The filter function can be used on a list of images to keep these which match a particular criteria. This can be particularly useful in batch mode. For example, you may want to perform a vertical and horizontal flip to images after a certain time, because of meridian flip.
Argument |
Required? |
Description |
Default value |
||||||||||||||||||||||||||||
|
List of images to filter. |
||||||||||||||||||||||||||||||
|
Sbject of the filter ( |
||||||||||||||||||||||||||||||
|
Operator to apply to filter the images. |
||||||||||||||||||||||||||||||
|
Value for comparison |
||||||||||||||||||||||||||||||
|
Examples
filter(images, "file-name", "contains", "2021-06-01")
filter(img: images, subject:"file-name", function:"contains", value:"2021-06-01")
filter(images, "dir-name", "contains", "2021-06-01")
filter(imgimages, subject:"dir-name", function:"contains", value:"2021-06-01")
filter(images, "pixel-shift", ">", 0)
filter(images, "time", ">", "12:00:00")
filter(images, "datetime", ">", "2021-06-01 12:00:00")
GET_AT
Returns the value of an element in a list at the specified position.
Argument |
Required? |
Description |
Default value |
|
List |
||
|
Index |
||
Examples
get_at(list; 0)
get_at(list: some_list; index: 1)
GET_B
Extracts the blue channel from an image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
get_b(some_image)
get_b(img: some_image)
GET_G
Extracts the green channel from an image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
get_g(some_image)
get_g(img: some_image)
GET_R
Extracts the red channel from an image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
get_r(some_image)
get_r(img: some_image)
LIST
Creates a list from the parameters.
Argument |
Required? |
Description |
Default value |
|
List |
||
Examples
list(img(-3), img(3))
list(list: img(-3), img(3))
LOAD
Loads an image from a file.
Argument |
Required? |
Description |
Default value |
|
File path |
||
Examples
load('image.fits')
load(file: '/path/to/image.fits')
LOAD_MANY
Loads many images from a directory.
Argument |
Required? |
Description |
Default value |
|
Directory path |
||
|
Regular expression to filter files |
.* |
|
Examples
load_many("/chemin/vers/dossier")
load_many(dir: "/chemin/vers/dossier", pattern:".*cropped.*")
MONO
Converts a color image to grayscale.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
mono(some_image)
mono(img: some_image)
REMOTE_SCRIPTGEN
Experimental, advanced function which is described specifically in this section.
Argument |
Required? |
Description |
Default value |
|
URL of the service to invoke |
||
Examples
remote_scriptgen("http://localhost:8080/jsolex/remote")
remote_scriptgen(url: "http://localhost:8080/jsolex/remote")
RGB
Creates an RGB image from three mono images.
Argument |
Required? |
Description |
Default value |
|
Red image |
||
|
Green image |
||
|
Blue image |
||
Examples
rgb(img(-1);img(0);img(1))
rgb(r: redWing; g: avg(redWing;blueWing); b: blueWing)
SORT
Sorts a list of images
Argument |
Required? |
Description |
Default value |
|
Images |
||
|
Sort order. One of |
shift |
|
Examples
sort(images, 'date')
sort(images, 'date asc')
sort(images: images, order: 'date desc')
VIDEO_DATETIME
Returns the datetime when a video was recorded.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Date format. |
||
Examples
video_datetime(img(0))
video_datetime(img: img(0), format:"yyyy-MM-dd HH:mm:ss")
WAVELEN
Returns the wavelength of an image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
wavelen(img(0))
wavelen(img: img(0))
WORKDIR
Changes the working directory in which images are loaded by the LOAD and LOAD_MANY functions.
Argument |
Required? |
Description |
Default value |
|
Working directory |
||
Examples
workdir('/path/to/dir')
workdir(dir: '/path/to/dir')
Image Enhancement
ADJUST_CONTRAST
Applies simple contrast adjustment by clipping values under the minimal value or above the maximal value.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Minimum value |
||
|
Maximum value |
||
Examples
adjust_contrast(img: img(0), min: 10, max: 200)
adjust_contrast(img(0), 10, 200)
ADJUST_GAMMA
Applies a gamma correction to an image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Gamma |
||
Examples
adjust_gamma(img: img(0), gamma: 2.2)
adjust_gamma(img(0), 1.5)
ASINH_STRETCH
Applies the inverse arcsin hyperbolic transformation to increase contrast.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Black point |
||
|
Stretch factor |
||
Examples
asinh_stretch(img: img(0), bp: 500, stretch: 2.5)
asinh_stretch(img(0), 0, 10)
AUTO_CONTRAST
This function is a contrast enhancement function specifically designed for spectroheliograph images.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Gamma |
||
|
Background correction aggressiveness between 0 and 1. 1 = no correction, 0 = maximum correction. |
0.25 |
|
|
Prominences enhancement. 0 means no enhancement. |
0 |
|
Examples
auto_contrast(img: img(0), gamma: 1.5)
auto_contrast(img(0), 1.5)
BLUR
Applies a Gaussian blur to an image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Kernel size |
3 |
|
Examples
blur(img(0))
blur(img(0), 7)
blur(img: img(0), kernel:7)
CLAHE
Applies CLAHE (Contrast Limited Adaptive Histogram Equalization) transformation to an image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Tile size |
||
|
Bin count |
||
|
Clip limit |
||
Examples
clahe(img: img(0), ts: 16, bins: 128, clip: 1.1)
clahe(img(0), 16, 128, 1.1)
COLORIZE
Applies a colorization to an image using a color profile related to the wavelength.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Color profile (see spectral lines editor) |
||
Examples
colorize(img: img(0), profile: "H-alpha")
colorize(range(-1, 1), "Calcium (K)")
COLORIZE2
Applies a colorization to an image using curve modeling. The curves are defined by 2 control points: the input value and the output value.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Input value for red (0-255) |
||
|
Output value for red (0-255) |
||
|
Input value for green (0-255) |
||
|
Output value for green (0-255) |
||
|
Input value for blue (0-255) |
||
|
Output value for blue (0-255) |
||
Examples
colorize2(img: img(0), rIn: 50, rOut: 200, gIn: 50, gOut: 200, bIn: 50, bOut: 200)
colorize2(img(0), 50, 200, 50, 200, 50, 200)
CURVE_TRANSFORM
Applies a curve transformation to an image. The transformation interpolates a polynomial of degree 2 passing through three points: the origin point (0,0), the curve point (in, out), and the extreme point (255,255).
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Input value of the curve (0-255) |
||
|
Output value of the curve (0-255) |
||
|
Low protection value (0-255) |
||
|
High protection value (0-255) |
||
Examples
curve_transform(img(0), 100, 120)
curve_transform(img: img(0), in:50, out: 200)
DISK_FILL
Fills the detected solar disk with a given value (default is the value of the detected black point).
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Fill value |
detected black point value |
|
Examples
disk_fill(img(0))
disk_fill(img: img(0), fill: 200)
DISK_MASK
Creates a mask of the solar disk, where pixels inside the disk will have the value 1, against 0 for those outside the disk. It is possible to invert (0 inside, 1 outside) by passing 1 as the 2nd parameter of the function.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Inversion of the mask (1 means value 0 inside, 1 outside) |
0 |
|
Examples
disk_mask(img(0))
disk_mask(img: img(0), invert: 1)
EQUALIZE
Equalizes the histogram of the images in parameter so that they all have about the same brightness.
Argument |
Required? |
Description |
Default value |
|
List of images to equalize. |
||
Examples
equalize(range(-1;1))
equalize(list: some_images)
FIX_BANDING
Applies a banding correction to the image
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Band size |
||
|
Number of passes |
||
Examples
fix_banding(img(0), 64, 3)
fix_banding(img: img(0), bs: 48, passes: 10)
FIX_GEOMETRY
Applies geometric correction to the image based on the calculated ellipse
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
fix_geometry(img(0))
fix_geometry(img: img(0))
FLAT_CORRECTION
Computes an artificial flat field image to correct the image then applies the correction.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Low percentile value |
0.1 |
|
|
High percentile value |
0.95 |
|
|
Polynomial order |
2 |
|
[NOTE] .Experimental ==== The artificial flat correction allows to correct a possible vignetting. It computes a model from the disk pixels. The pixels considered are those whose value is between a low and a high percentile. For example, if you enter 0.1 and 0.9, the pixels whose value is between the 10th and 90th percentile will be used to compute the model. Finally, a polynomial of the specified order is adjusted on the model values to correct the image. ==== |
Examples
flat_correction(img(0))
flat_correction(img: img(0), order: 3)
INVERT
Inverts the colors of an image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
invert(img(0))
invert(img: img(0))
LINEAR_STRETCH
Stretches the histogram of an image to occupy the entire range of possible values. This function can also be used to compress the values of an image into the range of possible values (for example after an exponential calculation).
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Minimum value of the histogram to stretch. |
0 |
|
|
Maximum value of the histogram to stretch. |
65535 |
|
Examples
linear_stretch(img(0))
linear_stretch(img(0), 10000, 48000)
linear_stretch(img: img(0), hi: 48000)
RL_DECON
Applies the Richardson-Lucy deconvolution algorithm to the image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Gaussian radius |
2.5 |
|
|
Sigma |
2.5 |
|
|
Number of iterations |
5 |
|
Examples
rl_decon(img(0))
SATURATE
Saturates the colors of an image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Saturation |
||
Examples
saturate(img(0);1.5)
saturate(img: img(0); factor: 1.5)
SHARPEN
Applies a sharpening filter to an image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Kernel size |
3 |
|
Examples
sharpen(img(0))
sharpen(img(0), 7)
sharpen(img: img(0), kernel:7)
Cropping
AUTOCROP
Automatically crops an image around the solar disk. The dimensions of the cropping area are determined by the ellipse but also by the dimensions of the image. It is better to use the autocrop2
function which guarantees a centered and square crop.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
autocrop(img: img(0))
autocrop(img(0))
AUTOCROP2
Crops an image to a centered and square area around the solar disk.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
The width of the image will be the diameter of the solar disk multiplied by this factor. |
1.1 |
|
|
The width of the image will be rounded to this multiple. Must be a multiple of 2. |
16 |
|
Examples
autocrop2(img: img(0))
autocrop2(img(0))
CROP
Crops an image to the specified coordinates and dimensions.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
X coordinate of the top left corner of the cropping area. |
||
|
Y coordinate of the top left corner of the cropping area. |
||
|
Width of the cropping area. |
||
|
Height of the cropping area. |
||
Examples
crop(img(0), 10, 20, 100, 200)
crop(img: img(0), left: 10, top: 20, width: 100, height: 200)
CROP_AR
Generates a list of images corresponding to the detected sunspots.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Minimum size of the spot. |
32 |
|
|
Margin around the spot (in %). |
10 |
|
Examples
crop_ar(continuum))
crop_ar(img:img(0), margin: 15)
CROP_RECT
Reduces the image to the specified dimensions, ensuring that the center of the solar disk will be at the center of the image. There is no scaling: if the solar disk does not fit within the target dimensions, it will be cropped.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Width of the cropping area. |
||
|
Height of the cropping area. |
||
Examples
crop_rect(img(0), 1024, 1024)
crop_rect(img: img(0), width: 200, height: 200)
Background Extraction
BG_MODEL
Creates a BACKGROUND model from an image, which can be used to subtract the BACKGROUND from the original image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Polynomial order. A value higher than 3 is not recommended. |
2 |
|
|
Number of sigmas for sample selection. |
2.5 |
|
Examples
bg_model(img(0); 2.5; 3)
bg_model(img: img(0); sigma: 3)
NEUTRALIZE_BG
This is a function similar to remove_bg
that uses a polynomial modeling of the background to remove gradients. This function can be used on images without ellipse information (solar disk).
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Number of iterations of the algorithm. |
1 |
|
Examples
neutralize_bg(some_image)
neutralize_bg(img: img(0), iterations: 5)
REMOVE_BG
Performs background removal on an image. This can be used when the contrast is very low (e.g in helium processing) and that stretching the image also stretches the background. This process computes the average value of pixels outside the disk, then uses that to perform an adaptative suppression depending on the distance from the limb, in order to preserve light structures around the limb.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Tolerance |
0.9 |
|
Examples
remove_bg(some_image)
remove_bg(img: img(0), tolerance: .5)
Rotation and Rescaling
HFLIP
Flips an image horizontally.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
hflip(some_image)
hflip(img: img(0))
RADIUS_RESCALE
Relative scaling method which can facilitate mosaic composition. It will therefore most likely be used in batch mode. It allows rescaling a set of images so that they all have the same solar disk radius (in pixels). In order to do so, it will perform an ellipse regression against each image to compute their solar disk, then will rescale all images to match the radius of the largest one.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
radius_rescale(some_image)
radius_rescale(images: my_list)
RESCALE_ABS
Rescales an image to the specified absolute dimensions.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Width of the image |
||
|
Height of the image |
||
Examples
rescale_abs(img(0), 100, 100)
rescale_abs(img: img(0), width: 100, height: 100)
RESCALE_REL
Rescales an image by applying a rescaling factor.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Horizontal rescaling factor |
||
|
Vertical rescaling factor |
||
Examples
rescale_rel(img(0), .5, .5)
rescale_rel(img: img(0), sx: 0.5, sy: 0.5)
ROTATE_DEG
Applies a rotation to an image, in degrees.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Angle |
||
|
Fill value for pixels outside of the image. |
||
|
Resize the image to fit the rotation. |
||
Examples
rotate_deg(img(0); 30)
rotate_deg(img: img(0); angle: 30)
ROTATE_LEFT
Applies a left rotation to an image
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
rotate_left(img(0))
rotate_left(img: img(0))
ROTATE_RAD
Applies a rotation to an image, in radians.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Angle |
||
|
Fill value for pixels outside of the image. |
||
|
Resize the image to fit the rotation. |
||
Examples
rotate_rad(img(0); 2.1)
rotate_rad(img: img(0); angle: 2.1)
ROTATE_RIGHT
Applies a right rotation to an image
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
rotate_right(img(0))
rotate_right(img: img(0))
VFLIP
Flips an image vertically.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
Examples
vflip(some_image)
vflip(img: img(0))
Analysis
A2PX
Computes the number of pixels corresponding to a distance in Angstroms. The distance is determined by calculating the dispersion, which will only be correct if you have correctly specified the pixel size of the camera, as well as your spectroheliograph.
Argument |
Required? |
Description |
Default value |
|
Angstroms |
||
|
Reference wavelength in Angstroms |
||
Examples
a2px(1.2)
a2px(a: 1.2, ref: 6328)
CONTINUUM
Generates a continuum image around the studied line. This function differs from the classic continuum image in that it is not a single image calculated by the difference of fixed pixels of 15 pixels, but an image calculated from the median of a set of images.
Argument |
Required? |
Description |
Default value |
Examples
continuum()
FIND_SHIFT
Computes a pixel offset relative to the detected line. The distance is determined by calculating the dispersion, which will only be correct if you have correctly specified the pixel size of the camera, as well as your spectroheliograph.
Argument |
Required? |
Description |
Default value |
|
Wavelength to search for in Angstroms or line name |
||
|
Reference wavelength in Angstroms |
||
Examples
find_shift(5875.62)
find_shift(wl: 5875.62, ref: 5895.92)
PX2A
Computes the number of angstroms corresponding to a distance in pixels. The distance is determined by calculating the dispersion, which will only be correct if you have correctly specified the pixel size of the camera, as well as your spectroheliograph.
Argument |
Required? |
Description |
Default value |
|
pixels |
||
|
Reference wavelength in Angstroms |
||
Examples
px2a(24)
px2a(px: 24, ref: 6328)
Drawing
DRAW_ARROW
Draws an arrow on the image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Start of the arrow (X coordinate) |
||
|
Start of the arrow (Y coordinate) |
||
|
End of the arrow (X coordinate) |
||
|
End of the arrow (Y coordinate) |
||
|
Thickness of the arrow |
1 |
|
|
Color of the arrow |
||
Examples
draw_arrow(img(0), 100, 100, 200, 200, 2, "ff0000")
draw_arrow(img:img(0), x1:100, y1:100, x2:200, y2:200, color: "ff0000")
DRAW_CIRCLE
Draws a circle on the image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
X coordinate of the center of the circle |
||
|
Y coordinate of the center of the circle |
||
|
Thickness of the arrow |
1 |
|
|
Color of the arrow |
||
Examples
draw_circle(img(0), 100, 100, 2)
draw_circle(img:img(0), cx:100, cy:100, color: "ff0000")
DRAW_EARTH
Draws the Earth on the image, to the scale of the solar disk
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
X coordinate of the center of the Earth |
||
|
Y coordinate of the center of the Earth |
||
Examples
draw_earth(img(0), 100, 100)
draw_earth(img:img(0), x:100, y:100)
DRAW_GLOBE
Draws a globe whose orientation and diameter correspond to the detected solar parameters.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
P angle |
angle P |
|
|
b0 angle |
b0 |
|
|
Globe style. Possible values: equatorial_coords (N/S E/W corresponding to celestial N/S), solar_coords (N/S E/W corresponding to solar axes) |
equatorial_coords |
|
|
1 to correct the P angle (the axis passing through point P is vertical), 0 otherwise |
0 |
|
Examples
draw_globe(img(0))
draw_globe(img:img(0), angleP: 0)
DRAW_OBS_DETAILS
Displays observation details on the image
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
X coordinate |
50 |
|
|
Y coordinate |
50 |
|
Examples
draw_obs_details(img(0), 100, 100)
draw_obs_details(img:img(0), x:100, y:100)
DRAW_RECT
Draws a rectangle on the image.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
X coordinate of the top left corner of the rectangle |
||
|
Y coordinate of the top left corner of the rectangle |
||
|
Width of the rectangle |
||
|
Height of the rectangle |
||
|
Thickness of the line |
1 |
|
|
Color of the line |
||
Examples
draw_rect(img(0), 100, 100, 300, 200)
draw_rect(img:img(0), left:100, top:100, color: "ff0000")
DRAW_SOLAR_PARAMS
Displays solar parameters on the image
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
X coordinate |
top right |
|
|
Y coordinate |
top right |
|
Examples
draw_solar_params(img(0), 100, 100)
draw_solar_params(img:img(0), x:100, y:100)
DRAW_TEXT
Draws text on the image. The text can include the following variables:
-
%WAVELEN%
: wavelength of the image in Angström (includes the shift from the reference wavelength) -
%PIXELSHIFT%
: pixel shift applied -
%SHIFT%
: shift applied (in Angström) -
%RAY%
: name of the observed reference line -
%OBSERVER%
: name of the observer -
%INSTRUMENT%
: name of the instrument -
%TELESCOPE%
: name of the telescope
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
X coordinate |
||
|
Y coordinate |
||
|
Text to write |
||
|
Font size |
auto |
|
|
Color of the text |
||
Examples
draw_text(img(0), 100, 100, "Hello %OBSERVER%!")
draw_text(img:img(0), x:100, y:100, text:"Hello %OBSERVER%!", fs: 20)
Animations
ANIM
Creates an animation from a series of images.
Argument |
Required? |
Description |
Default value |
|
The list of images |
||
|
Delay between each frame (in ms) |
250 |
|
Examples
anim(range(0,10))
anim(images: range(0,10), delay: 100)
TRANSITION
Interpolates images between them. By default, the interpolation is linear and it will create exactly the specified number of images. However, if a unit is specified, then the behavior will be different: the number of steps corresponds to the number of images to create, for a given time unit, for the time elapsed between the two images. For example, if one image was taken at 10:00 and the other at 10:02, and the unit is ipm
, that the number of steps is 10, then 20 images will be created. This allows creating smoother transitions when SER files were not recorded at regular intervals.
Argument |
Required? |
Description |
Default value |
|
Image(s) |
||
|
Number of intermediate images to generate. |
||
|
Interpolation type: |
linear |
|
|
Interpolation unit: |
||
Examples
transition(list(img(0), img(1)), 10)
transition(images: my_imges, steps: 10, type: ease_in, unit: 'ipm')
Stacking and mosaic composition
DEDISTORT
Allows to correct the distortion of an image. It has 2 distinct modes of use. In the first mode, it takes a reference image and an image to correct, as well as 3 optional parameters: the tile size, the sampling, and the sky background value. The returned image will be corrected as closely as possible to the reference image, making it usable for stacking, for example. In the second mode, it takes a list of images to correct and a list of already corrected images, in which case the correction parameters for each image are taken using the same index image in the list of already corrected images. This can be useful, for example, when calculating the distortion at the center of the line (shift 0) and wanting to apply the same corrections to images with different shifts.
Argument |
Required? |
Description |
Default value |
|
Reference image(s) |
||
|
Images to correct. |
||
|
Tile size |
32 |
|
|
Sampling. A value of 0.5 for a tile size of 32 pixels means that there will be a sample every 16 pixels. |
0.5 |
|
|
Sky background value. |
||
Examples
crop_rect(img(0), 1024, 1024)
crop_rect(img: img(0), width: 200, height: 200)
MOSAIC
Creates a mosaic of images.
Argument |
Required? |
Description |
Default value |
|
Images to be assembled. |
||
|
Tile size |
64 |
|
|
Sampling factor |
0.25 |
|
Examples
mosaic(some_images)
mosaic(images: some_images, ts: 128)
STACK
Stacks multiple images.
Argument |
Required? |
Description |
Default value |
|
Images to be stacked. |
||
|
Tile size |
32 |
|
|
Sampling factor |
0.5 |
|
|
Method for selecting the best image. Can be |
sharpness |
|
Examples
stack(some_images)
stack(some_images, 64; .5; "eccentricity")
stack(images: some_images, ts: 128, sampling: 0.5, select: "sharpness")
STACK_REF
Selects a reference image for stacking.
Argument |
Required? |
Description |
Default value |
|
Images to be stacked. |
||
|
Method for selecting the best image. Can be |
sharpness |
|
Examples
stack_ref(some_images)
stack_ref(some_images, "eccentricity")
stack_Ref(images: some_images, select: "sharpness")