Author Topic: CRISM overlay for HiRISE DEM using ENVI  (Read 6204 times)

elysea

  • Osiris (Active Member)
  • **
  • Posts: 16
CRISM overlay for HiRISE DEM using ENVI
« on: May 18, 2011, 11:26:07 PM »
Hello,

I'm using the CRISM Analysis Tool (CAT) v6.6 to project frt00004af7_07_if164l_trr3.img in ENVI, which uses its own GLT.

I also have a HiRISE DEM .tiff created from psp_002932_1445 and psp_003209_1445 that I want to bring in to the same projection so that the two will overlay. I realise the pixel sizes are very different, but does anyone know of a simple way to do this? Or any way? I am a student who is slowly losing hope!

I have edited the DEM header in order to change the projection to match the CRISM image, but as the DEM extent is greater than the HiRISE image their corner coordinates are not the same so the lat/long is off.

In desperation,
elysea

elysea

  • Osiris (Active Member)
  • **
  • Posts: 16
Re: CRISM overlay for HiRISE DEM using ENVI
« Reply #1 on: May 19, 2011, 07:08:31 AM »
Never mind, I was able to do an acceptable Image-to_image registration, with the projected CRISM as the base, and subset the registered DEM so that no background values were included. My DEM pixel size kept defaulting right out to 17m to match the CRISM image though, otherwise my registration kept failing. But, desperate times.

thare

  • GIS Support Team
  • Isis (Extreme Power Member)
  • *****
  • Posts: 1217
    • http://webgis.wr.usgs.gov
    • Email
Re: CRISM overlay for HiRISE DEM using ENVI
« Reply #2 on: May 19, 2011, 08:10:44 AM »
You need to use an application that is capable of displaying multiple images with different resolutions. This is typical of most GIS or RS applications. Some of these apps even allow the images to be different projections (which means the application needs to know the projection of the images so that it can project at least one on-the-fly to the projection of the second image). Although, to help the application more easily register the images, it is recommended to use the exact same projection (and projection parameters). This doesn't mean resolution.

Since you have ENVI you can do this. In particular, ENVI Zoom is built with the GIS-like (multi-layer) capabilities.

Before you bring in an image, make sure to edit the header in ENVI so you can set the projection parameters and the planet's radius.

good luck,
Trent

elysea

  • Osiris (Active Member)
  • **
  • Posts: 16
Re: CRISM overlay for HiRISE DEM using ENVI
« Reply #3 on: May 02, 2013, 09:25:01 AM »
Hello,

It's been a while but I'm revisiting this project and I am having a similar issue. It's not so much a question, but a 'sorry I'm a simpleton and can't make this work' type post.

I would like these images to overlay without using registration, and I can't get it to work using ENVI Zoom, ArcMap 10 or GRASS by setting the same projection in headers or otherwise. I think this is because the CRISM image is in a +/- 180 system and the HiRISE seems to be 0-360?  They align latitude wise but are shifted in longitude. I know this has been touched on before but I apologise because I still don't understand.

I would prefer to use ENVI or GRASS to make this work.

I originally downloaded these images from PDS, the CRISM .img and the HiRISE JP2 which I converted to a .tif file. On the PDS site, they both have max, min and central lat/lon values from 0-360 for their extents, but once downloaded I do gdalinfo and obtain the information attached below. I should say that I have projected the CRISM image using the CAT in ENVI, so that's where those values are coming from.

The central meridian of the CRISM image is set to the centre of the observation, while the HiRISE is set to the centre of the 0-360 projection. Reprojecting to the same projection gives me the shift in longitude values. I'm not sure how to change systems from 180 to 360 in GRASS or ENVI, but I assume this would fix my problem?

Otherwise I have thought about creating a new location in GRASS which is 0-360 and just gda_translate -a_ullr the corners of each image (from the PDS metadata) before importing them?

thare

  • GIS Support Team
  • Isis (Extreme Power Member)
  • *****
  • Posts: 1217
    • http://webgis.wr.usgs.gov
    • Email
Re: CRISM overlay for HiRISE DEM using ENVI
« Reply #4 on: May 02, 2013, 07:22:00 PM »
Quote
I would like these images to overlay without using registration.
This implies the images are the exact same projection, same extent, and resolution (also meaning same number of lines and samples). Is that what you are really after or am I reading too much into it? This is a little odd considering HiRISE is 25cm/p and CRISM 17m/p. One image will need to be highly down-sampled or up-sampled.

Let's try to get them in the same projection before upsampling one and clipping to the same extent. Since you are running GDAL you can try this.

1.) copy the projection text from one file into a text file. So create the file CRISM_wkt.prj and copy from the gdalinfo printout this full section:
Quote
PROJCS["Equi......
     UNIT["metre",1,                   
             Authority["EPSG", "9001"]]]

2.) Now reproject the HiRISE image to that projection. Warning: for GDAL routines you should really run fix_jp2 on the HiRISE image (see below).
> gdal_warp -t_srs CRISM_wkt.prj PSP_002932_1445_RED.tif PSP_002932_1445_RED_newPrj.tif
note: gdalwarp has many parameters like resample method. By default it is nearest neighbor.  Bilinear might be more pleasing especially if you are going to up-sample something.

The new image should now be in the same projection system (radius and all), but the extents and resolutions will be different. Try them together since most mapping applications can at least handle that.

let us know,
Trent

Note: if the projections are correct -- then ArcMap, QGIS, and probably Envi Zoom (not sure about Grass) would put them into the correct location (using projection on-the-fly to the screen). But if you have not heard, HiRISE images have a funky internal geo-label (which is being corrected for the next release since ENVI, @ version 5.5 sp1?, also implemented the projection clarification). So to update the HiRISE labels you need to run "fix_jp2" on the HiRISE jpeg2000 file before converting to GeoTiff.
see step 1 from: https://isis.astrogeology.usgs.gov/IsisSupport/index.php/topic,3440.msg13384.html

This is a good post too which might help if you are willing to run a little python. See the first helper script not the second:
http://stackoverflow.com/questions/10454316/how-to-project-and-resample-a-grid-to-match-another-grid-with-gdal-python

« Last Edit: May 02, 2013, 07:29:44 PM by thare »

elysea

  • Osiris (Active Member)
  • **
  • Posts: 16
Re: CRISM overlay for HiRISE DEM using ENVI
« Reply #5 on: May 03, 2013, 11:00:05 AM »
Thank you so much Trent, I have finally got them to overlay with each other and actually sit in Hale crater.

I had tried gdalwarp previously but it was much tidier creating a wkt.prj file so perhaps I was getting something wrong when copying one projection to the other.

Also, I had not applied the HiRISE fix - I'd read about it but wasn't sure if it was necessary for my image. I didn't realise that this needed to be done for the CRISM image too -  the lat_ts and lat_0 parameters assigned by CAT to the CRISM image were the same as HiRISE before fixing.

I'll have a go at resampling and clipping now - but I really can't thank you enough for your explanation :-)