Showing posts with label the night sky. Show all posts
Showing posts with label the night sky. Show all posts

Sunday, October 5, 2014

The Heavens Have Foretold Your Doom


At one time or another, many computer animation people have worked to create an illusion of the night sky from earth or of its cousin, a “star field”, which is an imaginary view of the stars from space. Whether this was for their own amusement, for visual effects purposes, or for scientific visualization, these innocents would approach the problem with the assumption that it was going to be easy. How hard could it be, its just a bunch of random white dots, after all. Imagine their surprise when they discovered that doing excellent starfields is far from trivial.

A classic traditional technique to create starfields is to create a cyc, or curved screen, painted black and with very small holes punched in it. Then behind this screen was a curved light source, usually florescent tubes. The camera would be at the center of the implied sphere of the screen and when the room was darkened and the backlight illuminated, you had a curved space of very bright, very small light sources which could be photographed with long exposures when the camera was moving. The result was excellent motion blurred, perfectly antialiased, very high contrast star fields. But ultimately there were certain moves that the motion control camera could not easily do, such as tumble end over end for example, so there was a need to synthetically generate these elements.

Another time honored technique which looked excellent was the painting on glass. Most of the times you saw stars in Close Encounters of the Third Kind (1977) you were seeing an optical composite of a live action element or motion control shot with a matte painting on glass.




Since everyone seems to have to go through the same learning curve, I am providing notes here for what some of the issues facing 3D technical directors as they produce their first starfield and I have written it as a letter to my younger self.


September 19, 1983

Oh, unwary traveler, so proud of your 3D knowledge, your knowledge of geometric modeling, or of animation whether scripted or procedural, and of global illumination; do you think to encompass the heavens with these pathetic tools? Fool, your doom is assured. There are more things in heaven and on earth than are encompassed in your philosophy, or so I have heard, and when you approach the field of scientific visualization you must unlearn what you have learned and embrace the esoteric wisdom. You must open your eyes in order to see the light.

What perils await the unwary, the arrogant, the unlettered?

The first peril is the vast expanse of space. There is the scale of mortal man, then the scale of the solar system, then the scale of one single galaxy, and then beyond. These differences in scales are way beyond what most software packages can handle, so using the 3D positions of everything in a naive fashion is unlikely to work.

And that renderer you are so proud of.  Does it do all its calculations of space in 64 bit floating point or even higher precision?   Most renderers, with a few notable exceptions,  do the majority of their work using single precision floating point which may be adequate for a giant robot or two, but falls apart in the vast distances of space.  

The second peril involves the issue of filtering of what is very untypical samples.  Most scenes render surfaces with various lighting applied.   But a great deal of what you wish to render are stars but what are stars? Stars are huge things, but they are (for all practical purposes) infinitely bright and infinitely small (on the screen). The amount of energy concentrated in a single pixel may be immense, but the pixel next to it may have very little or no energy at all. And what happens under those circumstances when you move the camera? Well, it aliases, of course, terribly. Furthermore, if one has modeled stars very far away and you are using point sampling of one form or another to simulate area sampling, then if you are not careful, some of your samples will miss and you will have aliasing again.

Part of the solution is to use a good filter and lots of samples and in the choice of filter lurks another threat since as we know a "good" filter, perhaps a 7x7 sinc for example, is likely to have negative lobes, and instead of throwing those values out, you should keep them until the end and even then you should not throw them away. What then to do with them is a mystery left as an exercise for the reader.  The best solution of course would be to have a display that could absorb light as well as emit it, but we wait in vain for the display manufacturers to come to our aid.

And what about those overly bright stars? Will you generate glows and other artifacts? After all we are not just trying to simulate realistic stars, we are often trying to simulate realistic stars as the audience has seen them, and expects to see them.

