Jump to content
PDS Geosciences Node Community
Sarah020

Opening .img binary files

Recommended Posts

Hello,

 

I'm new to using the PDS node and I am struggling to open the .img files that I have downloaded. I'm able to view the .jp2 images associated with each data set, but not the .img files. I know that they are binary data files but I don't know how to access the data within them. Is there any way of getting them into an ASCII or other numerical based format, eg an x,y,(other variable) format? I'm hoping to analyse the data on a Linux system, so any advice tailored to Linux would be appreciated!

 

Thank you very much,

 

Sarah

Share this post


Link to post
Share on other sites

Sarah,

 

As you didn't mention a particular image data set, I'll just tell you in general how to read PDS images. A typical PDS image is stored as a simple binary array. It is described by a PDS label (a set of ASCII-text keyword=value statements), which can be either attached or detached. An attached label is embedded at the beginning of the image file; a detached label is in a separate file with the same name, extension LBL. The label tells you everything you need to know to read the image -- the number of lines, number of pixels (samples) per line, the size and data type of a sample, and map projection information if the image is a map. (PDS deliberately does not rely on any commercial or proprietary formats to archive image data, in order to ensure the long-term viability of the data.) Commercial image processing software packages such as IDL, ENVI, and ISIS can read PDS images. Some free image processing programs can read PDS images by opening them as a "raw" or "raster" file, if you supply the size and data type as specified in the label. One of these that I have tried recently is ImageJ (http://imagej.nih.gov/ij/). Another I have heard recommended is GDAL (http://www.gdal.org). Finally, there is a free download called NASAView (http://pds.nasa.gov/tools/nasa-view.shtml) that was written specifically for PDS images and tables. It will display a PDS image but doesn't have much in the way of analysis tools.

 

Please let me know if you need more specific information.

 

Susan Slavney

Share this post


Link to post
Share on other sites

Hello,

 

Thanks so much for your reply. I've had a look at the software you recommended, although I think that I maybe didn't explain very well what I meant. I don't want to view the .IMG, I want to access the data table so that I can plot parts from the file myself. I'm not sure whether this is actually possible, but I was hoping so! So my problem is not really in viewing the image, but in opening the data file itself to view the lists of data. Is this an option?

 

[For example, one of the files I would like to access is the LOLA GDR Roughness map product data file (ldrm_16.img). ]

 

 

I'm sorry for knowing so little about this, I'm probably asking a very basic question!

 

Sarah

Share this post


Link to post
Share on other sites

Yes, certainly you can open the file, read all or part of it, and do what you like with the data, display it or plot it or whatever. You can write your own program to do this, or use software such as Matlab or IDL. Again, the label tells you everything you need to know to read the data file. Remember this is binary data, so you won't be able to look at it in a text editor. The free program I mentioned before, ImageJ, can create a plot or a list of data values for a selected area of the image, if that is what you want to do.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×