Help - Search - Members - Calendar
Full Version: Decoding MER image filenames
Unmanned Spaceflight.com > Mars & Missions > MER > Tech, General and Imagery
Tman
For two weeks I'm newly playing around with javascript. smile.gif

Though it's old hat and I have already something else to get the sols, I've written two scripts with a small HTML file for decoding the MER image filenames - just for fun.

If you like here the links of them:

Edited: http://www.greuti.ch/oppy/html/filenames_ltst.htm
ElkGroveDan
Hey now that's really cool. Don't suppose you can put them both on the same page?
Tman
You're right, that's more comfortable.

For the script it makes only little difference (surprisingly).
So there was still time to improve it a little with more information options.

Edited: http://www.greuti.ch/oppy/html/filenames_ltst.htm
Floyd
That's great. For the Pancam maybe your script could decode the filter to a wavelength?
Ant103
... or better : into a hexadecimal color code? Is it possible huh.gif

Also, it's a very usefull tool that I bookmarked wink.gif
Tman
QUOTE (Floyd @ Jul 25 2007, 12:56 PM) *
That's great. For the Pancam maybe your script could decode the filter to a wavelength?

Do you mean such as L2 = 753nm ? That information is already there. When you moving your mouse over "Camera Filter (Left or Right)" it should appear an additional window.
djellison
QUOTE (Ant103 @ Jul 25 2007, 12:01 PM) *
... or better : into a hexadecimal color code? Is it possible huh.gif


Sort of :
http://www.ominous-valve.com/pancam.html

Doug
Ant103
Okay, thanks Doug. wink.gif
I've also found this, if anybody knows it : http://www.efg2.com/Lab/ScienceAndEngineering/Spectra.htm
There is a software who permit to convert a wavelength into a bitmap picture. Very interesting smile.gif (now, it's time to rebuilt new filter pictures and try with its).
ElkGroveDan
QUOTE (djellison @ Jul 25 2007, 05:55 AM) *


Wish I had that before I met you guys. I could never place the actual location of those filter wavelengths in the spectrum without looking them up. Now I don't need to because folks here do the things with the color (or colour) images far more efficiently than I ever had the time to perfect.

Once you turn forty and acquire more patience, you learn that if you wait long enough an impatient person in their 20s will take up the difficult chores soon enough. biggrin.gif
djellison
That's OK - I turn 30 next year smile.gif

Doug
elakdawalla
Tman, this is really useful. Would it be possible for you to also include a conversion to the UTC date and time the image was taken? I am always having to convert between sol numbers and UTC dates and times.

--Emily
fredk
This is very nice, Tman. I would add a request that the local solar time be included, as well. I'm often checking whether images on different sols were taken at similar local times. Some details on how this was done with the utility rawid are in this thread.

The rawid utility already gives all this information. But what caught my attention here is that this is coded in javascript. If I had javascript sol and local time code, I could easily write a bookmarklet to quickly get that info from a filename. And, far better still, I could easily write a Proxomitron filter to automatically add time of sol info to each thumbnail on the jpl mer thumbnail pages, and also to add sol and time columns to the exploratorium image pages. In fact, with your sol code I already have what I need to add sol columns to exploratorium. Do you mind if I use your javascript code for this, Tman? I'm drooling at the thought of this...
Tman
QUOTE (elakdawalla @ Jul 26 2007, 06:49 PM) *
Tman, this is really useful. Would it be possible for you to also include a conversion to the UTC date and time the image was taken?

At the moment I'm not in the know for such an extension. Currently I've tried to show the Local Solar Time too here , but my LST for all images/sols is 10 minutes behind the time in MMB for Spirit and 13 minutes for Oppy :-) don't know why. Additionally our both times are increasing different to the LST as shown in the first ~1000 Rover raw images on the MER site - up to more than one hour. So I'm currently rather in two minds about. I think/remember it was discussed about the mission times already here in the forum - but where?

The dates are not dependent on these differences, but I'm not in the know how to calculate it in the script for each sol in the past and future. The spacecraft clocks (seconds) started in January 1, 2000 at 11:58:55.816 UTC and Mars's days are 2375,244 seconds longer than Earth's.
Tman
Fred, I don't mind. It's nice if it's already so useful.
Indian3000
a part of code which I had already written for me smile.gif

it's little beta version smile.gif

http://www.marsrovercenter.com/filename_decoder.aspx
jaredGalen
QUOTE (Indian3000 @ Jul 27 2007, 12:27 PM) *
a part of code which I had already written for me smile.gif


Uh oh...... blink.gif

Source Error:

