How to modify the original X and Y of an unwrapped phase in an hdr file?

Dear SNAP community

This is an HDR file of an unwrapped phase.

The map info section provides georeferencing information for the image, as shown on the screen, the Lat/Long coordinates should normally refer to the original X and Y of the image, but for me, these coordinates indicate a point at the center of my image.
My question is: is there any way to modify these coordinates?

thanks in advance
Best regards

Is the data displayed wrongly?

I think there is no need to change it.
The map info field does not only contain latitude/longitude but also the reference pixel they belong to.
As reference X=11906.5 and Y=8965.5 is defined. This is the centre and if the lat/lon values match this, everything is fine.

See ENVI Header Files (

1 Like

Thank you for your kind reply
no, the data is displayed correctly but for me, I need to convert the hdr file to ROI_PAC format the function by which I can make that requires two coordinates one at the top left (east) and the other at the top left north of the image

In this case you need to multiply the number of pixels you want to move the reference point by the pixel size.

11906.5 * 0.00013151333575950978 = 1.56586353222060319557
and that’s what you have to subtract from the longitude value.
For latitude accordingly.

It might be possible to reproject the data and then specify the pixel location.
When storing as dim or Envi file, the reference point should be moved.

Thank you for your reply.
Sorry, I don’t quite get it. I did as you see, but it seems that the image was projected from its correct location.
I think there is no way to do this and snap always displays the center coordinate of the image.

But in my case, I need to get these coordinates

This is I wasn’t sure about. Also. in the hdr file centre pixel is used as reference.
So, you need to do it manually like this.
11906.5 * 0.00013151333575950978 = 1.56586353222060319557
-4.410560112231575 - 1.56586353222060319557 = -5.976423644

Or to save the manual calculation you can set a pin using the pin manager at location [0,0] and you get the coordinates.

Thank you for your help.
I’ll give it a try and let you know if it works for me.
thanks and best regards

@ABraun Could you please help with this matter?

You could do it with GDAL. It’s supporting both formats.

gdal_translate -of <output format> <source filename> <destination filename>
1 Like

Thank you so much for your help.
I will definitely give it a try and let you know if it works.
Thank you.

Greetings Sir
I’ve tried to use gdal_translate to convert my data, but I could not.
Here I set my HDR file as input. It gave me this error.

And here I have put the unwrapped image instead of the corresponding file, giving me this message error.

Could you kindly help me solve this?
Thanks and best regards

The conversion is tricky.
I think the error results from the band being the wrong data type. If I get it right the ROI_PAC needs integer data types and not floating point.
Ther are two options. Both might change the values. So, you need to be careful and validate the conversion results. You can convert the data in SNAP first.
In the menu Raster / Data Conversion / Convert Datatype you can find this function.
I’m not sure which scaling and data type is necessary. Probably int32 or int16.
Afterwards to conversion with gdal might work.
Another way is to use the parameters of gdal.
See gdal_translate — GDAL documentation. You can add ot and scale parameters.

Thank you very much for your kind reply.
I tried both options but unfortunately I still couldn’t convert my hdr files.