Skip to content

Commit

Permalink
Add always_xy=True to avoid potential issue in projection
Browse files Browse the repository at this point in the history
This is to make sure the projection transformation gives the correct results so the domain locating function works.
  • Loading branch information
dongqi-DQ authored Aug 24, 2023
1 parent 91bfc48 commit bd6cc02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dynamic_util/loc_dom.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def domain_location(palm_proj, wgs_proj, centlat, centlon, dx, dy, nx, ny):
),
)
utm_crs = CRS.from_epsg(utm_crs_list[0].code)
trans_utm2wgs = Transformer.from_proj( utm_crs, wgs_proj)
trans_wgs2utm = Transformer.from_proj( wgs_proj, utm_crs)
trans_utm2wgs = Transformer.from_proj( utm_crs, wgs_proj, always_xy=True)
trans_wgs2utm = Transformer.from_proj( wgs_proj, utm_crs, always_xy=True)

centx, centy = trans_wgs2utm.transform(centlon, centlat)
west_utm, east_utm = centx-nx*dx/2, centx+nx*dx/2
Expand All @@ -48,7 +48,7 @@ def domain_location(palm_proj, wgs_proj, centlat, centlon, dx, dy, nx, ny):

inProj = wgs_proj
outProj = palm_proj
transformer = Transformer.from_proj(inProj, outProj)
transformer = Transformer.from_proj(inProj, outProj, always_xy=True)
centx, centy = transformer.transform(centlon,centlat)

west, east = centx-nx*dx/2, centx+nx*dx/2
Expand Down

0 comments on commit bd6cc02

Please sign in to comment.