Inverse -I Mapprojection

Hello, I am trying something simple but I don’t understand the use of the flag -I for inverse transformation. I have data (fit.txt) that contains distance along the profile and depth in Km and I need to reverse the transformation to geographic coordinates, I have the initial and ending points (lat, lon) of the profile. I am trying:

Initial point: -77.105 -36.0403
Ending point: -65 -36.1964
fit.txt (4.5 KB)

gmt mapproject fit.txt -C-77.105/-36.0403 -I -E > latlon.xy
But it doesn’t give me anything right, output:

40.5118586641 -0
39.7064666222 -0
38.9306647956 -0
38.1832329827 -0
37.4629894515 -0
36.7687974749 -0
36.0995610985 -0

I have tried specifying region and projection, -JM[midpoint_profile]

Regards

Can you try with -Fk ?

Tried:

gmt mapproject fit.txt -C-77.105/-36.0403 -Fk -I -E > latlon.xy

It didn’t work, the output now

25.063739687 0
25.0633522868 0
25.0629660498 0
25.0625809755 0
25.0621970638 0
25.0618143141 0
25.0614327277 0
25.0610523029 0
25.0606730412 0

Well, I’m not 100% sure it is doable like this. It should … but I don’t know exactly how. You can explore the options and try :melting_face:

Thanks anyway.

I have tried:

Proj=-JT77.105/-36.0403/10

gmt mapproject fit.xy $Proj -R77.105/-36.0403/ -65/-36.1964 -C -I -Fk > latlon.xy

Now I get geographic coordinates:

-77.4226508667 -36.4796195987
-77.4061799913 -36.4664018045
-77.3897146831 -36.4531816828
-77.3732549386 -36.4399592369
-77.356800754 -36.4267344701

It still doesn’t match the initial and ending points but it’s close to them.

As default, the “origin” of the tranformation is the lower left corner. (77.105 ; -65). With the command -C, the origin is now the “center” of your map. I assume you want the origin to be exactly at (-77.105; -36.0403).
But again, you said you have a distance along track… So you need at least the azimuth to make up the coordinates. No?

Yes, I want the origin to be (-77.105; -36.0403). I think the azimuth isn’t needed because I have the initial and ending point of the profile, but maybe I can be wrong about that. With earlier commands, I have this in the map (the blue line should be in the red line)

It seems the Forum stop sending me mails for new posts (not so bad this time that I’m quite short on it)

Basically you cannot do what you want. Your file starts with negative distances (??) that go to 0 and then increase. Without the anchor points used to compute it, and assuming it was done with project, it is impossible to recover the coordinates.

If I made the profile with:

gmt project seismicity.xy -Fpz -C77.105/-36.1964 -E -65/-36.0403 -W-25/25k -S -Lw -Q > seis.xy

And just because I wanted the coordinates of the oceanic trench to be at (0,0) I subtracted Fx from all the coordinates, where Fx is the x coordinates of the trench projected in that same profile. Later I did an interpolation to obtain my data fit.xy

Knowing that it’s possible?

Should be. For example

project  -C77.105/-36.1964 -E-65/-36.0403 -G10
77.105  -36.1964        0
70.043074003    -44.6388374347  10
60.6630855534   -52.5012739439  20
47.5276255017   -59.3157035254  30
28.979113367    -64.2221596485  40
5.4461596837    -66.0106515707  50
-17.9116768798  -64.0262989546  60
-36.1431859779  -58.9873715618  70
-49.0312825762  -52.0987993965  80
-58.2548857351  -44.1958467988  90
-65     -36.0403        99.6418620859

Oh right my bad, I did the profile that way:

gmt project -C77.105/-36.1964 -E-65/-36.0403 -G0.05 -Q > profile.xy

the other was the points I projected on it. Later I did the subtraction of the x coordinate of the oceanic trench and the fit of my points into my file “fit.xy”.

Now I want to return my fit.xy to the geographic coordinates.