Skip to content

Loop Condition

The AstroManager Loop Condition controls when your imaging sequence should continue or stop based on AstroManager's scheduler state.

What It Does

The Loop Condition evaluates whether there are still targets to image:

  • Continue if observable targets remain with incomplete goals
  • Stop when all targets are complete or unobservable

Adding to Sequence

Placement

Use the Loop Condition as the condition for a loop containing the Target Scheduler:

📁 Loop While (AstroManager Loop Condition)  ← Condition here
└── 🎯 AstroManager Target Scheduler

Full Sequence Example

📁 Sequential Instruction Set
├── 🌙 Wait Until (Nautical Twilight)
├── 🔓 Unpark Mount
├── ❄️ Cool Camera
├── 📁 Loop While ◀━━ AstroManager Loop Condition
│   ├── 🎯 AstroManager Target Scheduler
│   └── ⏰ Wait (optional settling)
├── 🌡️ Warm Camera
└── 🔒 Park Mount

Condition Settings

Basic Settings

Setting Description
Name Display name
Enabled Whether condition is active

Evaluation Mode

Mode Description
Any Target Continue if any target is available
Priority Target Continue only for high-priority targets
Current Target Continue until current target complete

Time Limits

Setting Description
End Time Stop after this time regardless
Max Duration Maximum loop duration
Min Remaining Stop if less than X minutes of targets

Evaluation Logic

What Makes the Condition True

The loop continues (true) when:

  1. At least one scheduled target is observable
  2. Observable targets have incomplete imaging goals
  3. No stop conditions are met

What Makes the Condition False

The loop stops (false) when:

  1. No targets are above minimum altitude
  2. All observable targets have complete goals
  3. Time limit is reached
  4. User-defined stop condition is met

Evaluation Flow

┌─────────────────────────────┐
│ Check: Any targets in       │
│        AstroManager?        │
│         ↓                   │
│    ┌────┴────┐              │
│   Yes        No → STOP      │
│    │                        │
│ Check: Any targets          │
│        observable?          │
│         ↓                   │
│    ┌────┴────┐              │
│   Yes        No → STOP      │
│    │                        │
│ Check: Any incomplete       │
│        goals?               │
│         ↓                   │
│    ┌────┴────┐              │
│   Yes        No → STOP      │
│    │                        │
│ Check: Time limits?         │
│         ↓                   │
│    ┌────┴────┐              │
│   OK      Exceeded → STOP   │
│    │                        │
│ CONTINUE                    │
└─────────────────────────────┘

Common Scenarios

Normal Night

20:00  Loop starts
20:00  Target A selected, imaging begins
22:00  Target A goal complete, switch to B
00:30  Target B setting, switch to C
03:30  Target C complete
03:30  No more targets → Loop stops
03:31  Camera warm, park mount

All Targets Complete Early

20:00  Loop starts
20:00  Only 2 targets scheduled
23:00  Both targets complete
23:00  No incomplete goals → Loop stops
23:01  Session ends early

Weather Interruption

20:00  Loop starts, imaging Target A
22:00  Cloud sensor triggers unsafe
22:00  Imaging pauses
23:00  Conditions clear
23:00  Loop resumes (condition still true)
23:01  Continue imaging Target A

Integration with Other Conditions

Combining Conditions

You can use multiple conditions:

📁 Loop While (All conditions must be true)
├── AstroManager Loop Condition
├── Time Condition (before 04:00)
└── Safety Monitor Condition

Common Combinations

Condition Purpose
Time Condition Hard stop at specific time
Safety Monitor Stop if unsafe
Altitude Condition Additional altitude check
Loop Count Limit iterations

Error Handling

Connection Lost

If connection to AstroManager is lost:

  1. Condition evaluates to false (safe default)
  2. Loop exits gracefully
  3. Sequence continues to end instructions
  4. Park mount, warm camera, etc.

No Response

If AstroManager doesn't respond:

  1. Timeout after configured interval
  2. Retry once
  3. If still no response, evaluate as false
  4. Sequence ends safely

Tips

Always Use a Time Limit

Add a time condition as backup to ensure session ends before dawn.

Test the Exit

Verify your post-loop instructions (park, warm) execute correctly.

Combine with Safety

Include safety monitor condition for remote operation.

Review Logs

Check why the loop ended to improve future sessions.