Tuesday, August 18, 2020

Bright and Dark

 

Now let's look at objects, both bright and faint. Let's put little lines across them that sample and print out the pixel values, and see what they look like.

Here's one from the brightest star in the image: its profile in a graph, along with an actual slice of the image along the area that was sampled. And I have scaled up the tiny image slice to correspond pixel-for-pixel with what you see in the graph.

 

 What's interesting about this profile is that it does not rise to a point, but instead is mesa-shaped. That flat area at the top is probably what we should consider to be the 'real' object, while the rapidly falling off light of the steeply sloping sides is side-glow.

But don't imagine that the flat area -- 5 pixels across -- is the actual image of the star, though! We are nowhere near that kind of resolving power. A single one of telescope T11's pixels is 0.81 arc-seconds across. Even if we were looking at the very closest star -- 4 light-years away -- just one of T11's pixels would cover a distance of 22 million miles at that range. That is a span 26 times bigger than our own sun. So the 5-pixel flat area of this light profile covers a space 130 times wider than the Sun, even at the range of the closest star in the sky. Which is not what we are looking at.

So what we are seeing here is a tiny intense point of light, far away in space, spreading out as it passes through the Earth's atmosphere and moving around randomly because of motions of the air during what was a 10-minute exposure.

Still, the fact that some of that profile is so nice and flat rather than looking like a normal curve suggests that there are two different processes involved in illuminating the central 5 pixels and the 5 or 6 on either side of it. If I had to pick a specific boundary for this object in my image, I would pick that flat area from 325 to 330 on this image's X-axis.


Is that what all bright objects look like? Let's do another one. Here is a sample line across the bright star near the center of this image.


Yes, it looks similar. In fact, at 4 pixels diameter it's almost the same size. Just a little smaller, probably because this object is a little dimmer. It fills the central pixels to 47,000 gray values or so, while the first one filled them to 55,000. The central flat area is 4 pixels across here rather than 5, and the sides -- where light falls off to one-tenth of the central illumination in the space of 3 pixels, are also a little smaller. The brighter object takes 4 pixels on both sides to fall off the one-tenth of the center.

SO! We have a way to determine the edge of bright objects. If you look at these two curves, the point where the sloping wall meets the top of the mesa is a place where the slope of that line changes very quickly. That would be easy to find programatically. 


Now how about doing the same sample-line trick to a couple of extremely faint objects? 


The brightest pixels in this sample line are almost 200 times fainter than in the brightest star, but we can still discern something like the same mesa pattern. Except that this 'mesa' has a flat top only 2 pixels across, and it slopes down on either side less symetrically -- taking only a single pixel on the left side to reach the background, and several pixels on the right.

Can we find an object this faint, when its height above background is only a couple times higher than the average background fluctuations?

The second bright star is close enough to this faint star in the image that we can see both in a single view. Take a look:

The faint star isn't much, but I bet you can see it with no problem -- and with little doubt that it is not just a random background fluctuation.

Why is that?

I think I know -- but another faint object will illustrate the idea better. Let's look at a galaxy!

 

 

That is what you call a galaxy far, far away. (And long ago!) It's very faint, but you can clearly see it, right? Looking at the profile we see that, again, the height of the galaxy brightness profile is no better than double the average brightness fluctuations of the dark background.

If you were to try doing a normal grayscale threshold automatically, I think you would have a very hard time separating this kind of object from the background. But I think, with the help of a little bit of statistics, it might become a lot easier. 

But that ... is Another Story.



Monday, August 17, 2020

First Light

 Let's start by learning a little about our images. The first thing I'd like to know is -- how dark are the dark areas between the stars?  A gray16 image has 65536 possible gray values in it, and it's quite possible that the areas that look like black background could be hundreds of gray values above zero.  Also, how uniform are the dark areas? That will have a lot to say about our ability to find faint objects later.

So, first thing to do is take a histogram and see what we see.

Using the  Histogram_gray16() function from my v6 library, and a little gnuplot, we see this:


Which is perhaps not very helpful.

It does look as expected: a huge spike of pixel-count far to the left, because a picture of the night sky is always going to be mostly very dark pixels, and a nice even smattering of brighter pixels all across the rest of the range, because the myriad stars come in all brightnesses.

