Skip to content

Commit

Permalink
update adjustRCMGrid function
Browse files Browse the repository at this point in the history
  • Loading branch information
sixtohg authored Sep 1, 2020
1 parent fdc34a0 commit 77bd873
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions R/getLatLonDomain.R
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ adjustRCMgrid <- function(gds, latLon, lonLim, latLim) {
if (latLon$pointXYindex[1] >= 0){
latLon$pointXYindex[1] = as.integer(-1)
}
if ((latLon$pointXYindex[2] >= 0) & (length(latLon$xyCoords$y) > 1)){
latLon$pointXYindex[2] = as.integer(-1)
}
} else if (length(latLim) == 1) {
auxDis <- sqrt((auxLon - lonLim[1]) ^ 2 + (auxLat - latLim[1]) ^ 2)
ulrowCol <- arrayInd(which.min(auxDis), dim(auxDis))
Expand All @@ -350,6 +353,9 @@ adjustRCMgrid <- function(gds, latLon, lonLim, latLim) {
if (latLon$pointXYindex[2] >= 0){
latLon$pointXYindex[2] = as.integer(-1)
}
if ((latLon$pointXYindex[1] >= 0) & (length(latLon$xyCoords$x) > 1)){
latLon$pointXYindex[1] = as.integer(-1)
}
} else {
auxDis <- sqrt((auxLon - lonLim[1]) ^ 2 + (auxLat - latLim[1]) ^ 2)
llrowCol <- arrayInd(which.min(auxDis), dim(auxDis))
Expand Down

0 comments on commit 77bd873

Please sign in to comment.