Scale of APOD pictures

Comments and questions about the APOD on the main view screen.
Post Reply
Doug Buchanan
Asternaut
Posts: 2
Joined: Wed Feb 27, 2008 7:24 am
Location: Fairbanks Alaska
Contact:

Scale of APOD pictures

Post by Doug Buchanan » Wed Feb 27, 2008 7:58 am

I enjoy APOD without clutter, for the superlative beauty.

I also perceive that the single greatest data transfer from these type pictures might be a picture representation of the scale of the picture. The light year size reference in words does not effectively transfer data for a perception based on a picture. Different parts of the brain are used, and are notorious for poor communication.

I was wondering if anyone capable of doing so, and if possible, would be interested in making separate web pages of one, some or most of the grand APOD pictures, with a reasonable overlay scale image, perhaps in a corner, that might cause a mind to recognize the size from a somewhat more comprehendable image, such as our solar system diameter. Even a circled single pixel light with a comment of that pixel representing X number of solar system diameters would be useful to a mind trying to synthesize scale data from a picture.

This may not be practical or possible for a reason within my current inability to fully recognize the scale differences between my back yard and some of the nebula, but I have not encountered a description of the related concept.

Thank you. And keep on having fun.

Doug
May you learn the most knowledge of the most concepts, most efficiently.

User avatar
emc
Equine Locutionist
Posts: 1307
Joined: Tue Jul 17, 2007 12:15 pm
AKA: Bear
Location: Ed’s World
Contact:

Post by emc » Wed Feb 27, 2008 12:41 pm

What a cool idea! Better be careful though... I learned a long time ago that when you come up with good ideas you often get assigned the implementation task! :wink:

Very entertaining and well written post!
Ed
Casting Art to the Net
Sometimes the best path is a new one.

henk21cm
Science Officer
Posts: 225
Joined: Mon Feb 04, 2008 9:47 pm
Location: The Netherlands

Add a scale to an apod

Post by henk21cm » Wed Feb 27, 2008 3:08 pm

Doug, a simple script in Matlab, in order to add a scale bar to an image.
  • 1) Save the apod picture with your browser on your local disk
    2) Start Matlab
    3) Run the script
    4) Answer the questions
It will display the image with a scale bar.

The code is below. It isn't rocket science, neither very elegant, it works for me. It might work for you, no claims please.

Code: Select all

function apod
%   Read your image to be provided with a scale
[filename, filepath] = uigetfile('*.jpg', 'Get your APOD picture');
image_read = imread([filepath filename]);

%   Prompt the user for the scale
prompts = {'Length scale as in kPc, AU or km', ...
    'Number of pixels for the same length scale'};
result = inputdlg(prompts, 'Provide a scale', 1, {'100 km', '90'});
%   Some error handling
if isempty(result)
    msgbox('No data, no scalefactor');
    return;
end
%   Convert to double
scalefactor = floor(str2double(result{2}));

%   Size of the image
s = size(image_read);

%   Determine the right lower corner
lrs = s(2)- 19 - scalefactor;
lre = s(2)- 20;
lv = s(1) - 40;

%   Add a scale bar in white
image_read(lv:lv+2, lrs:lre, 1) = uint8(ones(3,scalefactor)*255); 
image_read(lv:lv+2, lrs:lre, 2) = uint8(ones(3,scalefactor)*255); 
image_read(lv:lv+2, lrs:lre, 3) = uint8(ones(3,scalefactor)*255); 

%   Add a scale bar in black
lv = lv+3;
image_read(lv:lv+2, lrs:lre, 1) = uint8(zeros(3,scalefactor)); 
image_read(lv:lv+2, lrs:lre, 2) = uint8(zeros(3,scalefactor)); 
image_read(lv:lv+2, lrs:lre, 3) = uint8(zeros(3,scalefactor)); 

%   Open a figure and display the apod
figure(1);
image(image_read);

%   Add the length scale
t = text(lrs, lv-20, result{1});
set(t, 'color', [1 1 1]);       % White
t = text(lrs, lv+20, result{1});
set(t, 'color', [0 0 0]);       % Black

%   Remove non relevant info, display a circle as a circle
set(gca, 'visible', 'off', 'dataaspectratio', [1 1 1]);

return;
I tested the script with an apod of mimas, both normal as negative.
Regards,
 Henk
21 cm: the universal wavelength of hydrogen

User avatar
emc
Equine Locutionist
Posts: 1307
Joined: Tue Jul 17, 2007 12:15 pm
AKA: Bear
Location: Ed’s World
Contact:

Post by emc » Thu Feb 28, 2008 5:49 pm

Ed
Casting Art to the Net
Sometimes the best path is a new one.

Doug Buchanan
Asternaut
Posts: 2
Joined: Wed Feb 27, 2008 7:24 am
Location: Fairbanks Alaska
Contact:

Post by Doug Buchanan » Thu Feb 28, 2008 9:15 pm

Imagine my amusement and what I learned again.

