Tycho Lua Plugin Host API

This document lists all host-side API functions available to Lua plugins.

Table of Contents

core

get_version

Signature: int get_version()
Version: 1.0    Since: 13.0
Lua: host.get_version()

Returns the Tycho version identifier (13100 = v13.1)

Back to top

set_active_observatory_by_id

Signature: bool set_active_observatory_by_id()
Version: 1.0    Since: 13.0
Lua: host.set_active_observatory_by_id()

Sets the active observatory by identifier

Back to top

set_active_observatory_by_obs_code

Signature: bool set_active_observatory_by_obs_code()
Version: 1.0    Since: 13.0
Lua: host.set_active_observatory_by_obs_code()

Sets the active observatory by MPC code

Back to top

set_active_observatory_by_label

Signature: bool set_active_observatory_by_label()
Version: 1.0    Since: 13.0
Lua: host.set_active_observatory_by_label()

Sets the active observatory by label

Back to top

add

Signature: double add()
Version: 1.0    Since: 13.0
Lua: host.add()

Returns the sum of two numbers

Back to top

subtract

Signature: double subtract()
Version: 1.0    Since: 13.0
Lua: host.subtract()

Returns the difference of two numbers

Back to top

sleep

Signature: void sleep(double)
Version: 1.0    Since: 13.0
Lua: host.sleep()

Sleeps for specified number of milliseconds

Back to top

log

Signature: void log(msg)
Version: 1.0    Since: 13.0
Lua: host.log()

Prints a message to the log window

Back to top

msgbox

Signature: void msgbox(text, caption)
Version: 1.0    Since: 13.0
Lua: host.msgbox()

Displays a message box with the supplied text and caption

Back to top

get_path_script

Signature: string get_path_script()
Version: 1.0    Since: 13.0
Lua: host.get_path_script()

Returns the full path to the current script file

Back to top

get_dir_script

Signature: string get_dir_script()
Version: 1.0    Since: 13.0
Lua: host.get_dir_script()

Returns the full path to the directory containing the current script

Back to top

exit

Signature: void exit()
Version: 1.0    Since: 13.0
Lua: host.exit()

Quits the current Tycho instance

Back to top

get_parent_dir

Signature: string get_parent_dir(string input_dir)
Version: 1.0    Since: 13.0
Lua: host.get_parent_dir()

Returns the full path to the parent directory

Back to top

images

get_count

Signature: int get_count()
Version: 1.0    Since: 13.0
Lua: host.images.get_count()

Returns the number of loaded images

Back to top

run_script_on_dir

Signature: void run_script_on_dir(path_script, path_dir, bkgnd_mode)
Version: 1.0    Since: 13.0
Lua: host.images.run_script_on_dir()

Spawns a new Tycho instance to run a specified script on a specified directory of images.

Back to top

load

