Friday, January 08, 2021

learned new way to set FOV

Chris V pinged me and asked if there was a way in Stellarium to get to a specific zoom level or field of view size.

I said, "Yes," thinking of the old script method I had discovered many moons ago. But I'd have to look it up...

Then I remembered the keyboard shortcuts, Ctrl+Alt+1, Ctrl+Alt+2, Ctrl+Alt+3, etc.

Chris said the shortcuts didn't work as he wanted to get to a 30° FOV.

Ctrl+Alt+4 shows 45; Ctrl+Alt+5 shows 20. Big jump.

So I renewed my search efforts. Found my note from 2006 (!) using Stellarium 0.9.x. Back then, you could use the Script Commander text box (after editing an INI). Then you could type a text command for zooming and specify the field diameter in degrees.

In my modern Stellarium on my Win10 desktop, I activated the Text User Interface but it didn't seem right.

So I tried the Script Console. Typed the old command but that threw an error.

Dove into on online manual and looked up the script command. 

StelMovementMgr.zoomTo(size[,speed]);

where 

  • size is in degrees, and; 
  • speed is in seconds, optional.

The semicolon is likely important.

Typed stelmovementmgr.zoomto(30); into the Script Console panel but it didn't work. Huh?

Made a script SSC file, copied the appropriate command from the manual, stored it in the YOURDRIVE \Users \YOURUSER \AppData \Roaming \Stellarium \scripts folder, ran it, and it worked. Thirty degree field. A little clunky...

Told Chris.

Shutdown Stellarium, took a break, then tried it again.

  1. access the Script Console by pressing F12
  2. ensure the Script tab is active
  3. enter the command StelMovementMgr.zoomTo(30);
  4. click/tap the run script (triangle-play) button
  5. close the console window

That's easy and quick!

Warning! Stellarium script commands are case-sensitive!

By the way, you know you're entering valid commands in the console when they change colour...

§

All this got me wondering if you can assign a keyboard shortcut to run a particular script...

No comments: