Batch Stacking Module

seestarpy.stack.clear_batch_stack()

Clear the batch stack state after stacking completes or is stopped.

The official app sends this as clear_app_state with {"name": "BatchStack"} after a batch stack finishes.

Note

Firmware v7.75 exposes clear_batch_stack as a direct JSON-RPC method (confirmed live on a Seestar S30 Pro on 2026-06-15; returns code=0). This function calls it directly and falls back to the older clear_app_state approach if the firmware does not recognise the method (code=103), so it works on both old and new firmware.

Return type:

dict

Examples

>>> from seestarpy import stack
>>> stack.clear_batch_stack()
seestarpy.stack.get_batch_stack_setting()

Get the current batch stack configuration.

Returns the path and list of files currently configured for batch stacking. The firmware enriches each file entry with date, thn (thumbnail path), and type fields.

Note

Confirmed via traffic capture from the official Seestar app v3.0.2 on 2026-02-24.

Return type:

dict

Examples

>>> from seestarpy import stack
>>> stack.get_batch_stack_setting()
seestarpy.stack.get_batch_stack_status()

Return the current batch stack progress, or None if no batch stack is active.

Queries iscope_get_app_state and extracts the BatchStack key.

Note

Confirmed via traffic capture from the official Seestar app v3.0.2 on 2026-02-24.

Returns:

The BatchStack state dict when a batch stack has been run, or None if not present. Key fields:

  • state (str): "working", "complete", "fail", or "cancel".

  • percent (float): Progress from 0 to 100.

  • stacked_img (int): Number of frames stacked so far.

  • total_img (int): Total frames to stack.

  • remaining_sec (int): Estimated seconds remaining.

  • output_file (dict): Present on completion, contains path and files with the output FITS and thumbnail.

Return type:

dict or None

Examples

>>> from seestarpy import stack
>>> status = stack.get_batch_stack_status()
>>> if status and status["state"] == "complete":
...     out = status["output_file"]["files"][0]["name"]
...     print(f"Stacked: {out}")
seestarpy.stack.set_batch_stack_setting(path, files)

Configure which sub-frames to include in the next batch stack.

This must be called before start_batch_stack(). The files are FITS sub-frames stored on the Seestar’s SD card.

Note

The required file-name format is firmware dependent:

  • Firmware ≥ 7.75 (firmware_ver_int ≥ 2775) requires each file entry to carry a full relative path from the SD-card root (e.g. "MyWorks/M 101_sub/Light_M 101_10.0s_LP_....fit").

  • Older firmware (e.g. 6.58, 7.32) requires bare filenames and rejects full paths with state="fail", error="no image", code=267.

This function detects the target’s firmware (via get_device_state(), cached per IP) and formats each entry accordingly, so the same call works across firmware versions. If the firmware can’t be read it defaults to the full-path form. The method name and params shape are unchanged from v3.0.2 — only the file-name resolution changed.

Confirmed via traffic capture from the official Seestar app v3.0.2 on 2026-02-24; full-path requirement confirmed live on firmware v7.75 (Seestar S30 Pro) on 2026-06-15; bare-name requirement confirmed live on firmware 6.58 / 7.32 (Seestar S50) on 2026-06-25.

Parameters:
  • path (str) – Folder on the Seestar containing the sub-frames, e.g. "MyWorks/M 101_sub". Use forward slashes.

  • files (list[str]) – List of FITS sub-frames to stack. Pass bare filenames (Light_<target>_<exposure>_<filter>_<YYYYMMDD>-<HHMMSS>.fit) and they are prefixed with path automatically, or pass full relative paths and they are sent unchanged.

Return type:

dict

Examples

>>> from seestarpy import stack
>>> stack.set_batch_stack_setting(
...     path="MyWorks/M 101_sub",
...     files=[
...         "Light_M 101_10.0s_LP_20260120-061408.fit",
...         "Light_M 101_10.0s_LP_20260120-061345.fit",
...         "Light_M 101_10.0s_LP_20260120-061326.fit",
...     ],
... )
seestarpy.stack.start_batch_stack()

Start batch stacking the files configured via set_batch_stack_setting().

Call set_batch_stack_setting() first to select the sub-frames. Monitor progress with get_batch_stack_status(). When stacking completes, call clear_batch_stack() to reset the state.

Note

Confirmed via traffic capture from the official Seestar app v3.0.2 on 2026-02-24.

Return type:

dict

Examples

>>> from seestarpy import stack
>>> stack.set_batch_stack_setting("MyWorks/M 101_sub", [
...     "Light_M 101_10.0s_LP_20260120-061408.fit",
...     "Light_M 101_10.0s_LP_20260120-061345.fit",
... ])
>>> stack.start_batch_stack()
seestarpy.stack.stop_batch_stack()

Stop a batch stack that is currently in progress.

Return type:

dict

Examples

>>> from seestarpy import stack
>>> stack.stop_batch_stack()