But let's zoom in on the dark pixels -- see what it will take to separate foreground from background reliably. See if we can do that while still finding very faint objects.

Tell gnuplot to only plot ... let's say the bottom 500 gray values, and we get this:


And that is a beautiful normal curve.

It's not all the way down at zero, because the dark sky is never perfectly dark, and this sensor is quite sensitive enough to pick up any kind of skyglow. 

Make a new tool in v6 to just list out the pixel values as ASCII, modify it to only list values at 300 or below, run those numbers through a statistics program, and we see that the mean of that curve is at 182 and its standard deviation is 29.

So I wonder: what if we were to threshold this image only 2 sigma above the mean of that dark-pixel distribution. That should leave only about 1% of the background pixels. Will that be thin enough?

Threshold at 240...

 


That looks really good.

Oh, and thanks for the satellite, Elon. You better bring me some good internet with those things, because they're going to be pretty hard on my astronomy hobby.

 

Let's zoom in on the central star...

 

Yes, that's glorious.

The 1% or so of background pixels that we let through are randomly scattered all over -- so if you see a substantial clump of them -- like we do right near the bottom of this image -- that has real good odds of being an actual object -- just very faint. And one which we would have lost if we had thresholded at 2.5 or 3 sigma.

 

We will never actually binarize the image, oh no, that would throw away practically all the lovely data. But this looks like a good way of deciding which pixels we can safely ignore.

 

 


Thursday, August 13, 2020

A New Career in a New World

 You don't normally think of finding a new career after the End of the World, unless maybe it's a career as a Road Warrior: a burnt-out shell of a man wandering out into the desolate wilderness with nothing but his Trans-Am, five gallons of gas, and a shotgun that doesn't work.

Or then again maybe that's exactly what I've done. Wasn't the Road Warrior fleeing a world that had crashed, and trying to get to a place where he could survive?

In a world where we can't go to restaurants anymore, or cafes, or bookstores -- I guess the bookstores were lost quite a long time ago, actually -- I have rediscovered a place where I can go, any time. Maybe I can be a Road Warrior after all -- but my road will be the Via Lactea.

 

 

 

I have rediscovered my old hobby of renting telescopes through the excellent service of iTelescope.net

And I have a new focus this time.  I do not only want to look for Very Faint Objects -- although that is still certainly interesting.  

Instead, I want to use these images to continue working toward what I have long imagined as Real Machine Vision. Start with just the stars and galaxies of deep space, and work my way to vision systems that could be useful for the automation of deep space asteroidal exploration and mining, and the deep space assembly of large structures.

We need a new type of image for this work -- we need COLOR!   So my new routine with iTelescope is to take three maximum exposures -- 10 minutes -- with the red filter, then the green, then the blue.

 

 



