Automating AsiAir Flats With AstroMate
By AstroMate Team
You've shot your flat frames with AsiAir (if not, read our guide to flat frames for astrophotography first). Now comes the tedious part: getting them off the AsiAir and matched with your light frames for stacking. For many astrophotographers, this manual file management is the biggest bottleneck in their workflow — and the part that benefits most from astrophotography automation.
AsiAir doesn't have a built-in mechanism to push files to your computer — you need to pull them. This post covers every approach, from manual file transfer to fully automated astrophotography stacking workflows.
Method 1: USB-C Direct Connection
The most reliable but least convenient method.
- Connect a USB-C cable from the AsiAir's USB-C port to your laptop.
- The AsiAir appears as a USB mass storage device (like a USB drive).
- On macOS: it mounts automatically in Finder under
/Volumes/. Navigate to theAutorun/Flat/directory. - On Windows: it appears as a new drive letter in File Explorer.
- Copy the flat files to your local machine.
- Disconnect the cable when done.
Downsides:
- Requires physical access to the AsiAir (inconvenient if it's mounted on the telescope in an observatory).
- Must power off the AsiAir, interrupting any ongoing sessions.
- Manual file sorting — you need to know which flats match which lights.
Method 2: Downloading From the AsiAir Network Share
AsiAir exposes its storage as an SMB (Samba) network share. You can access it from any computer on the same network while the AsiAir is powered on.
On macOS
- Ensure your Mac is on the same Wi-Fi network as the AsiAir (either the AsiAir's own hotspot or your home network if the AsiAir is configured for station mode).
- Open Finder.
- Press Cmd+K (or go to Go > Connect to Server).
- Enter:
smb://asiair.local/ASIAIR(orsmb://asiair/ASIAIR). - Click Connect. When prompted for credentials, select Guest — no password needed.
- Navigate to
Autorun/Flat/. - Copy the files to your local machine.
On Windows
- Open File Explorer.
- In the address bar, type:
\\asiair\ASIAIRand press Enter. - If prompted for credentials, leave the username and password empty (guest access).
- Navigate to
Autorun\Flat\. - Copy the files.
On Linux
- Using the file manager: open
smb://asiair/ASIAIR. - Or from the terminal:
# Create a mount point sudo mkdir -p /mnt/asiair # Mount the share sudo mount -t cifs //asiair/ASIAIR /mnt/asiair -o guest,vers=2.0 # Copy flats cp /mnt/asiair/Autorun/Flat/*.fits ~/astrophotos/flats/ # Unmount when done sudo umount /mnt/asiair
Downsides of Manual Network Transfer
- Transfer speeds over Wi-Fi are slow — a full set of 50 flat frames at ~30MB each takes several minutes.
- You need to manually identify which flats go with which light sessions.
- The SMB share is only accessible while the AsiAir is powered on and connected to the network.
- On macOS, mounting the AsiAir share in Finder while other software is accessing it via SMB can cause connection conflicts.
Automating AsiAir Downloads With Scripts
If you're comfortable with the command line, you can script the file transfer to save time on repeated sessions.
rsync on Linux/macOS
#!/bin/bash
# sync-flats.sh — Copy flat frames from AsiAir to local machine
ASIAIR_HOST="asiair.local"
SHARE_NAME="ASIAIR"
MOUNT_POINT="/tmp/asiair_mount"
DEST_DIR="$HOME/astrophotos/flats/$(date +%Y-%m-%d)"
# Mount the SMB share
mkdir -p "$MOUNT_POINT"
sudo mount -t cifs "//$ASIAIR_HOST/$SHARE_NAME" "$MOUNT_POINT" -o guest,vers=2.0,ro
# Copy flat files (rsync skips files already transferred)
mkdir -p "$DEST_DIR"
rsync -av --include='*.fits' --include='*.fit' --exclude='*' \
"$MOUNT_POINT/Autorun/Flat/" "$DEST_DIR/"
echo "Copied $(ls -1 "$DEST_DIR"/*.fits 2>/dev/null | wc -l) flat frames to $DEST_DIR"
# Unmount
sudo umount "$MOUNT_POINT"
You could run this as a cron job or trigger it after each session. rsync is smart about skipping files that have already been transferred, so re-running the script is fast.
To make this run automatically every night after your session:
# Add to crontab (runs at 6 AM daily)
crontab -e
# Add this line:
0 6 * * * /path/to/sync-flats.sh >> /var/log/sync-flats.log 2>&1
PowerShell on Windows
# sync-flats.ps1
$date = Get-Date -Format "yyyy-MM-dd"
$dest = "$HOME\astrophotos\flats\$date"
# Map network drive (guest access)
net use Z: \\asiair\ASIAIR /user:guest ""
# Copy flats
New-Item -ItemType Directory -Force -Path $dest
Copy-Item "Z:\Autorun\Flat\*.fits" -Destination $dest
# Disconnect
net use Z: /delete
Write-Host "Flat frames copied to $dest"
You can schedule this with Windows Task Scheduler to run automatically.
Limitations of Script-Based Automation
While scripts improve on manual copying, they still have significant gaps:
- No automatic matching: You still need to manually pair flats with lights based on filter and session.
- No session awareness: The scripts don't know which imaging session the flats belong to.
- No status tracking: You don't know which files have already been downloaded, which are new, and which failed.
- No integration with stacking: After downloading, you still need to organize the files and point your stacking software at the right directories.
- No real-time monitoring: Scripts run on a schedule. If you want files as soon as they're captured, you need something smarter.
Automating Astrophotography Calibration With AstroMate
AstroMate was built to solve exactly these problems. It eliminates the manual overhead of downloading, organizing, and matching calibration frames — and integrates directly into your astrophotography stacking workflow, turning what used to be hours of file management into a one-click process.
Automatic Discovery and Download
AstroMate continuously monitors the AsiAir's SMB share over the network using a direct TCP/SMB2 connection (no OS-level mount needed). When you capture flat frames, AstroMate:
- Discovers them automatically — the SMB watcher detects new files on the AsiAir within seconds of capture.
- Parses the filenames — extracts the frame type (Flat), filter, exposure time, and capture timestamp.
- Organizes into sessions and buckets — groups flat frames by filter and exposure time, just like it does for lights.
- Downloads them in the background — files are transferred with progress tracking and automatic retry logic for dropped connections.
- Stores them locally — in a clean directory structure:
{Telescope}/{Object}/{Date}/Flat/{Filter}/.
There's nothing to configure — as long as AstroMate is running on the same network as your AsiAir, it handles everything. This is AsiAir automation that works out of the box.
Intelligent Calibration Matching
When you create a stack in AstroMate, the calibration pairing is built in:
- AstroMate shows you all available flat buckets and recommends the best match based on filter and capture timing. Flats taken closest in time to your lights are ranked highest, so you don't have to dig through dates and filenames.
- You can pair each light entry with its matching flat in a single click.
- If you forget to assign flats, AstroMate warns you with a "Missing flats" indicator on the stack card.
This intelligent matching is where astrophotography automation saves the most time — the tedious work of identifying which calibration frames belong to which session is handled for you.
Automated Astrophotography Stacking Pipeline
AstroMate takes this a step further with its integrated stacking pipeline. When you click "Run Stack":
- If any assigned calibration frames (flats, darks, or biases) haven't been downloaded yet, AstroMate automatically queues them for download.
- The UI shows a "Downloading calibration frames: flats (50), biases (150)..." status in real time.
- Once all frames are downloaded, stacking begins automatically — no second click needed.
- If the telescope is offline, you get a clear message telling you to connect it.
This means you can assign your calibration frames to a stack immediately after an imaging session, and AstroMate will handle the download and stacking whenever the telescope is available.
The Generated Stacking Script
Behind the scenes, AstroMate generates a complete Siril processing script that includes proper flat calibration:
# Master bias (if assigned)
cd .../bias
convert bias -out=./
stack bias_ rej 3 3 -nonorm -out=.../masters/master_bias
# Master flat (per filter, bias-calibrated)
cd .../entry_0/flat
convert flat -out=./
calibrate flat_ -bias=.../masters/master_bias.fit
stack pp_flat_ rej 3 3 -norm=mul -out=.../entry_0/masters/master_flat
# Calibrate lights with bias + flat
cd .../entry_0/light
convert light -out=./
calibrate light_ -bias=.../masters/master_bias.fit -flat=.../entry_0/masters/master_flat.fit
register pp_light_
stack r_pp_light_ rej 3.0 3.0 -norm=addscale -output_norm -out=.../entry_0/Ha_300s
The flat master is created from your flat frames (bias-calibrated if bias frames are available), and then applied to every light frame before registration and stacking. The result: clean, evenly-illuminated images with no vignetting or dust artifacts — the same quality you'd get from a manual Siril or PixInsight workflow, fully automated.
Summary
Getting flat frames from your AsiAir to your processing pipeline shouldn't be the hardest part of astrophotography. Whether you prefer the hands-on USB-C approach, network file browsing, scripted rsync automation, or a fully automated astrophotography stacking tool like AstroMate, the important thing is that your flats make it into your stacking workflow consistently.
If you're tired of the manual file shuffling and want to automate your entire AsiAir calibration and stacking workflow, give AstroMate a try — it handles discovery, download, matching, and stacking so you can spend your time imaging, not managing files.