IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
need help. how to uncompress .img files from magellan
ncc1701d
post Jan 6 2011, 11:33 PM
Post #1


Junior Member
**

Group: Members
Posts: 91
Joined: 21-August 06
Member No.: 1063



Hoping someone can help.
I am trying to uncompress the FMAP .img files which are part of magellans images of venus so I can use a converter program to convert them from sinusodal to cylindrical mapping.

Things I do know is that I can just rename .img to .raw and open in photosho however the converter program newmap.exe which is an old dos program that is provided with the FMAP images requires I think the uncompressed .img files in order to convert sinusodal to cylindrical. I know the .raw didnt work. And I get error saying my .img files are compressed so it wont work.
I know .img files are not cd or dvd image file or so I think becuase I could not open them in MagicISO If they were CD images I would think MagicISO would work but I may be wrong though.
Anyone familiar with what I am trying to do. Any image processing guys out their do this with the magellan FMAPS?
I figure the experts would be here.
thanks
Go to the top of the page
 
+Quote Post
djellison
post Jan 6 2011, 11:39 PM
Post #2


Founder
****

Group: Chairman
Posts: 14431
Joined: 8-February 04
Member No.: 1



URL to the files in question?
Go to the top of the page
 
+Quote Post
Phil Stooke
post Jan 6 2011, 11:44 PM
Post #3


Solar System Cartographer
****

Group: Members
Posts: 10127
Joined: 5-April 05
From: Canada
Member No.: 227



.img files are not compressed, they are basically tiff-like files with a different header which can be opened in Photoshop as raw images if you know the pixel dimensions (which are given in the label). You probably knew that anyway.

But there are also .imq files which are compressed versions of the .img images. Those have to be treated differently - if you are getting the .img files from the old PDS cd-roms there might be a utility on the disk. I used to deal with those files all the time (and still have probably well over a hundred of the cd-roms collecting dust), but it's been so long I can't remember the details of it now.

It's possible your software just doesn't recognize the PDS .img format and simply thinks it is compressed when it isn't. If the software needs tiffs, for instance, you might have to open in Photoshop and save as a tiff.

We could really use a good clickable map interface to the various levels of Magellan products, too!

Phil


--------------------
... because the Solar System ain't gonna map itself.

Also to be found posting similar content on https://mastodon.social/@PhilStooke
NOTE: everything created by me which I post on UMSF is considered to be in the public domain (NOT CC, public domain)
Go to the top of the page
 
+Quote Post
elakdawalla
post Jan 7 2011, 12:31 AM
Post #4


Administrator
****

Group: Admin
Posts: 5172
Joined: 4-August 05
From: Pasadena, CA, USA, Earth
Member No.: 454



I can't remember if the FMAPs are stored the same way as the MIDRs, but the MIDRs were put in sinusoidal projection and then cut into 56 1024-by-1024 tiles per image; you have to open all 56 tiles as raw (which you can do in Photoshop as Phil said, just skip a couple of lines' worth of bytes to get past the header) to get the image before you can reproject and mosaic adjacent images together. This was a huge headache and I actuallly have a set of 27 CDs I made as a grad student containing Photoshop format (PSD) versions of all the C1-MIDRs where I assembled all 56 tiles for each image.

The map interface at the USGS website -- which was redesigned a couple of years ago -- provides clickable interface to the FMAPs. It is a bit slow but very good in that it can generate really enormous images at your choice of projection. http://www.mapaplanet.org/explorer/venus.html That interface is what I used to create the 3 Venus images I used in my Advent Calendar:
http://planetary.org/blog/article/00002801
http://planetary.org/blog/article/00002834
http://planetary.org/blog/article/00002845


--------------------
My website - My Patreon - @elakdawalla on Twitter - Please support unmannedspaceflight.com by donating here.
Go to the top of the page
 
+Quote Post
ncc1701d
post Jan 7 2011, 12:42 AM
Post #5


Junior Member
**

Group: Members
Posts: 91
Joined: 21-August 06
Member No.: 1063



here is the link
ftp://pdsimage2.wr.usgs.gov/cdroms/magellan/mg_1103/

for example grab a sinusodal image called "fl78n018.img" from folder fl78n018 and go into software folder and then pcdos folder and use newmap.exe

example: type this in newmap. (i think i made mistake in my message calling it newone)(this is 1994 program)

newmap fl73n003.img fl73n003new.img -p

("name of input file" "name of output file" "-p specfies cylindercal")

I get error saying my input file has not been decompressed
thats my unknown problem


I am in xp 32bit using dos prompt

thanks
Go to the top of the page
 
+Quote Post
siravan
post Jan 7 2011, 12:46 AM
Post #6


Member
***