Signature: void load(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.load()

Loads the images into memory

Back to top

save

Signature: void save(function callback, bool remove_wcs)
Version: 1.0    Since: 13.0
Lua: host.images.save()

Saves the images to disk

Back to top

cleanup

Signature: void cleanup(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.cleanup()

Performs cleanup of image processing

Back to top

reset_file_list

Signature: void reset_file_list(function callback, bool clear_list)
Version: 1.0    Since: 13.0
Lua: host.images.reset_file_list()

Resets image list

Back to top

add_output

Signature: void add_output(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.add_output()

Adds output images

Back to top

calibrate

Signature: void calibrate(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.calibrate()

Performs calibration on the active image set

Available inputs:

Name Type Values
Path_Biasstring—
Path_Darkstring—
Path_Flatstring—
Mode_Bias integer SKIP=0, SUPPLY=1
Mode_Dark integer SKIP=0, APPLY=1, AUTO=2
Mode_Flat integer SKIP=0, APPLY=1, AUTO=2
Calibrate_Darkboolean—
Scale_Darkboolean—
Calibrate_Flatboolean—
Apply_Pseudo_Flatboolean—
Apply_Normalizationboolean—
Apply_Fix_Pixelsboolean—
Apply_Fix_Linesboolean—
Invert_Pixelsboolean—
Apply_Scale_ADUboolean—
Scale_Factor_ADUnumber—
Apply_Pedestal_ADUboolean—
Pedestal_Amount_ADUnumber—
Override_Output_Dirboolean—
Path_Output_Dirstring—
Back to top

debayer

Signature: void debayer(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.debayer()

Performs debayer on the active image set

Name Type Values
Pattern integer AUTO=0, RGGB=1, BGGR=2, GBRG=3, GRBG=4, GRGB=5, GBGR=6, RGBG=7, BGRG=8
Output integer COMBINED_LUMINANCE=0, SPLIT_RGB=1, ONLY_G=2
Mode integer SUPERPIXEL=0, BILINEAR=1, VNG=2
Override_Output_Dir boolean —
Path_Output_Dir string —
Back to top

resize

Signature: void resize(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.resize()

Performs resizing on the active image set

Available inputs:

Name Type Values
Desired_Widthinteger—
Desired_Heightinteger—
Crop_Topinteger—
Crop_Rightinteger—
Crop_Bottominteger—
Crop_Leftinteger—
Bin_Amountinteger—
Horz_Divisionsinteger—
Vert_Divisionsinteger—
Unit_Percentboolean—
Override_Output_Dirboolean—
Path_Output_Dirstring—
Back to top

plate_solve

Signature: void plate_solve(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.plate_solve()

Plate solves the active image set

Available inputs:

Name Type Values
Scale_Lowernumber—
Scale_Uppernumber—
Mode_Extraction integer AUTO=0, STANDARD=1, EXTENDED=2
Downsample integer AUTO=0, F1=1, F2=2, F3=3, F4=4, F5=5, F6=6, F7=7, F8=8, F9=9, F10=10
Reference_Image integer AUTO=0, FIRST=1, MIDDLE=2, LAST=3
Only_Referenceboolean—
Narrow_Searchboolean—
Search_Radiusnumber—
Back to top

align

Signature: void align(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.align()

Aligns the active image set

Available inputs:

Name Type Values
Interpolation integer BILINEAR=100, BICUBIC=101, LANCZOS3=102, LANCZOS4=103, LANCZOS5=104
Mode integer STARMATCH=100, WCS=101
Downsample integer —
Dist_Corr boolean —
Override_Output_Dir boolean —
Path_Output_Dir string —
Back to top

drizzle

Signature: void drizzle(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.drizzle()

Performs drizzle on the active image set

Available inputs:

Name Type Values
Ref_Img integer AUTO=0, FIRST=1, MIDDLE=2, LAST=3
Method integer AVERAGE=0, MEDIAN=1
Output integer BY_FILTER=0, COMBINE_ALL=1
Scale integer —
Override_Output_Dir boolean —
Path_Output_Dir string —
Back to top

evaluate

Signature: void evaluate(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.evaluate()

Evaluates the active image set

Available inputs:

Name Type Values
T1_PSnumber—
T2_PSnumber—
T1_SMnumber—
T2_SMnumber—
T1_ISnumber—
T2_ISnumber—
Update_FITS_Headerboolean—
Allow_Abortboolean—
Abort_PSboolean—
Abort_SMboolean—
Abort_ISboolean—
Target_SNRnumber—
Override_Output_Dirboolean—
Path_Output_Dirstring—
Back to top

inject_targets

Signature: void inject_targets(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.inject_targets()

Injects targets into the active image set

Available inputs:

Name Type Values
Motion_Type integer SPEED=0, PIXEL=1
Speednumber—
PAnumber—
Pixels_Xinteger—
Pixels_Yinteger—
Target_SNRnumber—
Target_FWHMnumber—
Unit_Pixels_FWHMboolean—
Num_Tgts_Xinteger—
Num_Tgts_Yinteger—
Spacing_Xinteger—
Spacing_Yinteger—
Pct_Offset_Xnumber—
Pct_Offset_Ynumber—
Simulate_Streakboolean—
Override_Output_Dirboolean—
Path_Output_Dirstring—
Back to top

shuffle

Signature: void shuffle(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.shuffle()

Shuffles the active image set

Available inputs:

Name Type Values
Override_Output_Dirboolean—
Path_Output_Dirstring—
Back to top

merge

Signature: void merge(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.merge()

Merges the active image set

Available inputs:

Name Type Values
MaxDeltaTimeInSecnumber—
Override_Output_Dirboolean—
Path_Output_Dirstring—
Back to top

get_dir_images

Signature: string get_dir_images()
Version: 1.0    Since: 13.0
Lua: host.images.get_dir_images()

Returns the full path to the directory containing the active image set

Back to top

get_path_image

Signature: string get_path_image(int idx_img)
Version: 1.0    Since: 13.0
Lua: host.images.get_path_image()

Returns the full path to the image associated with the given zero-based index

Back to top

attach_ephemeris

Signature: void attach_ephemeris(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.attach_ephemeris()

Attaches ephemeris to the active image set based on the supplied observations file

Available inputs:

Name Type Values
Path_Observations_Filestring—
Back to top

larson_sekanina

Signature: void larson_sekanina(function callback)
Version: 1.0    Since: 13.0
Lua: host.images.larson_sekanina()

Applies Larson-Sekanina filter to the active image set

Available inputs:

Name Type Values
PluginNamestring—
PluginIDinteger—
val_ls_modestring—
val_radial_shiftnumber—
val_rotational_shiftnumber—
val_auto_centerboolean—
val_pos_center_xinteger—
val_pos_center_yinteger—
Back to top

get_crosshair_x

Signature: int get_crosshair_x()
Version: 1.0    Since: 13.0
Lua: host.images.get_crosshair_x()

Return X coordinate of current crosshair location

Back to top

get_crosshair_y

Signature: int get_crosshair_y()
Version: 1.0    Since: 13.0
Lua: host.images.get_crosshair_y()

Return Y coordinate of current crosshair location

Back to top

reset_view

Signature: void reset_view()
Version: 1.0    Since: 13.0
Lua: host.images.reset_view()

Resets the current view in the Image Viewer

Back to top

open_img_viewer

Signature: void open_img_viewer()
Version: 1.2    Since: 13.5.1
Lua: host.images.open_img_viewer()

Opens the Image Viewer

Back to top

load_known_objects

Signature: void load_known_objects()
Version: 1.2    Since: 13.5.1
Lua: host.images.load_known_objects()

Loads known objects in the current reference image (must already be plate solved)

Available inputs:

Name Type Values
Path_Output_CSV string Path to output CSV file (e.g., "C:/Users/Daniel/Desktop/output.txt")
Back to top

tracker

synthetic

Signature: void synthetic(function callback)
Version: 1.0    Since: 13.0
Lua: host.tracker.synthetic()

Operates the synthetic tracker on the active image set

Available inputs:

Name Type Values
Sensitivity_Levelinteger—
MinImageShiftInPixelsnumber—
AutoTimeoutInMinutesnumber—
MinMovementInPixelsnumber—
MaxObjStreaknumber—
Force_Granularityboolean—
Granularity_Pctinteger—
Enable_ClusterOperationboolean—
Enable_Multithreadingboolean—
NumThreadsinteger—
Limit_Speedboolean—
Speed_Startnumber—
Speed_Stopnumber—
Limit_PAboolean—
PA_Startnumber—
PA_Stopnumber—
Crop_Schboolean—
Crop_Amountinteger—
Back to top

fast

Signature: void fast(function callback)
Version: 1.0    Since: 13.0
Lua: host.tracker.fast()

Operates the FAST tracker on the active image set

Available inputs:

Name Type Values
Sensitivity_Mode integer REGULAR=0, MAXIMUM=1
Limit_Speedboolean—
Speed_Startnumber—
Speed_Stopnumber—
Limit_PAboolean—
PA_Startnumber—
PA_Stopnumber—
Back to top

get_num_tracks_synthetic

Signature: int get_num_tracks_synthetic(function callback)
Version: 1.0    Since: 13.0
Lua: host.tracker.get_num_tracks_synthetic()

Returns the number of tracks identified from the synthetic tracker

Back to top

get_num_tracks_fast

Signature: int get_num_tracks_fast(function callback)
Version: 1.0    Since: 13.0
Lua: host.tracker.get_num_tracks_fast()

Returns the number of tracks identified from the FAST tracker

Back to top

perform_step_verify

Signature: void perform_step_verify(function callback)
Version: 1.0    Since: 13.0
Lua: host.tracker.perform_step_verify()

Performs the verification step

Back to top

perform_step_confidence

Signature: void perform_step_confidence(function callback)
Version: 1.0    Since: 13.0
Lua: host.tracker.perform_step_confidence()

Performs the confidence computation step

Available inputs:

Name Type Values
Min_Track_Confidence integer UNKNOWN=0, NONE=1, LOW=2, MED=3, HIGH=4
Num_Tracks_To_Verify integer —
Back to top

perform_step_known_objects

Signature: void perform_step_known_objects(function callback)
Version: 1.1    Since: 13.0
Lua: host.tracker.perform_step_known_objects()

Loads known objects for the returned track list. Matching parameters (distance, speed, and PA) require Tycho version 13.4 or higher.

Available inputs:

Name Type Values
Match_Type_FAST integer ART_SATS=0, ASTEROIDS=1
Match_Asteroid_Distance double Default=1.50 arcmin
Match_Asteroid_Speed double Default=1.00"/min
Match_Asteroid_PA double Default=30.0 degrees
Back to top

perform_step_create_obs

Signature: void perform_step_create_obs(function callback)
Version: 1.0    Since: 13.0
Lua: host.tracker.perform_step_create_obs()

Creates observations for each candidate track

Available inputs:

Name Type Values
Create_Snapshotsboolean—
Contrast_Level integer 0 = default, <0 less contrast, >0 more contrast
Intensity_Level integer 0 = default, <0 less intensity, >0 more intensity
Back to top

perform_step_save_tracks

Signature: void perform_step_save_tracks(function callback)
Version: 1.0    Since: 13.0
Lua: host.tracker.perform_step_save_tracks()

Saves the track list

Back to top

perform_step_save_zero_motion

Signature: void perform_step_save_zero_motion(function callback)
Version: 1.0    Since: 13.0
Lua: host.tracker.perform_step_save_zero_motion()

Saves the zero motion stacked image

Back to top

perform_step_finish

Signature: void perform_step_finish(function callback)
Version: 1.0    Since: 13.0
Lua: host.tracker.perform_step_finish()

Generates completion files for the output directory

Back to top

kvp

load

Signature: PluginKVP load(string plugin_label_id)
Version: 1.0    Since: 13.0
Lua: host.kvp.load()

Returns a KVP handle for the specified plugin label ID

Back to top