Skip to content
View in the app

A better way to browse. Learn more.

PDS Geosciences Node Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Opening .img binary files

Featured Replies

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

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

  • Author

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

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.

  • Author

Right, thank you very much! I shall persevere with ImageJ and see what I can get. Thanks for being so helpful!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.