//
// Name: Binocular Highlights
// Author: Alexander Wolf
// License: Public Domain
// Version: 1.1
// Description: Tours around interesting objects, which accessible to observation with binoculars. The data for the script are taken from the eponymous book by Gary Seronik.
//

include("i18n.inc");

// RA, DE, Name, Note
var highlights = [["", "", tr("Chapter 1"), tr("December to February")],
		  ["04h01m58.35s", "+62d30m50.7s", tr("Kemble's Cascade"), tr("Kemble's Cascade is visible even in light-polluted skies")],
		  ["02h20m15.73s", "+57d05m55.0s", tr("The Glorious Double Cluster"), tr("NGC 884 and NGC 869")],
		  ["03h31m53.99s", "+48d44m06.0s", tr("The Alpha Persei Association"), ""],
		  ["02h42m00.00s", "+42d47m00.0s", tr("M34: A True Binocular Cluster"), ""],
		  ["03h08m10.14s", "+40d57m20.3s", tr("Watching the Demon Star"), ""],
		  ["03h46m13.77s", "+24d11m47.7s", tr("The Pleiades"), ""],
		  ["04h26m53.24s", "+15d47m41.6s", tr("Corralling the Hyades"), ""],
		  ["04h46m00.01s", "+19d04m00.0s", tr("NGC 1647: The Crab Cluster"), ""],
		  ["05h33m21.53s", "+21d59m34.4s", tr("Messier's Number One"), ""],
                  ["05h32m11.30s", "+34d56m24.5s", tr("Auriga's Messier Clusters"), tr("M36 and M38")],
		  ["06h08m14.63s", "+24d14m44.5s", tr("Another Double Cluster"), tr("M35 and NGC 2158")],
		  ["05h55m10.34s", "+07d24m25.6s", tr("Golden Betelgeuse"), ""],
                  ["05h36m12.82s", "-01d12m06.9s", tr("Orion Extras"), "Cr 70"],
		  ["05h35m24.01s", "-05d27m00.0s", tr("Orion's Sword"), tr("NGC 1981, M42, M43 and Struve 747")],
		  ["06h45m57.46s", "-20d46m30.2s", tr("The Overlooked Open Cluster: M41"), ""],
		  ["07h07m16.45s", "-08d40m13.3s", tr("M50 in a Stream of Starlight"), ""],
		  ["07h38m59.86s", "-14d40m59.0s", tr("M46 and M47: A Celestial Odd Couple"), ""],
                  ["07h18m27.98s", "-31d46m58.4s", tr("Collinders in Canis Minor"), tr("Cr 132 and Cr 140")],
		  ["07h48m49.14s", "-38d12m15.4s", tr("Two Southern Delights"), tr("NGC 2477 and NGC 2451")],
		  ["", "", tr("Chapter 2"), tr("March to May")],
		  ["02h55m16.56s", "+88d48m25.7s", tr("The Engagement Ring"), ""],
                  ["09h55m21.31s", "+69d23m27.0s", tr("The Power of Power"), tr("M81 and M82")],
		  ["14h03m12.01s", "+54d21m00.0s", tr("M101 in the Mind's Eye"), ""],
		  ["13h30m00.01s", "+47d16m00.0s", tr("A Star-Hop to M51"), ""],
		  ["12h19m00.01s", "+47d18m00.0s", tr("Galaxy Season"), "M106"],
		  ["12h52m47.82s", "+39d49m11.2s", tr("Steady on Galaxy M94"), ""],
		  ["13h42m12.00s", "+28d23m00.0s", tr("Globular Cluster M3"), ""],
		  ["12h23m41.82s", "+26d36m05.2s", tr("In and Around Melotte 111"), ""],
		  ["15h29m17.30s", "+39d01m01.1s", tr("A Trio of Doubles in Bootes"), ""],
		  ["15h48m34.42s", "+28d09m24.1s", tr("R Cor Bor's Vanishing Act"), ""],
		  ["08h50m04.95s", "+28d18m23.9s", tr("Two Doubles in Cancer"), tr("Rho and Iota Cancri")],
		  ["08h40m06.00s", "+19d59m00.0s", tr("The Beehive Cluster"), "M44"],
		  ["09h32m12.01s", "+21d30m00.0s", tr("A Visit to NGC 2903"), ""],
		  ["11h27m56.26s", "+02d51m22.4s", tr("A Pair of Leo Doubles"), tr("Tau Leonis")],
		  ["10h08m22.05s", "+11d58m02.8s", tr("A Pair of Leo Doubles"), tr("Alpha Leonis (Regulus)")],
		  ["08h19m03.85s", "-04d58m43.2s", tr("Star Cluster M48 in Hydra"), ""],
		  ["10h37m33.32s", "-13d23m05.0s", tr("U Hydra"), tr("Carbon star")],
		  ["10h51m37.25s", "-21d15m00.3s", tr("V Hydra"), tr("It has been ranging from magnitude 6 to 10 with a period of about 550 days.")],
		  ["12h36m02.85s", "-12d15m54.5s", tr("M104 and the Great Beyond"), ""],
		  ["15h18m36.01s", "+02d05m00.0s", tr("Ancient Globular M5"), ""],
                  ["13h26m47.29s", "-47d28m46.1s", tr("Magnificent Omega Centauri"), "NGC 5139"],
		  ["", "", tr("Chapter 3"), tr("June to August")],
		  ["18h54m24.05s", "+71d17m50.3s", tr("Resolving Nu Draconis"), tr("Nu Draconis's components are separated by 62\"")],
		  ["16h41m42.01s", "+36d28m00.0s", tr("The Great Hercules Cluster"), "M13"],
                  ["19h30m43.28s", "+27d57m34.7s", tr("Double Delight Albireo"), tr("Albireo's components are separated by 35\"")],
		  ["20h14m31.40s", "+47d08m43.9s", tr("A Colorful Cygnus Triple"), tr("Omicron1, Omicron2 and 30 Cygni")],
		  ["21h44m08.83s", "+28d44m29.3s", tr("Three Cygnus Doubles"), tr("Mu Cygni (Its stars are separated by a generous 198\")")],
		  ["21h43m25.70s", "+38d17m00.8s", tr("Three Cygnus Doubles"), tr("79 Cygni (Its stars are separated by 150\")")],
		  ["21h06m56.48s", "+38d45m19.7s", tr("Three Cygnus Doubles"), tr("61 Cygni (Its stars are separated by 31\")")],
		  ["21h32m12.00s", "+48d26m00.0s", tr("Open Cluster M39 in Cygnus"), ""],
		  ["21h53m20.01s", "+47d16m00.0s", tr("The Road to the Cocoon"), tr("IC 5146, B168 and M39")],
		  ["18h41m50.25s", "+38d39m36.8s", tr("Summer's Other Triangle"), tr("Epsilon, Zeta and Alpha Lyrae")],
		  ["18h53m36.01s", "+33d02m00.0s", tr("M57 and Expectations"), tr("Difficult deep-sky object for tests your observing skills...")],
		  ["19h53m48.01s", "+18d47m00.0s", tr("Splendid Sagitta"), tr("M71 between Gamma and Delta Sagittae")],
		  ["19h59m36.01s", "+22d43m00.0s", tr("M27 in Vulpecula"), ""],
		  ["19h26m13.25s", "+20d05m51.3s", tr("A Milky Way Surprise"), tr("Brocchi's Cluster (Cr 399) or Coathanger")],
		  ["19h40m43.20s", "+10d57m00.0s", tr("Barnard's \"E\""), tr("B143 near Altair")],
                  ["18h51m06.01s", "-06d16m00.0s", tr("M11 in Scutum"), tr("Also known as the Wild Duck Cluster")],
		  ["18h39m17.89s", "+05d13m48.8s", tr("IC 4756 in Serpens"), ""],
		  ["18h27m42.00s", "+06d34m00.0s", tr("Three Star Clusters in Ophiuchus"), "NGC 6633"],
		  ["17h46m18.01s", "+05d43m00.0s", tr("IC 4665 in Ophiuchus"), ""],
		  ["16h52m37.02s", "-03d00m07.0s", tr("A Pair of Ophiuchus Globulars"), tr("M10 and M12")],
		  ["16h25m35.15s", "-23d26m50.3s", tr("Rho Ophiuchi"), tr("Rho itself is a pretty triple star")],
		  ["16h15m37.51s", "-08d22m17.6s", tr("A Solar Twin"), tr("18 Scorpii")],
		  ["16h11m59.73s", "-19d27m37.4s", tr("A Double for Steady Hands"), tr("Nu Scorpii components are separated by 41\"")],
		  ["16h19m35.65s", "-24d50m17.8s", tr("Globular Cluster Season"), tr("M4 and M80")],
		  ["17h46m22.52s", "-33d37m40.7s", tr("A Gorgeous Duo"), tr("M6 and M7")],
                  ["16h55m29.52s", "-40d58m44.1s", tr("A False Comet"), tr("Cr 316, NGC 6231 and NGC 6242")],
		  ["18h16m48.01s", "-18d33m00.0s", tr("Summer Star Cloud"), "M24"],
                  ["18h19m47.27s", "-15d33m57.5s", tr("Milky Way Messiers"), tr("M16, M17 and M18")],
                  ["18h03m48.00s", "-24d23m00.0s", tr("The Lagoon Nebula"), "M8"],
		  ["18h30m12.70s", "-24d23m24.0s", tr("M22: A Gem of a Globular"), tr("M22 and M28")],
                  ["19h39m59.71s", "-30d57m53.1s", tr("A Lonesome Messier"), "M55"],
		  ["", "", tr("Chapter 4"), tr("September to November")],
		  ["22h10m05.05s", "+48d05m42.5s", tr("Two Lacerta Clusters"), tr("NGC 7209 and NGC 7243")],
		  ["20h32m04.52s", "+60d25m19.4s", tr("NGC 6939 and NGC 6946"), ""],
		  ["21h43m30.48s", "+58d46m48.1s", tr("Magnificent Mu Cephei"), tr("A semiregular variable star")],
		  ["22h29m10.30s", "+58d24m54.8s", tr("Watching Delta Cephei"), tr("Well-known variable star and striking double also")],
		  ["23h24m12.01s", "+61d35m00.0s", tr("M52 in Cassiopeia"), ""],
		  ["23h57m00.01s", "+56d44m00.0s", tr("Galactic Cluster NGC 7789"), ""],
		  ["01h19m06.01s", "+58d20m00.0s", tr("The E.T. Cluster"), "NGC 457"],
		  ["01h33m12.01s", "+60d42m00.0s", tr("Open Cluster M103"), ""],
		  ["00h42m42.01s", "+41d16m00.0s", tr("Magnificent M31"), ""],
		  ["00h42m42.01s", "+41d16m00.0s", tr("Andromeda's Companions"), tr("M32 and M110")],
		  ["01h57m48.00s", "+37d41m00.0s", tr("Ancient Cluster NGC 752"), ""],
		  ["01h33m50.91s", "+30d39m35.8s", tr("Triangulum's Treasure"), "M33"],
                  ["23h46m23.49s", "+03d29m12.1s", tr("TX Piscium"), tr("Carbon star, which varies slightly from magnitude 4.8 to 5.2")],
		  ["21h30m00.01s", "+12d10m00.0s", tr("A Farewell to Summer"), "M15"],
		  ["21h33m30.00s", "-00d49m00.0s", tr("Messier 2 Shining Through"), ""],
		  ["22h29m36.01s", "-20d48m00.0s", tr("The Ghostly Helix Nebula"), "NGC 7293"],
		  ["00h50m15.77s", "-25d14m40.3s", tr("Challenging NGC 253 and NGC 288"), ""]
		 ];