Elsewhere I offer individuals and institutions verifiably manifestable solutions to inordinately complex human-caused contradictions (social problems). World peace? Too easy. No government could escape.

I use plain English, with no technical terms. But no one, especially in peace organizations and governments, has ever been able to understand the knowledge I offer them, for a reason I recognize. Among other things, they lack the knowledge of how to use words that hold their meanings, and thus do not understand their utility.

So when Henk graciously offers the solution to my request, I am unable to utilize it because of my ignorance of the words he uses. Having been using a computer since 94, and having a couple dozen websites I maintain, I still do not know what a Matlab is, where to find it (I tried), or how to start it. I do not know what a script is, or how to run it. I do not know what to do with the code he offered. I laughed. If Henk reads this, he will laugh at such ignorance.

Then Ed Caldwell sent a stumbleupon link with an image of Earth that remained only an image of Earth, despite a printed suggestion that it apparently contained something more.

I appreciate their assistance. While I did not learn what they may have intended, I learned much, again.

That which precludes the openly known solutions from being applied to identified problems, is the additional knowledge of how to apply them, also available but either not conveyed or not learned for an additional reason.

Until we get USB ports in craniums, and a universal cranial Unix operating system, the multi-definitional words we invented for data transfer keep the humans yet deep in their intellectual dark ages, much to the amusement of the observers.

Are not these humans the best comedy on the rock?

I will continue to apply the APOD universal scale: "Vast".

Doug
May you learn the most knowledge of the most concepts, most efficiently.

User avatar
bystander
Apathetic Retiree
Posts: 21577
Joined: Mon Aug 28, 2006 2:06 pm
Location: Oklahoma

Post by bystander » Thu Feb 28, 2008 10:17 pm

http://www.mathworks.com/products/matlab/

Don't know why Ed's link didn't work for you. It is a kewl escalation of star sizes. Thanks ed
Know the quiet place within your heart and touch the rainbow of possibility; be
alive to the gentle breeze of communication, and please stop being such a jerk.
— Garrison Keillor

Chris Barry
Asternaut
Posts: 1
Joined: Mon Mar 03, 2008 4:54 pm
Location: Perrysburg, Ohio

Scales needed for almost all APODs

Post by Chris Barry » Mon Mar 03, 2008 5:23 pm

Great picture of Barchan Sand Dunes. An included scale, or note in the text, would leave me more time to wonder about the processes. (I did find a scale (cm / pixel!) by searching deeper).
Many thanks for so many great images.
Chris Barry

henk21cm
Science Officer
Posts: 225
Joined: Mon Feb 04, 2008 9:47 pm
Location: The Netherlands

Post by henk21cm » Mon Mar 03, 2008 6:21 pm

Doug Buchanan wrote: So when Henk graciously offers the solution to my request, I am unable to utilize it because of my ignorance of the words he uses. Having been using a computer since 94, and having a couple dozen websites I maintain, I still do not know what a Matlab is, where to find it (I tried), or how to start it. I do not know what a script is, or how to run it. I do not know what to do with the code he offered. I laughed. If Henk reads this, he will laugh at such ignorance.


Wrong, i never laugh at people, i laugh with people.

FYI: Matlab is a computer language, out there since 1984. It resembles C, and a few other languages, however it has many integrated functions, dealing with matrices, images etc. It is expensive -too expensive- just for this particular solution. There must be an easier way, however that takes a lot more of programming. A script is a sequence of Matlab statements, a program written in the Matlab language. You run a script, when you have started Matlab, by typing its name. There are Matlab versions for Linux, Mac and Windows. The script itself is -just like any programming language-independent of the OS you choose, the Matlab you are using must be matched to your OS.

The good new is that the script can be compiled into a Windows executable. In order to run the executable, you will need a runtime engine of about 350 MB (zipped). There is no way to post such an amount of files at this forum or send it to you via e-mail. That's the catch.

An alternative is to write the same program under Linux. There is a jpg lib, that will run under Linux. The disadvantage is that writing such a program takes a week, whereas the Matlab script took me a quarter of an hour. Not to mention when you do not use Linux...
Regards,
 Henk
21 cm: the universal wavelength of hydrogen

Delysid23
Ensign
Posts: 10
Joined: Tue Jul 24, 2007 8:39 am
Location: Vancouver, BC, Canada

Re: Scales needed for almost all APODs

Post by Delysid23 » Mon Mar 03, 2008 6:32 pm

Chris Barry wrote:Great picture of Barchan Sand Dunes. An included scale, or note in the text, would leave me more time to wonder about the processes. (I did find a scale (cm / pixel!) by searching deeper).
Many thanks for so many great images.
Seeking, or suggesting the need for an indication of, the scale of the Martian dune picture:

http://antwrp.gsfc.nasa.gov/apod/ap080303.html

was also what prompted me to visit the APOD forum today.

So where did you find that cm/pixel scale for this remarkable picture of Martian dunes sublimating CO2, Chris Barry, and what were the cm/pixel values?

Post Reply