Although the sky is filled with stars, that is not the only thing that there is. There are also great fuzzy areas known as nebulae and sometimes other galaxies. It turns out that if there is any data for that, it is likely to be volume data. But even if there is no data and you create your own, volume rendering is the best way to render a nebula one might argue. Does your renderer of choice do volume rendering?

Review the following image of the earthling's galaxy.




Do you notice the great areas of darkness? That of course is the infamous "space dust", the so-called Interstellar Media or ISM which must surely exist to hide from us the center of our galaxy where no doubt an entity of great evil exists. Surely you do not think it a coincidence that the space dust would hide what is arguably the most spectacular sight in our little neighborhood? Since most star catalogs do not have the ISM modeled, you may wish to develop a model of ISM in your spare time. If not, the galaxy will not look right unless you simply leave out the stars that are in those areas (which may or may not be be in the catalog anyway as they are impossible to view from earth, at least in the visible bands).

Because you are rendering stars, no doubt you have studied scotopic vision.  It goes without saying that whenever the biped mammals have watched the stars they have, generally, been night adapted. And yet they see color sometimes, perhaps they see Angry Red Planet Mars or Betelgeuse and they perceive the color red.   How then are they seeing color? It may help the seeker of knowledge to realize that “scotopic” is named for the Skoptsy sect of religious devotees whose most notable doctrine is of male castration.  (see link below)

Of course I am sure when you move the camera you will motion blur everything. Oh yes, what do you plan to do with the speed of light issue? I am sure you will come up with something.

So, foolish mortal, you have been warned.

These are just the first of the issues you must address for a proper starfield.

Fools may go where wise people fear to tread.

Sincerely,
A Friend.



___________________________________________________________


Scotopic Vision

The Skoptsy

Close Encounters of the Third Kind (1977) on IMDB

Saturday, October 4, 2014

A New Star Catalog is Always a Cause for Celebration


A new star catalog is always a cause for celebration. Anyone who does more than dabble at astronomy visualization realizes that it is getting ahold of the data that is the sine qua non of serious work.

And yet getting the data is just the first of your many challenges. Very soon after downloading the data you will realize that one needs to have done some advanced study in astrophysics and/or have the services and advice of an astrophysicist or two in order to get anywhere. Without one or the other or both, the would-be visualizer will soon feel that he or she is lost in the forest on a moonless night.

But getting the data is the first necessary step, so it was with great pleasure that I read about the newly announced star survey with the catchy title of The second data release of the INT Photometric Hα Survey of the Northern Galactic Plane (IPHAS DR2)

And what is in this fabulous new survey?
The INT/WFC Photometric Hα Survey of the Northern Galactic Plane (IPHAS) is a 1800 deg2 imaging survey covering Galactic latitudes |b| < 5° and longitudes ℓ = 30°–215° in the r, i, and Hα filters using the Wide Field Camera (WFC) on the 2.5-m Isaac Newton Telescope (INT) in La Palma. We present the first quality-controlled and globally calibrated source catalogue derived from the survey, providing single-epoch photometry for 219 million unique sources across 92 per cent of the footprint. The observations were carried out between 2003 and 2012 at a median seeing of 1.1 arcsec (sampled at 0.33 arcsec pixel−1) and to a mean 5σ depth of 21.2 (r), 20.0 (i), and 20.3 (Hα) in the Vega magnitude system.

And so forth.

There are 219,000,000 unique sources in this survey. That is quite a bit more than the 10K star Yale Bright Star Catalog that we all grew up on. (1)

And yet there are certain similarities when you look a bit closer.   Certain subtle indications that suggest that the compilers of this fabulous expanse of data are adepts of the esoteric knowledge of astrophysics and that this data is intended for other members of this elite group.

In order to brace you for the tasks to come, should you decide to take on the challenge of visualizing this august data set, this post will present some first principles that are important for someone from the world of 3D as they step into the galaxy of creative decisions to be made and the arcane knowledge to master before the images latent in this esoteric compendium will be revealed.