var color="#00AAFF";

core.clear("starchart");
GridLinesMgr.setFlagEquatorGrid(false);
StelMovementMgr.setFlagTracking(true);
core.setGuiVisible(false);
ConstellationMgr.setFlagArt(false);
ConstellationMgr.setFlagBoundaries(false);
ConstellationMgr.setFlagLines(false);
ConstellationMgr.setFlagLabels(false);
NebulaMgr.setFlagHints(false);
StelSkyDrawer.setFlagStarMagnitudeLimit(true);
StelSkyDrawer.setFlagNebulaMagnitudeLimit(true);
StelSkyDrawer.setCustomStarMagnitudeLimit(10.5);
StelSkyDrawer.setCustomNebulaMagnitudeLimit(10.5);

core.wait(3);

var dsname = LabelMgr.labelScreen(tr("Binocular Highlights"), 20, 20, false, 40, color);
var dsnote = LabelMgr.labelScreen(tr("Look through the Meade 10x50 TravelView Binocular"), 20, 75, false, 20, color);

LabelMgr.setLabelShow(dsname, true);
LabelMgr.setLabelShow(dsnote, true);

core.wait(5);

LabelMgr.setLabelShow(dsname, false);
LabelMgr.setLabelShow(dsnote, false);

for (i=0; i<highlights.length; i++)
{
	StelMovementMgr.zoomTo(25, 3);
	core.wait(1);
	core.setDiskViewport(false);

	var dsname = LabelMgr.labelScreen(highlights[i][2], 20, 20, false, 30, color);
	var dsnote = LabelMgr.labelScreen(highlights[i][3], 20, 60, false, 20, color);

	LabelMgr.setLabelShow(dsname, true);
	LabelMgr.setLabelShow(dsnote, true);

	if (highlights[i][0]=="" && highlights[i][1]=="")
	{
		core.moveToRaDec("0h0m0s", "-90d0m0s");
		core.wait(5);
		LabelMgr.setLabelShow(dsname, false);
		LabelMgr.setLabelShow(dsnote, false);
	}
	else
	{
		core.moveToRaDecJ2000(highlights[i][0], highlights[i][1]);
		StelMovementMgr.zoomTo(5.7, 5);
		core.wait(3);
		LabelMgr.setLabelShow(dsname, false);
		LabelMgr.setLabelShow(dsnote, false);
		core.setDiskViewport(true);
		core.wait(5);
	}
}

LabelMgr.setLabelShow(dsname, false);
LabelMgr.setLabelShow(dsnote, false);

core.clear("natural");
core.setGuiVisible(true);
core.setDiskViewport(false);
core.goHome();