CODE
Line 1:  <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>
Line 2:  
Line 3:  <%@ Register Assembly="DevExpress.Web.ASPxDataControls.v6.1, Version=6.1.4.0, Culture=neutral, PublicKeyToken=79868b8147b5eae4"
Line 4:      Namespace="DevExpress.Web.ASPxDataControls" TagPrefix="dxwdc" %>
Line 5:
Indian3000
Error fixed smile.gif
Tman
Nice Indian!

I feel happy about our agreement on the local solar time biggrin.gif

Regarding writing in javascript the acquisition time and date on Earth in UTC. I'm on the way too. It works (of course) too with the (milli)seconds since 1. Januar 1970, 0:00 Uhr UTC.
Tman
Here my complete version with LST on Mars and UTC time and date on Earth.

http://www.greuti.ch/oppy/html/filenames.htm

First I was confused about differences between our versions during daylight saving time / summertime, but in the meantime I'm rather sure my version shows simply the acquisition time on Earth in UTC time, independent from the individual clock change on the computers. As far as I know my script works only with the UTC seconds since 01.01.1970.
ElkGroveDan
It's been a while since anyone handed out a Mars Bar here. But I think you deserve one for this, Tman

Tman
Wow, thanks Dan! biggrin.gif
Tman
QUOTE
...I found the point in my script where the difference is caused.

...And finally the solution. Now the script should it calculate correctly too.

http://www.greuti.ch/oppy/html/filenames.htm
Reckless
Thank you Tman that is so helpful every time I needed that info in the past (which was quite often) I used a pencil and paper. Even then I settled for "near enough" on the time and date.
biggrin.gif
Roy F
Tman
Wish I had the skill to implement these caculations in my script too sad.gif
http://www.giss.nasa.gov/tools/mars24/help/algorithm.html

Local true solar time (LTST) for both locations and any mission seconds when the images were taken would be really cool!

However, our "local solar times" are no more than for fun, (among other things) because of http://www.giss.nasa.gov/research/briefs/allison_02/.
Tman
Here my first local "true" solar timing version (hope it's error free):

http://www.greuti.ch/oppy/html/filenames_ltst.htm

Thanks to a Perl script sample from helvick (he translated those calculations already into Perl), I could get over some difficulties by translation it into Javascript. Though it may still lack a step or two for more accuracy, it comes already rather "close" to the Local-True-Solar-Times in MER Analyst's Notebook - especially by Oppy, and to the Mars24 Sunclock itself (here currently within 1-2 minutes).

Additionally I implemented the Rovers' current times, and the longitudes (which are adjustable).
Tman
After adding the "leap seconds" from Jan. 1, 2006 (pos. A-4), the two clocks for the current LTST now run simultaneous to the Mars24 Sunclock LTST.
Tman
Don't know if it's in use occasionally by others at all, but I've noticed currently a few error requests for "greuti.ch/oppy/html/filenames.htm". I removed this version since the local true solar time version is more accurate - this week I added yet a listing for the decoded filenames http://www.greuti.ch/oppy/html/filenames_ltst.htm
Tman
Does someone feel like helping me on following problem?

I've tried to extend the filename decoding like this http://www.greuti.ch/oppy/html/rawimages_a...ames_decode.htm

I've in mind to enable looking at any images by selected date and parameters. Currently it doesn't work that way - only with given dates and (four) images, and thus given the other parameters yet) - because of the impossibility to readout directly in JavaScript the Exploratorium sites source codes such as http://qt.exploratorium.edu/mars/opportuni...cam/2008-06-22/
Also I'm not able to get it via a PHP code because my Hosting-Provider has disabled for security reasons the functions like this http://de3.php.net/manual/de/function.file-get-contents.php to read out external source codes (probably as the most providers too). And currently other languages aren't available to me (neither physically nor intellectually).

Now my (slight/pious hope) query is, if it's possible at all: Has someone already written (or would feel like programming) such a readout code in a capable language and would she/he lend it and give (a little) help to implement it along with my JS code? The aim would be to start this readout code along with the selected Exploratorium site/parameters and read out finally the strings like "1N267294587EFF90B0P1980L0M1.JPG" into an array within the JS code.

smile.gif The help would be noted in the JS code or at desire.
vk3ukf
QUOTE (Tman @ Jul 6 2008, 01:38 PM) *
Does someone feel like helping me on following problem?


Hi Tman, if there is anything in the source code for MERDAT, you are welcome to it my friend.

I am placing it online at the request of several MS members.

It was written using Borland Delphi 7, coding is a pascal variant.

I am familiar with basic, procol, forth and pascal, not much else I am afraid.

To see the actual code as text, rename the *.pas files as *.txt and wander around.