I myself was first introduced to this knowledge during my brief but rewarding tenure on the Digital Galaxy Project portion of the rebuild of the Hayden Planetarium at the American Museum of Natural History in New York City.   Everyone on that project was a dedicated idealist with stars in their eyes.(2)

Because, you see, this dataset, like most astronomy datasets, is not intended to be for computer animation people. It is first and foremost to help scientists in the field, both those associated with the survey itself and those in the larger field of astrophysics, do their research. If people want to use it to “visualize the data” or make interesting pictures, that is all well and good, but that purpose is much further down the list of intended uses.




If we want to visualize the night sky what information would we ideally want? Well, we might want the 3D position of the stars, the brightness of the star, the color and presumably the type of star, as well as information about other objects in the sky that are not stars. This is a short list, there are actually many other things one might want to know for visualization purposes, but lets stop here. Ironically, a normal star survey or catalog does not generally have any of this information. At least not directly.

That is because what scientists are looking for in a star survey are the facts as they were observed. They may also be interested in your interpretations of the facts, but first and foremost they are interested in the data and how it was collected.

That means that instead of the 3D position of the “star” which we do not observe directly, except in a few exceptional cases, what the star catalog has is the position of the star as observed from earth on an imaginary 2D spherical coordinate system, a virtual sphere around the earth. In other words, the catalog does not say where the star is, but rather what direction it was observed to be from earth. The survey does not contain how bright the star was, or even if it was a star, but rather the spectra and intensity of the energy source as observed with the specific instrument. From that spectra, and from other information about the source of energy, one can deduce the type of star it probably is, but that is an interpretation of the data, not the data itself.

The star catalog or survey will not report the “color” as one normally thinks of such things, whether in RGB values, or CIE or other systems, but rather what was observed by the specific instrument or instruments used to collect the information. From the information in the catalog and the operating characteristics of the sensor one can derive spectra and from that a handy “color” in the visible bands if one so desires.

Nor is there any particular guarantee that the catalog is comprehensive, in some normal sense of the word. The authors of the catalog are not guaranteeing you that this survey contains all possible “stars” in the sky, or part of the sky. Instead what they are reporting here is the information about what they observed, and often some measure or estimate of how complete it is. The famous Messier catalog is not a complete list of anything, except the list of objects that Messier did not want to be bothered with anymore in his search for comets.

In a similar fashion, the data does not tell you how bright the star actually is, if it is a star, but tells you the intensity of the source as observed from earth. Again, an astrophysicist has various techniques to convert the apparent magnitude of the source to the absolute magnitude, if that is what you need.

The new star catalog has 219 million unique sources which may or may not be stars, and a variety of information about each, including some derived information (e.g. a probability that the specific source is indeed a star).

But it won't tell you anything about ISM (interstellar media), H2 regions and so forth.

When downloading the data, you can choose to download prepared datasets of the survey, or you can choose which data fields you want to review.  There are 99 different fields, and a dozen or so different formats you can get them in.  Just getting the data will probably take several days.

This post is the tip of the iceberg of what you need to know to do visualization from astronomy datasets but we will reserve these other topics for later posts.

The announcement can be found here

The database can be found here

______________________________________________

Notes

1. The Yale Bright Star Catalog is a famous dataset of the 10,000 or so brightest stars visible from earth. These are the stars that one could typically see from earth on a clear night with the naked eye from somewhere on the planet. It is a famous catalog in part because it was widely distributed even in days before the Internet or the Arpanet.

2. There were many, many people on this project which was part of a much larger project to rebuild the Hayden Planetarium and the entire north side of the American Museum of Natural History. Many people thought we were from Mars.  The cast of characters included such luminaries as Dennis Davison, Neil deGrasse Tyson, Carter Emmart, Frank Summers, Aram Friedman, Loretta Skeddle, Julio Morano, Benjy Benjamin, Ron Drimmel and many others.  And of course, your humble author, was also briefly a consultant on this project.