Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to use QGIS to view some images from the Mars Reconnaissance Orbiter Context Camera. I use ISIS3 to download the images and convert them to mapped .cub files, following the instructions here: http://isis.astrogeology.usgs.gov/IsisWorkshop/index.php/Working_with_Mars_Reconnaissance_Orbiter_CTX_Data

Now I'm trying to export these ISIS cube files to GTiff files, to view in QGIS, I can do this but the georeferencing doesn't seem to work. I've tried this in 3 different ways:

  1. Use the ISIS command isis2std to generate tif (and tfw) files.

    When I try to open the tif file in QGIS it asks me to choose a projection type (side question, is there a suitable projection for Mars? I always choose WGS 84, stupid I know but I don't know a more sensible option). Then once the raster is loaded it automatically displays as a grayscale image but my coordinates are not in degrees, they appear to be in pixels and have a range of 100s of thousands.

    This method produces a tif image of ~100 Mb from an original .cub of close to 1 Gb.

  2. Use gdal: gdal_translate -of GTiff input_mapped.cub output.tif.

    This time I don't get asked to choose a projection type. The projection takes on 'USER:100002'. Hopefully this means that it is managing to read the appropriate Mars projection from the ISIS cub? The image displays as a solid grey box in grey scale this time, but I can see details by switching to a different colour mapping scheme. Again though my coordinates are not in degrees, they range in the hundreds of thousands again.

    This method produces a GTiff with the same ~1 Gb size as the original .cub image.

  3. Open the ISIS .cub file directly in QGIS.

    Has basically the same effect as for method 2.

Because of the file sizes I'd prefer a variation of method 1, but with a suitable projection and georeferencing scheme for Mars.

Edit: Here is the georeference, and the output of gdalinfo on the original ISIS .cub file:

georeference (in python):

>>>import gdal
>>>from gdalconst import *
>>>fn = 'P01_001356_1747_XN_05S221W.map.cub'
>>>ds = gdal.Open(fn, GA_ReadOnly)
>>>gt = ds.GetGeoTransform()
>>>gt
(-22085.510544416, 5.1698292472885, 0.0, -234679.22885141, 0.0, -5.1698292472885)

gdalinfo (from terminal):

$gdalinfo file.cub
Driver: ISIS3/USGS Astrogeology ISIS cube (Version 3)
Files: P01_001356_1747_XN_05S221W.map.cub
       P01_001356_1747_XN_05S221W.map.cub.aux.xml
Size is 8526, 30111
Coordinate System is:
PROJCS["Sinusoidal Mars",
    GEOGCS["GCS_Mars",
        DATUM["D_Mars",
            SPHEROID["Mars",3396190,0]],
        PRIMEM["Reference_Meridian",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Sinusoidal"],
    PARAMETER["longitude_of_center",138.45730511261],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0]]
Origin = (-22085.510544415999902,-234679.228851410007337)
Pixel Size = (5.169829247288500,-5.169829247288500)
Corner Coordinates:
Upper Left  (  -22085.511, -234679.229) (138d 5' 1.74"E,  3d57'33.05"S)
Lower Left  (  -22085.511, -390347.957) (138d 4'56.04"E,  6d35' 7.46"S)
Upper Right (   21992.454, -234679.229) (138d49'45.19"E,  3d57'33.05"S)
Lower Right (   21992.454, -390347.957) (138d49'50.86"E,  6d35' 7.46"S)
Center      (     -46.528, -312513.593) (138d27'23.46"E,  5d16'20.26"S)
Band 1 Block=406x128 Type=Float32, ColorInterp=Undefined
  Min=0.033 Max=0.150 
  Minimum=0.033, Maximum=0.150, Mean=0.080, StdDev=0.020
  NoData Value=-3.40282265508890445e+38
  Metadata:
    STATISTICS_MAXIMUM=0.15037615597248
    STATISTICS_MEAN=0.080181184414784
    STATISTICS_MINIMUM=0.033307410776615
    STATISTICS_STDDEV=0.020299974127104
share|improve this question
    
What is the Proj parameter string for 'USER:100002'? –  nhopton Mar 8 '13 at 10:18
    
@nhopton Would that be this: "+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=180 +x_0=0 +y_0=0 +a=3396190 +b=3396190 +units=m +no_defs" I went to Settings > Custom CRS and this was in the parameters box. –  EddyThe B Mar 9 '13 at 21:02
    
I believe this is caused by the geotransform being in pixels, rather than degrees, am investigating. –  EddyThe B Mar 12 '13 at 20:54
    
I wouldn't have thought so, not if the coordinates are in the hundreds of thousands. It seems more likely that the raster is projected, one hopes to the CRS you provided details of above. Can you post the raster to somewhere where it can be downloaded? –  nhopton Mar 13 '13 at 16:07
    
@nhopton Sure, though it's enormous. I've also edited my question to show the output of gdalinfo and the georeference for the file. Apologies for being slow to respond to your comments, I've been absorbed in other things. The ISIS .cub file is at thermal.boulder.swri.edu/images/… –  EddyThe B Mar 15 '13 at 19:18

1 Answer 1

up vote 1 down vote accepted

Make a custom CRS using the following parameter string:

+proj=longlat +a=3396190 +b=3396190 +no_defs

You might call this CRS (say) "Mars_Geo". Then load the *.cub raster, set the project CRS to "Mars_geo" and enable on-the-fly CRS transformation. Doing this will distort the raster to some extent but you will get lon/lat coordinates reported as you move the pointer around the screen.

When checking the corner coordinates of the raster bear in mind that the corners are not the corners of the data. The image is an upright rectangle having the extents shown in the attached image.

Please bear in mind that I know nothing about Mars and next to nothing about Sinusoidal CRSs, so be careful!

N.

enter image description here

share|improve this answer
    
That works, thanks! –  EddyThe B Apr 3 '13 at 18:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.