Group: Members
Posts: 128
Joined: 10-December 06
From: Atlanta
Member No.: 1472



IMG files usually have either a text header or a separate text .lbl file, which you can read using a text editor and figure out what to do with them. A typical example is included here. It basically means that the file is organized into 20682 fixed-length records, each 30776 bytes in length (i.e. total file size is 30776*20682=636509232 bytes). ^IMAGE line means raw data begins at the second record (it is a 1 base system, so the first record is 1, not 0), hence, the image data starts at byte 30776. Here, each pixel is recorded as a 32 bit (SAMPLE_BITS) floating point number (SAMPLE_TYPE=PC_REAL, technically little-endian IEEE 754 floating-point number; in practice, this is the 'float' type in most programming languages). The image dimension is 20681 x 7694 pixels. The data is organized row first, so the first line of data is from byte 30776 to 30776+7694*4-1=61551. You can read it using a raw data import utility (Photoshop has one, I guess Gimp has one too), or if you are prone to write your own code, you can write a quick import program in the language of your choice.

PDS_VERSION_ID = PDS3

/*File format and length */
RECORD_TYPE = FIXED_LENGTH
RECORD_BYTES = 30776
FILE_RECORDS = 20682
^IMAGE = 2

OBJECT = IMAGE
LINES = 20681
LINE_SAMPLES = 7694
BANDS = 1
OFFSET = 0.0
SCALING_FACTOR = 1.0
SAMPLE_BITS = 32
SAMPLE_BIT_MASK = 2#11111111111111111111111111111111#
SAMPLE_TYPE = PC_REAL
MISSING_CONSTANT = 16#FF7FFFFB#
VALID_MINIMUM = -366.22
VALID_MAXIMUM = 1793.79
END_OBJECT = IMAGE
Go to the top of the page
 
+Quote Post
ncc1701d
post Jan 7 2011, 12:49 AM
Post #7


Junior Member
**

Group: Members
Posts: 91
Joined: 21-August 06
Member No.: 1063



concerning the other post i just noticed.

I used to use
http://pdsmaps.wr.usgs.gov/maps.html
which I prefferer over the

http://www.mapaplanet.org/explorer/venus.html
but they disabled the content.

the first one I mentioned used lat and long box for entering info and I loved that.
The new website is harder to use and I get lost trying to find locations and input specific locations.
Why they dont have at least a lat center point to go with the long center point when trying to find your way around I dont know on the new site.
I requested copy of old program they used on pdsmaps but they have not responded. Thats why I am looking into this on my own
Go to the top of the page
 
+Quote Post
siravan
post Jan 7 2011, 01:10 AM
Post #8


Member
***

Group: Members
Posts: 128
Joined: 10-December 06
From: Atlanta
Member No.: 1472



Here is the first image (reduced to 25% of its original size) in the folder:

Attached Image


The header is included below. I used ImageJ to import the raw with parameters: height =2830 (LINES), width=3184 (LINE_SAMPLES), offset to the file=12736 (i.e. ^IMAGE*RECORD_BYTES), pixel type is byte (SAMPLE_BITS=8). Also note there is a histogram contained in the third record.


PDS_VERSION_ID = PDS3

/* FILE FORMAT AND LENGTH */

RECORD_TYPE = FIXED_LENGTH
RECORD_BYTES = 3184
FILE_RECORDS = 2833
LABEL_RECORDS = 2

/* POINTERS TO START RECORDS OF OBJECTS IN FILE */

^IMAGE_HISTOGRAM = 3
^IMAGE = 4

/* POINTER TO THE TABLE CONTAINING ORBIT LOCATIONS */

^TABLE = "73N003OR.TAB"

/* IMAGE DESCRIPTION */

DATA_SET_ID = "MGN-V-RDRS-5-DIM-V1.0"
PRODUCT_ID = "78N018"
SPACECRAFT_NAME = MAGELLAN
SPACECRAFT_ID = MGN
INSTRUMENT_NAME = "RADAR SYSTEM"
INSTRUMENT_ID = RDRS
TARGET_NAME = VENUS
START_TIME = "N/A"
STOP_TIME = "N/A"
SPACECRAFT_CLOCK_START_COUNT = "N/A"
SPACECRAFT_CLOCK_STOP_COUNT = "N/A"
PRODUCT_CREATION_TIME = 1993-09-28T15:55:50
IMAGE_ID = FL73N003
MISSION_PHASE_NAME = {"MAPPING CYCLE 1",
"MAPPING CYCLE 2",
"MAPPING CYCLE 3"}

/* DESCRIPTION OF OBJECTS CONTAINED IN FILE */

