Skip to content

Archive

Tag: Astronomy

This is the first in my series of tutorials which will focus on how to do astronomical calculations in C#, based on a pet project of mine, from which I made heavy use of Practical Astronomy with your Calculator by Peter Duffett-Smith. mybloggingplanet.com/2015/05/high-pr-do-follow-social-bookmarking-sites.html?showcomment0751441088739243

This first tutorial will cover the basics of time, which just about every astronomical calculation is dependent upon.

The most important concepts to understand here is the difference between Local Time, Universal Time and Local Mean Time.

Local Time (which in my code I refer to as Zone Time) is the current standard time where you are now. This time takes into account your time zone and is standard across a large area so that things like trains and tv schedules will be useful.

Universal Time (usually referred to as UT) is the time at 0 degrees longitude, which runs through Greenwich, in London, and used to be called Greenwich Meridian Time – or GMT. This is considered the “standard” time of the Earth, and all other times are specified in relation to this time.

Local Mean Time is the local time of where you are now, as opposed to the standard time. If you live on one of the standard meridians, such as 15°E or 60°W for example, then your local mean time and local time will be the same, otherwise, it will differ in relation to how far away you are from your local standard meridian in longitude at the rate of 4 minutes for every degree away you are.

Right, so on to some code. To find the Universal Time from the Local Zone Time, all you have to do is subtract the time zone from the Local Zone Time. The reverse will find the Local Zone Time from the Universal Time.

C#’s date functions make this calculation relatively easy.

		public  static DateTime CalcUTFromZT(DateTime dDate, int iZone)
		{
			if (iZone >= 0)
			{
				return dDate.Subtract(new TimeSpan(iZone, 0, 0));
			}
			else
			{
				return dDate.AddHours(Math.Abs(iZone));
			}
		}

		public static DateTime CalcZTFromUT(DateTime dDate, int iZone) 
		{
			if (iZone >= 0)
			{
				return dDate.AddHours(iZone);
			}
			else
			{
				return dDate.Subtract(new TimeSpan(Math.Abs(iZone), 0, 0));
			}
		}

Now that we can get Universal Time, all other calculations will be discussed using Universal Time rather than Local Zone Time.

Finding the Local Mean Time from the Universal Time and the longitude of your location is quite straightforward. You convert the longitude into a date object representing the amount of time to add or subtract depending on if the longitude is east or west. That is handled by the ConvLongTUraniaTime function in the code. We then just add or subtract that time from the Universal Time date, and we have Local Mean Time.

		public static DateTime CalcLMTFromUT(DateTime dDate, double fLong) 
		{
			bool  bAdd = false;
			DateTime dLongDate;
		
			dLongDate = ConvLongTUraniaTime(fLong,ref bAdd);

			if (bAdd == true)
			{
				dDate = dDate.Add(dLongDate.TimeOfDay);
			}
			else
			{
				dDate = dDate.Subtract(dLongDate.TimeOfDay);
			}
	
			return dDate;
		}

		public static DateTime ConvLongTUraniaTime(double fLong, ref bool bAdd)
		{
			//double fHours;
			double fMinutes;
			//double fSeconds;
			DateTime dDate;
			//DateTime dTmpDate;

			fMinutes = fLong * 4;
			if (fMinutes < 0)
			{
				bAdd = false;
			}
			else
			{
				bAdd = true;
			}
			fMinutes = Math.Abs(fMinutes);

			dDate = new DateTime();
			dDate = dDate.AddMinutes(fMinutes);
			return dDate;
		}

To calculate Universal Time from the Local Mean Time, we do the same calculation to find the time difference and then do the opposite calculation to above to get the Universal Time.

		public static DateTime CalcUTFromLMT(DateTime dDate, double fLong)
		{
			bool bAdd = false;
			DateTime dLongDate;
			dLongDate = ConvLongTUraniaTime(fLong, ref bAdd);

			if (bAdd == true)
			{
				dDate = dDate.Subtract(dLongDate.TimeOfDay);
			}
			else
			{
				dDate = dDate.Add(dLongDate.TimeOfDay);
			}
			return dDate;
		}

