For a teacher with a class? The classroom edition has the full plan, slides and standards.

Homeschooling PDF

Family edition

Telescope Lab: The Sky Moves, Tracking, Loops and Events

Ages 11-14 ยท about 45 minutes, in one sitting

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

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.

  1. 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.
  2. 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.
  3. Tracking. Turn tracking on, from Telescope, before the wait (above or below point at Saturn both work): done at 185 seconds, held by tracking.
  4. 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.
  5. 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.
  6. 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 telescope will not point at the Sun or within 15 degrees of it, and says why: sunlight through a telescope burns the eye in an instant and the damage is permanent. Every view and picture in the app is simulated from real sky data and says so, with its source; none is a real observation.

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

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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:

The third question is the one that matters. A child who says "the when block only runs after Saturn has left, and leaving is what resets the count" understands the difference between reacting and preventing. A child who says "it did not work" has the result but not the idea.

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

Bring it into other subjects

For your records

Ready to copy into an hour log, a portfolio or a transcript.

LessonTelescope Lab: The Sky Moves, Tracking, Loops and Events
SubjectsComputer science
Time45 minutes
What we didProgrammed 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 practicedLoops; 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? ________________________

  1. Vocabulary. Event, loop, tracking, drift, field of view, test case: write each in your own words.
  2. The starter. Saturn left the view after ______ seconds.
  3. Three fixes. Tracking: done? ____ Count reached: ______. When block: done? ____ What happened to the count: ______________. Forever loop with wait 20: done? ____ Pointed again ______ times.
  4. 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

QuestionAnswerWhy
1BEarth turns, so the sky turns 15 arcseconds every second past a telescope that stands still.
2BAn event runs after it happens: the target has already left.
3Open answerPoint 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.