Family edition
Telescope Lab: The Sky Moves, Tracking, Loops and Events
In Telescope Lab your child keeps Saturn in a simulated telescope while the sky turns, and tries three ways to do it in Blocks.
What you need
- A computer or Chromebook with a current browser.
- The link: mytekdev.com/try/telescopelab?lesson=the-sky-moves-tracking-loops-and-events&ref=fam-telescopelab-2. No account, no email and nothing to install.
Before you start: try it once yourself
Open mytekdev.com/try/telescopelab?lesson=the-sky-moves-tracking-loops-and-events&ref=fam-telescopelab-2. A short guide opens over Level 3, The sky moves. The night is 16 February 2027 in a sample backyard on the edge of Denver, not where anyone in your family is. The backyard is in the middle: the deck, the trees, the telescope and Saturn above them. The eyepiece view is on the right: the big circle is what your eye would see, the small one the whole view to scale, with the magnification, the sky across and the air's blur under them. The box at the top left says the level's goal and, after each run, what happened, with the run's own numbers.
- The goal. Keep Saturn in the 10 mm (120 times) view for 3 minutes. The count in the box goes up while Saturn is anywhere in the view and starts again from 0 if it leaves.
- The starter. When started: point at Saturn, use the 10 mm eyepiece, wait 180 seconds. Saturn leaves the view 53 seconds after it is centered, the same on every run.
- Tracking. Turn tracking on, from Telescope, before the wait (above or below point at Saturn both work): done at 185 seconds, held by tracking.
- The when block. When the target drifts out of the view, from Events, sits on its own beside the starter, with point at Saturn under it. It runs each time Saturn leaves, and Saturn comes back, but the count has already started again: never done. In 5 minutes it is lost 5 times.
- The forever loop. Replace wait 180 with forever, holding point at Saturn and wait 20: done at 185 seconds, held by pointing again 9 times. The forever block adds 1 second of its own each time round. Waits of 10 to 50 pass; 55 and 60 let Saturn drift out first.
- Speed. The round play button runs the program from the start of the night; Speed up and Slower, at the bottom, change how fast the night goes (up to 10 times in the backyard). A program's seconds are the night's seconds at any speed. These times do not change from run to run.
The ideas, in plain words
Earth turns once in 23 hours 56 minutes, so the sky seems to turn 15 degrees an hour, 15 arcseconds every second. A telescope that stands still watches the sky go past, and the more it magnifies, the smaller its view and the sooner a planet leaves it: from the middle of the 10 mm view, 53 seconds; at 25 mm, over 2 minutes. Real telescopes have a tracking motor that turns them with the sky. Many backyard telescopes are pushed by hand, and their owners nudge them along every half minute or so, which is the forever loop.
The three fixes are three ways a program can keep up with something that changes. The when block is an event: it reacts after the change has happened. The loop is polling on a timer: it acts every so often whether or not anything changed, and its timer must be shorter than the time the problem takes to happen. Tracking removes the problem. A goal that says "never leave the view" needs prevention, not reaction, which is why the when block alone cannot pass.
Astronomers, telescope operators (the job this app is closest to), engineers who build cameras and adaptive optics, and data scientists who sort survey pictures all work with telescopes like these. Anyone can help with real data through citizen science projects such as Zooniverse and the AAVSO.
Do it together
- Open mytekdev.com/try/telescopelab?lesson=the-sky-moves-tracking-loops-and-events&ref=fam-telescopelab-2 together, press play and then Speed up. Watch the eyepiece view.
You'll know it worked when: Saturn drifts out of the view, and the box says it left after 53 seconds.
- Open Blocks. From Telescope, drag turn tracking on just under when started. Go back to Simulator and press play.
You'll know it worked when: The count reaches 180 seconds: held by tracking.
- Drag turn tracking on to the bin. From Events, add when the target drifts out of the view with point at Saturn under it, and play.
You'll know it worked when: Saturn comes back each time it leaves, but the count starts again from 0, so the level is not done.
- Take the when block out. Replace wait 180 with a forever loop holding point at Saturn and wait 20, and play.
If you get stuck: The forever block is in Events; drag the blocks inside its mouth.
You'll know it worked when: Done: held by pointing again 9 times.
- Try the loop with waits of 50, 55 and 60.
You'll know it worked when: 50 still holds it; 55 and 60 let Saturn drift out before the loop comes round.
Talk about it
Ask these while you work together. A child who has understood it can answer them without help:
- Why does Saturn leave a telescope that stands still?
- When does the when block run, and what does it do?
- Why does the count start again when the when block brings Saturn back?
- Which loop waits kept Saturn, and which did not?
- Which fix would you use on a real telescope, and why?
For younger and older kids
Younger: For a younger child, stop after the tracking fix, and talk about why the planet moved.
Older: For an older child, open Python and find what each block became, then try scope.track(True) there.
Keep going
- Open the Python tab after building the when block. Find the function the block became and the line that hands it to scope.on().
- Put the 3 mm eyepiece in and time how long Saturn takes to drift out. Why is it so much shorter?
- Use the loop and the when block together. Does that pass? Explain with the count in the box.
Bring it into other subjects
- Earth science: photograph the night sky for 20 minutes with a phone on a tripod, or look up star trail photos. Why do the stars draw circles round one point?
- Math: the sky turns 360 degrees in about 24 hours. Show that this is 15 degrees an hour and 15 arcseconds a second.
- Computer science: list three things at home that react to an event (a doorbell) and three that run on a timer (a sprinkler). Which could miss something?
- Careers: look up what a telescope operator does during a night at an observatory.
For your records
Ready to copy into an hour log, a portfolio or a transcript.
| Lesson | Telescope Lab: The Sky Moves, Tracking, Loops and Events |
|---|---|
| Subjects | Computer science |
| Time | 45 minutes |
| What we did | Programmed a simulated backyard telescope in Blocks to keep Saturn in view as the sky turned, compared tracking, an event and a timed loop, and tested the loop at several waits. |
| Skills practiced | Loops; Events; Testing a program |
Telescope Lab: The Sky Moves, Tracking, Loops and Events
Activity sheet (optional)
Name: ______________________________ Date: ______________
Open the app: scan the QR code, or go to mytekdev.com/try/telescopelab?lesson=the-sky-moves-tracking-loops-and-events
Essential question: How should a program keep up with something that is always moving?
Warm-up: Filming a friend on a merry-go-round from a tripod: how do you keep them in the picture? ________________________
- Vocabulary. Event, loop, tracking, drift, field of view, test case: write each in your own words.
- The starter. Saturn left the view after ______ seconds.
- Three fixes. Tracking: done? ____ Count reached: ______. When block: done? ____ What happened to the count: ______________. Forever loop with wait 20: done? ____ Pointed again ______ times.
- Waits. Forever loop with wait 10: ______ 30: ______ 50: ______ 55: ______ 60: ______. The loop stops working between ______ and ______.
1. Why does the when block bring Saturn back but never pass the level?
2. Why does the loop stop working past a wait of about 50 seconds?
Quick check
Name: ______________________________
1. A telescope stands still. A planet in its view: (A) stays put (B) drifts out as the sky turns (C) gets bigger
2. A when block that runs when the target drifts out of the view runs: (A) before the target leaves (B) after it has left (C) once a second
3. A friend's program points again every 2 minutes, and the planet keeps escaping. Use what you learned today to say what to change, and why.
Answers
| Question | Answer | Why |
|---|---|---|
| 1 | B | Earth turns, so the sky turns 15 arcseconds every second past a telescope that stands still. |
| 2 | B | An event runs after it happens: the target has already left. |
| 3 | Open answer | Point again more often than the planet takes to leave (under about 53 seconds in the 10 mm view), or turn tracking on so it never leaves. |
If your state or umbrella school asks, this lesson covers CSTA 2017 2-AP-12, CSTA 2017 2-AP-13, CSTA 2017 2-AP-17.