Curiosity Image Retrieval Tools, scripts and software |
Curiosity Image Retrieval Tools, scripts and software |
Aug 11 2012, 09:18 AM
Post
#1
|
|
Member Group: Members Posts: 270 Joined: 29-December 04 From: NLA0: Member No.: 133 |
I wrote a shell script that allows you to download all images from a given sol.:
http://paranoid.dechengst.nl/files/MSLget.sh There are two rm commands in the script to clean up the tempdir. If you're afraid my script screws up your system replace them with rm -i commands. If you want any features added please let me know and I'll see what I can do. EDIT1: Added leading zeros in the directory names for easy sorting after a request for it on IRC. EDIT2: I see a lot of people downloading the script. To be clear: This is a script for *NIX systems and won't run on a standard Windows box. To get it running under Windows you need to install a *NIX environment like Cygwin. Your other option would be to install something like Ubuntu in VirtualBox. EDIT3: As RoverDriver pointed out you need to have wget on your system to use this script. The script now handles this gracefully. -------------------- PDP, VAX and Alpha fanatic ; HP-Compaq is the Satan! ; Let us pray daily while facing Maynard! ; Life starts at 150 km/h ;
|
|
|
Aug 17 2012, 03:59 AM
Post
#2
|
|
Newbie Group: Members Posts: 11 Joined: 12-August 12 Member No.: 6550 |
First post. Here's a small script I wrote to automatically process left and right full frame Navcam image pairs into SBS stereoscopic images. Thanks go to jmknapp for his image list service, http://curiositymsl.com. I originally intended to automate the full process, from downloading the images to creating the final SBS output, but then I realized that I may want to process the images a bit before the final step. I use the free StereoPhoto Maker to create the final images. It's a windows app which is why I chose to write this in AutoIt (also free).
BTW, the images are PHENOMENAL when viewed with the Sony HMZ-T1. I purchased this hardware a few months ago in anticipation of this mission (and other 3D applications), and I've been extremely pleased with the quality of the high contrast dual OLED displays, which present a ghost-free stereo image. CODE #include <file.au3> ; for _filereadtoarray
#include <Array.au3> ; for _arraydisplay ; 20120816, version 0.1 ; This script processes all full frame Navcam images using jmknapp's http://curiositymsl.com, downloads only full frame LR pairs (if not downloaded already) and creates a StereoPhoto script file ; (todo) Also process Mastcam images ; 3d_mars ; prompt user for sol number to retrieve, $sol Local $sol = InputBox("Sol Number", "Input Sol Number:") If @error Then Exit ; create temp file for listing all URLs for a given sol ; example: c:\users\username\appdata\local\temp\URLs_sol_1.txt $URL_list_file=@TempDir & "\URLs_sol_" & $sol & ".txt" ; download image URL list to text file ; InetGet option syntax: URL, filename, 1=force reload, 0=wait for download InetGet("http://curiositymsl.com/cgi-bin/getfiles.cgi?sol=" & $sol, $URL_list_file,1,0) ; read URL list and import to array ; note: $allURLs[0] contains the number of records read into the array. Local $allURLs If Not _FileReadToArray($URL_list_file, $allURLs) Then MsgBox(4096, "Error", " Error importing from file to Array error:" & @error) Exit EndIf ; search for Navcam full frames (*EDR_F*) insert into new array $allframes ; Navcam full frame example URLs: ; http://mars.jpl.nasa.gov/msl-raw-images/pr...AUT_04096M_.JPG ; http://mars.jpl.nasa.gov/msl-raw-images/pr...AUT_04096M_.JPG ; declare large array instead of resizing array multiple times, uses very little RAM Local $allframes[9999]=[0] $x = 1 For $URL in $allURLs ;check for Navcam full frame If StringInStr($URL,"EDR_F") Then $allframes[$x]=$URL $x += 1 EndIf Next ;record total number of frames $allframes[0]=$x - 1 ; read allframes to find matching left/right pairs ; insert into new arrays $leftframe_Nav, $rightframe_Nav Local $leftframe_Nav[9999]=[0] Local $rightframe_Nav[9999]=[0] Local $leftframe_counter = 0 Local $rightframe_counter = 0 For $x = 1 to $allframes[0] If StringInStr($allframes[$x],"NLA_") Then ;left frame found, store in $leftframe_Nav array $leftframe_counter += 1 $leftframe_Nav[$leftframe_counter]=$allframes[$x] $leftframe_Nav[0]=$leftframe_counter ElseIf StringInStr($allframes[$x],"NRA_") Then ;right frame found, store in $rightframe_Nav array $rightframe_counter += 1 $rightframe_Nav[$rightframe_counter]=$allframes[$x] $rightframe_Nav[0]=$rightframe_counter EndIf Next ; if no left full frames then abort and exit If $leftframe_counter == 0 Then MsgBox(0, "", "No Navcam full frames found") Exit EndIf ;choose path and file name for images and generated StereoPhoto Maker script file Local $MyDocsFolder = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}" Local $StereoPhoto_script_file = FileSaveDialog("Choose a path and filename for images and StereoPhoto Maker script file:", $MyDocsFolder, "Text Files (*.txt)", 2, "navcam_sbs_sol_" & $sol & ".txt") ; option 2 = dialog remains until valid path/file selected If @error Then MsgBox(4096, "", "Save cancelled.") EndIf ; using lists of left and right frames, find matches and save output Local $right_matching_frame_number[9999]=[0] Local $StereoPhoto_script_lines[9999]=[0] Local $URL_left_temp, $left_image_file_name, $URL_right_temp, $right_image_file_name, $left_image_full_path, $right_image_full_path For $x = 1 to $leftframe_Nav[0] ;extract frame number $leftframe_image_number=StringMid($leftframe_Nav[$x],StringInStr($leftframe_Nav[$x],"NLA_")+4,9) ; returns -1 if no match found $right_matching_frame_number[$x] = _ArraySearch($rightframe_Nav, $leftframe_image_number, 0, 0, 0, 1) ; download left and right images If $right_matching_frame_number[$x] <> -1 Then ; find the file names $URL_left_temp = StringSplit($leftframe_Nav[$x], "/") $left_image_file_name = $URL_left_temp[UBound($URL_left_temp)-1] $URL_right_temp = StringSplit($rightframe_Nav[$right_matching_frame_number[$x]], "/") $right_image_file_name = $URL_right_temp[UBound($URL_right_temp)-1] ; create full path names $left_image_full_path=@WorkingDir & "\" & $left_image_file_name $right_image_full_path=@WorkingDir & "\" & $right_image_file_name ; build array for StereoPhoto Maker script file $StereoPhoto_script_lines[$x]="21,0,0,0,0," & $left_image_full_path & "," & $right_image_full_path & ",," ; download the images ; if the file already exists don't download it again If Not FileExists($left_image_full_path) Then InetGet($leftframe_Nav[$x],$left_image_full_path,1,0) EndIf If Not FileExists($right_image_full_path) Then InetGet($rightframe_Nav[$right_matching_frame_number[$x]],$right_image_full_path,1,0) EndIf EndIf Next ; write StereoPhoto Maker script file Local $hFile = FileOpen($StereoPhoto_script_file, 2) ; 2 = erase previous _FileWriteFromArray($StereoPhoto_script_file, $StereoPhoto_script_lines, 1) ; 1 = index to start FileClose($hFile) ; open StereoPhoto Maker, select File menu, select multi conversion from list... |
|
|
Aug 17 2012, 01:36 PM
Post
#3
|
|
Senior Member Group: Members Posts: 1465 Joined: 9-February 04 From: Columbus OH USA Member No.: 13 |
First post. Here's a small script I wrote to automatically process left and right full frame Navcam image pairs into SBS stereoscopic images. I had to look up what SBS stereo is (but hey, I can't even find my red-blue glasses to see some of the probably amazing anaglyph efforts here). So I take it that you need to have some expensive headgear like the Sony you mentioned to view them ($800) or at least shutter glasses and a special monitor? I wonder what the cheapest entry point is. -------------------- |
|
|
Aug 17 2012, 02:07 PM
Post
#4
|
|
Senior Member Group: Members Posts: 4247 Joined: 17-January 05 Member No.: 152 |
So I take it that you need to have some expensive headgear Not at all! Using StereoPhoto Maker that 3d_mars linked to, you can view side-by-side images without any special hardware or glasses at all. StereoPhoto Maker displays the L and R images side by side, but only displaying a vertical strip wide enough to merge by crossing (or diverging) your eyes. You can then easily pan to see the entire image.
|
|
|
Lo-Fi Version | Time is now: 30th May 2024 - 01:32 AM |
RULES AND GUIDELINES Please read the Forum Rules and Guidelines before posting. IMAGE COPYRIGHT |
OPINIONS AND MODERATION Opinions expressed on UnmannedSpaceflight.com are those of the individual posters and do not necessarily reflect the opinions of UnmannedSpaceflight.com or The Planetary Society. The all-volunteer UnmannedSpaceflight.com moderation team is wholly independent of The Planetary Society. The Planetary Society has no influence over decisions made by the UnmannedSpaceflight.com moderators. |
SUPPORT THE FORUM Unmannedspaceflight.com is funded by the Planetary Society. Please consider supporting our work and many other projects by donating to the Society or becoming a member. |