OBJECT = IMAGE_HISTOGRAM
ITEMS = 256
DATA_TYPE = LSB_UNSIGNED_INTEGER
ITEM_BYTES = 4
END_OBJECT = IMAGE_HISTOGRAM

OBJECT = IMAGE
LINES = 2830
LINE_SAMPLES = 3184
SAMPLE_TYPE = LSB_UNSIGNED_INTEGER
SAMPLE_BITS = 8
SAMPLE_BIT_MASK = 2#11111111#
CHECKSUM = 938107697
Go to the top of the page
 
+Quote Post
ncc1701d
post Jan 7 2011, 01:37 AM
Post #9


Junior Member
**

Group: Members
Posts: 91
Joined: 21-August 06
Member No.: 1063



I appreciate all the input here so thank you all.
But I think your missing the problem.
I could easily just rename the .img files on the cds as .raw and open in photoshop and look at them. I did that.
However they are all in sinusodal projection. I cant use the sinusodal. They need to be converted to cylindrical.
The only program I know of to use to convert to cylindrical projection is the newmap.exe dos program they provide with the FMAPS set. It is finding a way to convert to cylindrical that is the biggest problem. Maybe their are other tools besides newmap.exe but thats all I know of and I am not programmer and that program is 16 years old.

Siravan mentions how most .img files have .lbl files with them.
Along time ago I thought I remember all the FMAPS having .lbls with each image but I dont see them with the .img files anymore on the link I provided.
Maybe that is why my newmap is saying they need to be uncompressed is just becuase they need that .lbl ? I dont know.


Go to the top of the page
 
+Quote Post
siravan
post Jan 7 2011, 02:34 AM
Post #10


Member
***

Group: Members
Posts: 128
Joined: 10-December 06
From: Atlanta
Member No.: 1472



I recompiled newmap for XP using the source code contained in the directory included (attached). I had to make some minor modifications to the source code, but it seems to be working, at least it generates reasonable looking output, however I have no way to test if it is the correct output.

Attached File  newmap.zip ( 37.04K ) Number of downloads: 837
Go to the top of the page
 
+Quote Post
ncc1701d
post Jan 7 2011, 03:00 AM
Post #11


Junior Member
**

Group: Members
Posts: 91
Joined: 21-August 06
Member No.: 1063



for some reason I get my same message

*** ERROR *** The input file has not bee decompressed.

can you tell me what you typed to get your results and did you still do it under a dos prompt?

did you ever recreate the problem i was having above?

Any chance you could send me your modified .c file so I can see your changes?
Go to the top of the page
 
+Quote Post
siravan
post Jan 7 2011, 03:13 AM
Post #12


Member
***

Group: Members
Posts: 128
Joined: 10-December 06
From: Atlanta
Member No.: 1472



This is the file I got:

Attached Image


I'm not sure about the vertical line in the middle. Is this expected in reprojection?

The source code is Attached File  newmap.c.zip ( 10.66K ) Number of downloads: 770
. It still needs to be run in command prompt. Note that I could not reproduce the error.
Go to the top of the page
 
+Quote Post
ncc1701d
post Jan 7 2011, 03:24 AM
Post #13


Junior Member
**

Group: Members
Posts: 91
Joined: 21-August 06
Member No.: 1063



I have to think on this now. Its not what I expected. I didnt expect a line in center but we may be getting into territory of blind leading the blind since i am still learing this program.
Can you tell me exactly what you typed at the dos prompt while using newmap to get this image?

Go to the top of the page
 
+Quote Post
siravan
post Jan 7 2011, 03:58 AM
Post #14


Member
***

Group: Members
Posts: 128
Joined: 10-December 06
From: Atlanta
Member No.: 1472



This is the correct image (I made a mistake in reading the file first time). It seems ok this time!

Attached Image


BTW, I think this image is part of Semuni Dorsa.
Go to the top of the page
 
+Quote Post
ncc1701d
post Jan 7 2011, 06:36 AM
Post #15


Junior Member
**

Group: Members
Posts: 91
Joined: 21-August 06
Member No.: 1063



are you just typing

newmap fl73n003.img fl73n003new_1.img -p

is this what you typed?

what does that mean you made a mistake reading it the first time?
did you need to change the code again to make it work or just use different command line instructions?

the new one looks right for sure.

for some reason I keep getting my .....input file has not been decompressed ERROR and I am wondering if I am missing something simple.
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic

 



RSS Lo-Fi Version Time is now: 28th March 2024 - 06:53 PM
RULES AND GUIDELINES
Please read the Forum Rules and Guidelines before posting.

IMAGE COPYRIGHT
Images posted on UnmannedSpaceflight.com may be copyrighted. Do not reproduce without permission. Read here for further information on space images and 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.