With the excellent sensor that my telescope uses, we get 16-bit grayscale images (They don't actually look like the three pretty images up there ^^^ -- that there is what you call artistic license. And then I will combine those three to make a single 48-bit-deep color image to use in my software.

 

 

 The glorious iTelescope PlaneWave instrument T11, It's better than a TransAm!

 

I've never used color in these images before -- seldom used it at all, in fact -- but I see now that if I want to do real vision out there in deep space -- so far away that a phone call to Houston takes half an hour just to get there -- then I had better take every bit of data I can get. The use of color in some visual processes might turn out to be crucial.

Also, I will be writing my code in the new programming language love of my life -- Go -- which is C for the Twenty-First Century. I've done many image processing and simple-vision libraries before, which is why this new one will be called V6.  

This is going to be fun.



 

 

 

Sunday, April 24, 2016

Building the TMT


So how are we going to build the Thousand Mile Telescope?  Once we get to the Kuiper Cliff, is there anything we can use?

We will do the usual thing, the same kind of procedure that we will use to build the rest of Solar Civilization: arrive with several general-purpose 'factories'.  Each factory is a system of machines that can:
  • mine asteroidal materials
  • refine the materials into useful forms
  • make solar arrays for power
  • reproduce themselves on a larger scale
  • build cramped, cold, uncomfortable habitats for the grad students
  • make the machines that will make the big mirrors.

 For the mirrors themselves, I propose using only three elements: silicon, oxygen, and aluminum.  The silicon and oxygen to be combined into SiO2 -- quartz -- that gets foamed into a volume much larger than it would be if solid, but still very rigid.  Probably a fractal kind of structure, like the inside of bones.  It it easy to foam stuff in zero-G because the bubbles don't try to rise.





Once you make the big low-mass, rigid disks, you use a polishing process that simultaneously creates a very slight paraboloid, and fuses the surface smooth.  Use a directed-energy thing, like those Martian death-rays.  The green ones.

To get optical smoothness you have large polishing machines crawling around the surface for a year or so, doing final polishing.  And finally the biggest vacuum-deposition gadgets ever made -- no need for a "chamber" -- to apply the aluminum coating over the entire surface of each disk, resulting in an optically-smooth aluminum coating a thousand Angstroms thick or so.





OK, maybe I don't know every last detail, but one must leave something for the engineers to figure out or they will become irritable and despondent.

One note about cleanliness.  The entire mining, refining, and manufacturing process must be kept clean.  Any waste that cannot be used should be at least well controlled, for example by packing it into containers.  The last thing we want is a cloud of unused gas and dust floating around the mirrors, and us hoping that it eventually blows away in the practically nonexistent light pressure.  We are making telescopes here, let's not simultaneously make smog around them.






How much material do we need?  Will there be enough?

Let's use enough SiO2 that, if it were solid, it would be a meter thick.  (It will actually be probably at least ten times thicker than that after foaming, but for those bubbles we will use whatever waste gas is handy.  Probably oxygen, there's gobs of that stuff.

So how much SIO2 do we need?

The total area of all the dishes is the same as a single 1000 mile dish, one meter thick.  500 mile radius is 804.5 Km radius, so the volume is

pi * ( 804500 m )^2 * 1 m 
== 2e12 m3
== 2e18 cm3
* 2.6 g cm-3 ~= 5e18 grams

We need 5e18 grams of SiO2.  Can we get it?

I think the Kuiper Belt probably has two distinct populations of objects in it: the fluffy ones and the stony ones.  The good ones for us are stony, like Pluto, which is maybe 70% stony stuff like rocky asteroids, and 30% water-ice.

Let's assume we can find more things like Pluto.  (Because I don't want to rip apart Pluto, just for old time's sake.)  What kind of composition will we find?





Silicon is always the limiting factor, because there's so much oxygen.  And that's without counting the water ice!  Silicon is about half of the mass that we need, so let's be generous and call it 3e18 grams.  And silicon is about one-fifth of the mass of the stony planetesimals in the Kuiper Belt, so we will need to process a total of about 15e18 grams of material total, assuming the worst case that it's all mixed together evenly.

How much rock is that?  Assuming (conservatively) a density of 2 grams per cm3, we need to process 8e18 cm3.  Or 8e12 m3.  Or 8e3 Km3.

That's a sphere 25 kilometers across.

That is not a very big rock.

It's smaller than the Earth.

( In each of these pictures, the two objects are shown in proper scale with each other.)

Earth and Moon


It's smaller than the moon.



Moon and Pluto

It's smaller than Pluto.


Pluto and Vesta


It's even smaller than Vesta.


Vesta and the TMT rock.

That's it -- the little thing to the right of Vesta.  That's the size of the rock we need to build the Thousand Mile Telescope.  It would just about make one of the larger craters on Vesta (which is the third-largest main-belt asteroid.)

In the Kuiper Belt, we are going to be able to find a zillion rocks this large.

And each time we find one, our machines and graduate students will go to work on it.


Mining a little rock.


And we'll start making dish-arrays out of it.



A Dish Array of the Thousand Mile Telescope



And I suppose we could make some habitats too.  Even grad students need someplace to live.



Sunday, April 17, 2016

Where to Put the Thousand Mile Telescope


But where can we put this monster?

Siting the Thousand-Mile Telescope is probably going to be non-trivial.  We can't just find some wasteland that nobody cares about -- for example New Jersey -- and cover that up.  The telescope is too big.  It has a surface area a little larger than Mexico.

And there are all kinds of problems even more serious if we locate dishes on the Earth's surface -- like gravity, wind, vast and immediate climate changes, disruption of the lithosphere with massive strip-mining to get the materials.  We would probably cause the deaths of a couple billion people, which seems likely to make the instrument unpopular with the survivors.  So -- not on the Earth.


Problems Likely at This Location


No, our dish-arrays really can't even be on the moon.  Still too much gravity to be able to maintain such large paraboloids -- which will also have to be extremely thin to avoid using inconceivable quantities of material.  Such big thin things would flatten out like a coat of spray-paint even in lunar gravity.



Getting colder, but still not cold enough.


No, it has to be in zero G.

But then that brings up another couple of problems.  First -- where are we going to get all this material?  Even with the disks being very thin, a thousand-mile disk uses a lot of mass.  If we have to boost it up out of a strong gravity well, we are doomed.

And second -- if we build them anywhere near the Sun -- well, we will basically be building the biggest sails in the history of the human species, and the wind from the sun will blow them away like little soap bubbles on a breeze.  We do not want to make these things just so we can watch them receding into the infinite distance.

No, we need a place where:
  • We can get lots of material with practically no gravity.
  • It's far enough from the Sun that light pressure is negligible.
As it happens -- I have just the place!  But we will need to zoom back a ways.



The size of the Sun in this picture, by the way, is to scale with the size of the orbits.  The Sun is very big, very powerful, very calm, very special.  Anybody who tells you that the Sun is an 'average star' has no faintest clue what they are talking about.


We need to get out past the orbit of the Earth, only 500 light-seconds away, where the intensity of Solar radiation is nearly a Kilowatt per square yard.






We need to keep going, out beyond Mars.







We might pause and think about the asteroids for a bit, but the sunlight is still too intense, and Jupiter keeps sweeping by cheerfully disrupting everything, throwing his big gravity field around and hurling hundred-mile lightning bolts in all directions.  It's like having a neighbor who plays loud music all night.







No, we have to get well away from mighty Jupiter.  There is a better place, but it's still far away.  Keep going out, while the light-minutes turn to light-hours.






Out past ringed Saturn and Uranus.

Look, I know it's going to be hard to get people to come out this far, but a lot of the work can be automated, and anyway there will always be astronomy grad students.


We keep going past the orbit of Neptune, the final planet we know about ...





Until at last we see it.  Five light hours from the Sun, the real asteroid belt of the Solar System -- the vast Kuiper Belt.

The Kuiper belt has zillions of little rocks and ice-balls, some of them ranging in size all the way up to that of Pluto.  In fact, Pluto is probably just a large and close-in Kuiper Belt object.  The belt has a total mass of 5% of the Earth or so -- which is a very great deal of mass which we will be very happy to get our hands on -- spread out over an area of four thousand square AUs -- 40 million trillion square miles.  So it's spread kind of thin.  But that's OK, we will find some decent-size chunks and go use those.


And specifically, we will go to a magical little band of the Kuiper Belt -- well, 'little' meaning only 100 million miles wide --




The 'Kuiper Cliff' -- a band where there are very few floating things, but which is right next to regions that are nice and thick with material we can use.

Here, we are 40 times farther from the Sun than is the Earth.  Solar radiation is 1600 times weaker.  Even on our gossamer dishes such weak wind will do next to nothing.

It's cold, it's dark, it's lonely.  Nobody who didn't already know exactly where to look would be able to find our little dishes in a million years.

It's perfect.


Sunday, April 10, 2016

The Thousand-Mile Telescope


Next week I will go back to talking about my algorithm, but right now it's snowing when it should be springtime, it's colder outside at this time of the year than it has been ever before in my life, and I think it's time for me to come out of the closet and tell you what I really want.

I want a Thousand-Mile Telescope.

Does that sound like an awfully long focal length for a telescope?  After all, the CDK700 I am using right now is only 15 feet.  Well, however bad it sounds the truth is a lot worse.  What I want is a telescope a thousand miles in diameter.

OK, so the first questions we should ask are Why Do You Want a Thousand-Mile Telescope?  And after that, How Can We Make a Thousand-Mile Telescope?


One Million Dishes in One Hundred Arrays.

Actually, these two questions are related, and I need to answer a little bit of the second question first.  We are going to build a Thousand-Mile Telescope by first making a One-Mile Telescope, and then making 999,999 more just like it.  A million One-Mile telescopes add up to have the surface area of a single Thousand-Mile Telescope. 

But!  What can we do with a telescope that's made of many separate mirrors?  There are two ways of combining the dishes so that they become a single instrument.  The easy way is to simply add the images together.  (We will need 40-bit per channel color images.  Heh heh.)   But that only gives us the light-gathering power of the TMT.  Not the resolving power.  Can we get the resolving power?

Yes, but we'll have to work at it a little.  We need a 2D array of dishes a thousand miles in diameter, constructed such that it is possible to know the location of each one-mile dish relative to the others to an accuracy of about 1/4 of a wavelength of violet light, or about 4 millionths of an inch.

Now we can't possibly do that with all million dishes, so what we'll do is we'll make an array like this:








That's a circular array 1000 miles across, containing ten thousand dishes.  Well, close enough.  (And only a few are shown, to give you the idea.)  The dishes are arranged on aluminum trusses that can move them precisely and measure their positions.  This array, with a little bit of computing power, can simulate the resolving power of a TMT.

So we make 100 of these, and add all the images together.  Boom!  You have both the resolving power and the light gathering power of a true TMT.


What Can It See?

The resolving power of a telescope, in radians, is 1.22 * wavelength / diameter.  The wavelength we care about is the worst case (longest) wavelength of visible light, which is red, which is 25 millionths of an inch -- 2.5e-7 inches.  Our diameter is 1000 miles, which is 6.3e7 inches.  1.22 * 2.5e-7 / 6.3e7 == 0.48e-14 radians -- call it 5e-15 radians.

At a radius of 1 light year, 1 radian is .. um .. 1 light year -- about 6e12 miles.  Multiply that by my 5e-15 radians and you get 30e-3, or 3e-2 miles.   So it's about 1 mile at 30 light years,  5 miles at 150 ly, and so on.

With this telescope, here is what our planet would look like at 1000 light years:

The Earth from 1000 light years with the Thousand Mile Telescope
 



Now it wouldn't really be all lit up like that, because ... um ... the Sun would be in the way.  But whatever you could see of the planet would have that level of detail.

And here it is from 25,000 light years -- the distance to the galactic center.


The Earth at the distance of the galactic center, with the TMT.


With the Thousand Mile Telescope, you can see half the galaxy well enough to know whether you would like to live there.

And over a distance of a thousand light years -- a volume containing 10 million star systems -- you can see planets well enough to see this:



Lights in the Night


That's why I want my Thousand-Mile Telescope.


Sunday, April 3, 2016

Taking the Halos out of the Heavens





OK!  So we have found the bright stars by using an automated thresholding routine, and we have gobbled them up with a region growing algorithm.  So where we now?

Here is what our example image looks like after having all the bright stars removed.


Bright Objects have Halos



Close, but no cigar.  The bright objects have halos around them, and these halos are themselves much brighter than the dim objects that I want to look at.

This is happening because we have only done region-growing on the pixels that were at the maximum brightness that this image could represent.  But those bright stars and galaxies don't just cut off at 255 in this images.  They fade and fade and fade into the darkness.  Halos.

OK, so here's what we do.  We use our knowledge of where the bright regions are, and knowledge of what the dark image looks like, to get rid of those halos.

We will take a statistic of all the pixels in the image remaining after removing the bright regions.  Then, for each bright region, we will grow its perimeter as a separate region.



Finding the Perimeters of Bright Regions


It's easy to get these perimeters: for every pixel in the bright region, check its neighbors.  If any of them are not in the region -- add them to the perimeter region.  (I suppose that is not the most efficient possible method for large regions.  Exercise for the interested reader.  Or for me if I ever get to do this with a Big Telescope.  An actual perimeter-following algorithm is almost as easy as what I did here.)

Now the fun part.  We have the statistic for the dark image (image with bright regions removed.)  So look at the average pixel value of that perimeter.  If it is more than N standard deviations above the dark-image mean (I think I chose N==1.)  then the perimeter is 'bright'.  Add it to the region.

So we iterate, finding new perimeters and adding them to the regions until the perimeters are not significantly brighter than the dark images anymore.

Here's our image after 5 such iterations:






and after 10.  (Some objects stopped growing a while ago.)






When all regions have stopped growing, we have eliminated all the bright halos!

Here is what our image looks like now:





That is beautiful.   At last we have an image of just the dark stuff.  All the bright stars removed, including their halos.


And now we can threshold this image, and find the bright regions in it.

At last we can detect all of the objects that were really faint in the original image.


The Faint Objects


We are now only a couple steps away from paydirt: the detection of moving faint objects.