I will continue with more time related functions in the next tutorial, so stay tuned.

Share


I have a love of astronomy, and combined with my love for programming, that creates in me that burning ambition to try and use both these passions together. This is where this book is invaluable.

Practical Astronomy with your Calculator is a very useful books to figure out how to calculate just about every astronomical phenomena which can be calculated from solar eclipses to the phase and location of the moon, to finding the positions of the planets at any given time.

Now, this book is aimed at calculating using a calculator, so the algorithms are slightly simplified to make that task easier, and therefore the precision of the calculations is not as great as if the algorithms had ben designed purely for a computer, but for most calculations this level of accuracy is more than sufficient.

The advantage of this method though, is that each step is very clearly laid out in the calculation, so that it is very easy to understand.

I have used this book extensively in writing an astronomical calculation application, which I will soon make available for download, and has proven indespensible to me.

Share

Sumbandila, the second South African satellite, has taken to the skies. It was launched from a rocket in Kazakhstan on Thursday evening, and has entered orbit. The last I heard, from the SA Weather and Disaster Information Service – of all people), they were still trying to stabilise the orbit, all the equipment appears to be functioning, everything appears to indicate a successful launch.

The purpose of the satellite is for earth observation, but don’t worry, it is not quite a spy satellite. It has a resolution that can make out objects of 6.25m on the ground. The satellite has a polar orbit, with a path crossing over South Africa. The orbit is 500 – 600km about the earth, which makes it a low-earth orbit, and will be used to monitor weather such as sea and land temperatures, clouds formation, rainfall and ocean levels.

Interestingly though, this satellite has been trying to get launched since late 2006, when it was going to be launched off of a nuclear submarine, but a few problems prevented that launch from happening. The launch date has been postponed several times since then, so it is great to see an actual launch has now happened.

The satellite development was headed up by the Stellenbosch University engineering faculty. It weighs 81kg, and is 1m by 0.5m in dimensions. The cost of the satellite was R26 million.

And for those of you wondering what the name Sumbandila means, it in Venda (a local South African language) it means “lead the way”. I think that is a fitting name, and hope it does lead to more involvement in space from South Africa.

Share

Having studied astronomy for a number of years at university, this is a subject that is very close to my heart, and South Africa is in a good spot right now. We have a good climate for astronomy, one of the world’s largest ground-based optical telescopes (SALT out in Sutherland), a magnetic observatory in Hermanus, and several other smaller observatories.

That all is old news though. More exciting things are still to come. South Africa are bidding to build what will be the largest radio telescope array in the world, and our only competition are the Australians.

This radio telescope, called the Square Kilometre Array (SKA), will be made up of 3000 radio dishes, each of which is 3 stories high. Think of something similar to the Very Large Array (VLA) out in New Mexico that featured in the movie Contact. Except the VLA comprises only 27 dishes. Now, granted, each dish in the SKA will be smaller than the ones in the VLA, with 3000 of them working together, nothing before it will compare.

The name of the telescope comes not from the size of the area on which the telescopes will be built, but rather, the combined surface area of the dishes, which will be spread out over an enormous area. If we get the bid, most of the dishes will be built in the Northern Cape, with 7 other neighbouring countries also having a few dishes, since the full scale will be 3000km across.

The reason for this is that when you use several radio telescopes far apart from each other, you can get much better resolution than having one big giant dish. I won’t go into the technical details of how this works since I would probably lose 99% of my readers doing that. Suffice to say, what we are essentially creating here is a huge radio telescope 3000km across that is made up of 3000 individual bits, all connected by fiber optics.

And what would be the price tag for this project? Only a paltry two billion euros. It sounds a lot, but when you compare to what you are trying to do, it doesn’t sound like much.

I think South Africans need to come forward and be proud that we are being considered. Come on show your support.

Share