Hoping there is something in there you can sink your teeth into. It is a 9.34 MB download.

http://www.vk3ukf.com/vk3ukf_files/MERsrc/...odeJuly2008.zip

It is about 95% complete, I still need to go around and mark some things that need a tidy up, and just started to put Phoenix thought into it, back to 90% complete.

Is any software ever finished?

Any code comments that give the impression of banging ones head on the keyboard due to lack of knowledge, are in fact, exactly that.

MERDAT is now officially in the public domain.

All the best, Kevin.
Tman
Hi Kevin,

Nice and extensive program that you've written!
But whew! There are many of those *.pas files. Which of them would you recommend?
And then I have probably no clue how I could "it" let run along with my JavaScript smile.gif

Anyway Thanks!
vk3ukf
QUOTE (Tman @ Jul 14 2008, 12:39 PM) *
Hi Kevin,

Nice and extensive program that you've written!
But whew! There are many of those *.pas files. Which of them would you recommend?
And then I have probably no clue how I could "it" let run along with my JavaScript smile.gif

Anyway Thanks!


Hi Tman, yeah there is a few, this file has most of the interesting code in it.

MerViewer20071Unit1.pas

This is the code for the main view page, this does the dates etc.

If you see codes for buttons e.g.
Button3.Click; may be mentioned as doing some feature, say for example clicking on button 3 will show page 4, such code as,
Form4.Show;
Look for the file ending in ***Unit4.pas and the appropriate code will be in there.
I tried to name the *.pas files for what they did, a couple got mucked up.

So, the command Form4.Show; will display the 4th page created which has some name ending in Unit4.pas, the UnitX.pas at the end really helps during wandering while trying to match statements.

Program pages are in fact called by statements such as Form9.Show;
Which will show the 9th page I made.
Which will have a *.pas name ending in ****Unit9.pas or ****Unit20079.pas

Last year I put the actual year into some of the filenames, so if you see e.g. PageFunctionNameUnit200735.pas, remove the 2007 bit in your mind, it is really PageFunctionNameUnit35.pas or page 35.

I know what you mean when getting into other languages, I'm there when I look at Java.
I've had a little success myself in playing around a tad with Java, but my candle is dim.

Just ask Tman, I'll do my best.

Java and other high level languages can usually be interpreted fairly well, they are not too disimilar.

Me changing file naming protocols midstream is another thing that needs to be rectified, this happened after a crash and recovery.

All I was concerned about at the time was getting it all to compile, again.

If there is some thing in the executable you were interested in, ask, and I'll point you to the page with the relevant code in it.

Kevin.

P.S. the executable in the download has a visible Phoenix button at the lower right, not yet fully functional, but will be invisible once auto spacecraft ID is implemented using the filenames.

P.P.S. any comments or non functional code that is ignored by the compiler begins with a double forward slash //

Here is a list of the units used by Form 1, the main page.

StereoUnit20072, TimeVariablesUnit20073, WebLinksUnit20074, VK3UKFCalendarUnit20075,
TraverseMapsUnit20076, FullSizeUnit20077, DataDecodeUnit200710,
StereoManualSelectUnit200711, MoreInfoUnit200712, MSTspUnit200713, OtherTravUnit20078,
SpiritTravUnit20079, ClosingCreditsUnit200715, SldShwDlyUnit200716, FullSizeImageUnit200717,
HelpUnit200718, ColourUnit200719, ColourAltUnit200720, SunsetUnit200721, WorkPadUnit200722,
SOLsearchUnit200723, BirthdaySearchUnit200714, RegistrationUnit200729, TestingUnit200730,
MsgUnit200731, MarsLnksUnit200724, UnitREG200732, MarsWebLnxUnit200734,
SolrSysLnxUnit200735, MeteoritesLnxUnit200736, HAMLnxUnit200737,
ParticipateUnit200738, AVIUnit200740, Mag2007Unit42, ClipboardSeeUnit43,
Watermark2007Unit44, KlingonLnxUnit200739, GIFImage, GraphicsConversionsLibrary,
MagnifierB200746, EmailUnit48, NoMoreImagesMsgUnit49, NoPixUnit50,
AVIresForm2007Unit45, ErrorLogUnit51;
Tman
"At last" added the solar elevation and azimuth (north=0°) for the current sol time and the decoded file name code.



Tman
smile.gif Call me crazy, but it looks like I've made it to calculate equal LTST outputs from the filename code in comparison to the official (from sol 1420 up so far - probably for good). The clocks seem to be failing about a second per sol now - Oppy less than Spirit. But it would be great to get at any one time a tip when they have to do another larger leap.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.