Using interp2 on maps that have different longitude systems

2 ビュー (過去 30 日間)
Melissa
Melissa 2015 年 5 月 15 日
コメント済み: Melissa 2015 年 5 月 16 日
Hello,
I am trying to use interp2 between A and B
A longitude spans 0 to 360
B longitude spans -180 to 180
If I use wrapTo180 on A, it is no longer monotonically increasing.
If I use wrapTo360 on B, it is no longer monotonically increasing.
If I use interp2 without wrapping either, I only get the interpolated data for longitudes 0+
What are my options for getting a full global interpolation with these different longitude systems?
Thank you,
Melissa

採用された回答

Walter Roberson
Walter Roberson 2015 年 5 月 15 日
unwrap one of them and circshift as needed to make it and the referenced data monotonically increasing.
Blongwrap = wrapTo360(Blong);
crossingidx = find(diff(Blongwrap) < 0, 1);
Blongwrapshifted = circshift(Blongwrap(:),-crossgidx,1);
Bshifted = circshift(B, -crossingidx, 1);
This assumes that, as per your previous postings, longitude varies in the first dimension.
  1 件のコメント
Melissa
Melissa 2015 年 5 月 16 日
Thank you so much! Sorry, I didn't see your comments from the other posts because it doesn't notify me :(

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by