Update on the program of azimuthal equidistant projection

I wrote codes to project a real image of the earth by using azimuthal equidistant projection 2 years ago. But recently I found out it did not work on newer PC.
It seemed that the cause might be the version of .Net framework. The version I was working on to create the program was 3.0, on which it can run normally. The version it did not correctly run on was 4.5. But I had been so screwed up with this problem.

Finally, I found the cause was the minor difference of behavior of Marshal::Copy() in different versions. In my program, I used this copying function to transform data on an array to the form of 24-bit bitmap, and vice versa. If you learned computer engineering, you may know 24-bit bitmap has "padding", or additional space, at the end of each row of the image so that the byte size of the row can be a multiple of 4. Actually, I didn't know well about how the function worked, so I just put data on an array without padding and let it convert data to bitmap. The old version seems to flexibly convert data and automatically put necessary padding, but the newer one seems so strict about the format of the array and some portion of data had been accidentally put into the space of padding. This means the order of RGB data could be corrupted. That's why the result of problematic image lost colors and was distorted.
The width of the image is 533. So the total byte size of the row is 533 x 3 = 1599 bytes. To make this a multiple of 4, 1 byte of padding must be added. The image above misses this 1-byte space, and the function mistakenly took next 1 byte of data as padding. So the row of image gradually shifts to the left as it goes from top to bottom.

So I took this feature into consideration. I reformatted the array so that it has padding in each row.
Now the program can normally run on .Net framework 4.5!
Phew..., it was hardwork...
Anyway, you can download the program at http://sites.google.com/site/somedayuniverse/contents/azimuthal-projection


enhancement by Gimp

Well, it's been a while since I last posted...

In this summer, I took pictures of the night sky because I found out my cheap digital camera can control its shutter speed. But the result was horrible. The following is the picture which was exposed for 15 seconds.

You cannot see anything, can you? (Actually, there is a few dark points though)

OK, so I used Gimp to enhance the image. Gimp is a kind of software to draw and paint. But, in addition, it can also modify and enhance images. I used Curves, one of the modifying tools.
At the menu bar, Tools -> Color Tools -> Curves. Then, you can transfer dark pixels to the brighter level.

This is the result.

Many stars! Pegasus is on the left side. Lacerta and Andromeda are at the lower right and the upper right, respectively.

The location where I took this picture was an urban area. So I will try the same thing in a rural area someday!


Constellation Program

I remember NASA used to have so called "constellation program" several years ago. Briefly, they were planning to send human beings to the Moon again.

This program seems the preparation to build a stronghold on the Moon for the space exploration of the further celestial bodies. The gravity on the Moon is less than 20% of that of the Earth. If some resources are available there, people can build a base and launch rockets by using less energy. The Moon has the potential to be a gate way to deep space.

But this program was canceled because of its huge cost. You know sending humans requires more cost and technologies rather than sending machines. However, this means autonomous systems can play an important role on the efficiency of exploration. In addition, sophisticated autonomous technologies will also reduce the cost of manned exploration in the future. I think the current trend in space exploration is an unmanned autonomous spacecraft. So robotics will gain more focus in the future. (yet, already?)


Colored Coulds

You may know the atmosphere can be divided into several layers. What is the furthest layer from here? Yes, it's the ionosphere. This layer plays an important role for radio communication. The molecules in the layer are ionized by the radiation from the Sun. These ionized molecules reflect radio waves from the ground. (of course, such waves with higher frequency can go through the layer though...) That is, we can send radio waves beyond the horizon. But this layer changes dynamically. So it is important to understand the phenomena and mechanism of it.

This picture is the experiment to observe winds in the ionosphere. The equipment of the rocket released the vapor of lithium. The flame color of lithium is red, so you can see a red clound in the image. It seems there are some other types of metal released. The scientists can figure out the dynamics of the ionosphere by analysing the transition of these clouds.

You can see the details about the experiment here.


C++/CLI (handmade) template for Windows Form Application

Finally, Microsoft released Visual Studio Express 2012, and it has IntelliSense for C++/CLI! If you have ever used Visual C++ 2010 Express, you might have complained about the absence of IntelliSense in it. So you don't need to use VC++ 2008 anymore.

But, unfortunately, there is no C++/CLI template for Windows Form Application as of Sept. 25th 2012.

So I made a template. I just put a form into an empty project and set it up as a Windows form application. So I might have missed some settings. Maybe you might do a better job.
Anyway, you can download it from this page of my web site.


Mars Exploration

I am recently excited about Mars exploration, especially Curiosity rover. You might have known that this spacecraft landed by using incredible techniques.

The previous rovers, such as Mars Exploration Rovers, used airbags and bounced on the ground several times to land on Mars. However, Curiosity used different process. After deploying its parachute and slowing down correctly, it separated from the parachute facilities and fell down with the special machine called Sky Crane. The crane hovered and hanged the rover with a cable. When the rover touched down, it flied away with the cable.

This achievement was made also by the spacecrafts orbiting Mars. Mars Odyssey helped the communication between Earth and Curiosity at the entry and descending.
Mars Reconnaissance Orbiter are gathering data around the rover.

I think spacecrafts orbiting an celestial object are important to make the environment for exploration because they can establish the network around the object and Earth.
Even in deep space where a rover has to work by itself without the control room, if there are orbiters, they can seize the information of wide areas of an object.
In the future, it may be a major way to send a rover with many orbiters and machines scattering around an object rather than sending just a single rover or spacecraft.


Mental Calculation for Temperature Scales

Today, I heard the first cry of cicadas. It's summer! And It is very hot. The maximum temperature is 30 deg. Celsius. But how do you say it in Fahrenheit?
I am sometimes confused with the two scales of temperature: Fahrenheit and Celsius.

You know Fahrenheit is used in a few countries including the U.S. I don't know why Fahrenheit is still commonly used in the U.S. even though many other countries use Celsius. Every time I talk about weather with them, I have to "translate" Celsius to Fahrenheit, and vice versa.

But it is ridiculous to always hold a pen and notes (or a calculator) to use this formula: (F=C*9/5+32). So I have several steps to easily calculate scales in my head.

Celsius to Fahrenheit:
You have a value C in Celsius.

1. Double C
       C * 2
2. Subtract 10% of it
       2C - 0.1 * 2C
3. Add 32
       2C - 0.1 * 2C + 32

Then you get an exact value in Fahrenheit.

It is easier than expected.
For example, let's say the temperature is 30 deg. C.
So you can calculate as the below:
   54+32=86 The temperature is exactly 86 deg. F.

In case of 20 deg. C.:
   36+32=68 The temperature is 68 deg. F.

The reason can be derived from the formula.

Fahrenheit to Celsius:
You have a value F in Fahrenheit.

1. Divide F by 2
2. Subtract 16 from it
      F/2 - 16
3. Add 10% of it
      F/2-16 + 0.1 * (F/2-16)

In this case, you get an approximately value in Celsius.

For example, let's say the temperature is 70 deg. F.
So you can calculate as the below:
   19+1.9=20.9  The temperature is about 21 deg. C.

The reason can be derived from the formula.