How to specify nrows and ncols instead of latscale and lonscale in georesize?
2 ビュー (過去 30 日間)
古いコメントを表示
I am trying to rescale geotiffs using georesize. I have a required size [1527,3164] and I am extracting the latscale and lonscale based on these numbers. However, the following line in the georesize function is returning slightly different values (i.e., 1526, 3163 etc)
[RB, xSample, ySample] = scaleSizeAndDensity(RA, double(latscale), double(lonscale));
For example, the parameters A = 1493x3093 single, latscale = 1.0228, lonscale = 1.0230 should result in the required size, but the execution of the scaleSizeAndDensity is causing xSample = 3163, ySample = 1527. While the change is minor, it is causing dimension mismatch. I believe zero padding B will create a mismatch with it's corresponding RB. What can I do in this regard? Is there a way to specify this required size when I call georesize instead of latscale and lonscale while can create error because of the smaller decimal numbers?
Thanks.
4 件のコメント
dpb
2022 年 7 月 14 日
編集済み: dpb
2022 年 7 月 15 日
SHOW US THE EXACT CODE IN ITS ENTIRETY OF THE PERTINENT PART INSTEAD OF DESCRIBING IT.
Where you added double may or may not have any effect; you do not need an explicit double() statement at all; you'll probably be better off without. My comment above was only meant to ensure you hadn't created the variables as single() but were using (default) double precision in the calculations.
What we haven't seen is whether you actually computed the scaling factors or are still messing around trying to use constants as in your original...
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Import, Export, and Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!