• Using ISSM
  • Interpolation of data in Mercator projection into a model domain

Hello everyone

I now have Antarctic surface temperature data, and I want to interpolate it into my model domain. However, the projection system of this data seems to be Mercator projection. The range of the longitude vector attached to the data is: -180° to 179.95°, and the range of the latitude vector is: -89.95° to -60°. How should I interpolate the data into my model domain with the polar stereographic projection using the known longitude vector and latitude vector of the data?

Thanks!

  • Hello @wudipao88

    Assuming that your dataset is on a regular grid (in lat/lon space) the best is to interpolate the dataset on your mesh lat/lon directly. You can do something like that:

    %get latitude and longitude for mesh vertices
    [md.mesh.lat,md.mesh.long]  = xy2ll(md.mesh.x,md.mesh.y,-1);
    
    %interpolate lat/lon/temp onto mesh
    temperature_mesh = InterpFromGridToMesh(lon, lat, temp, md.mesh.long, md.mesh.lat, NaN);

    I hope this answers your question
    All the best
    Mathieu

Hello @wudipao88

Assuming that your dataset is on a regular grid (in lat/lon space) the best is to interpolate the dataset on your mesh lat/lon directly. You can do something like that:

%get latitude and longitude for mesh vertices
[md.mesh.lat,md.mesh.long]  = xy2ll(md.mesh.x,md.mesh.y,-1);

%interpolate lat/lon/temp onto mesh
temperature_mesh = InterpFromGridToMesh(lon, lat, temp, md.mesh.long, md.mesh.lat, NaN);

I hope this answers your question
All the best
Mathieu

    mathieumorlighem Thank you very much for your quick reply! This is exactly the answer I was looking for! I didn't know that InterpFromGridToMesh can also use longitude and latitude as parameters, now I know.

    mathieumorlighem By the way, I would like to ask you one more question. When you replied to me, how did you open a rectangular box to place the code only? I know that I can choose to insert the code, but this can only write the code according to the length of the code in a line, and it cannot open a regular rectangular box. For example, in the following example,

    hhhhhhhhhh
    hhhhhhhhhhhhhhhhhh
    hhhhhhhhhhhhhhhhhhhhhhhhhhh

    The code inserted like this would look inconsistent and not as nice as a rectangular box like you replied.