Skip to content

Commit

Permalink
Possibly fix CR coords problem, #95
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanideCN committed Oct 8, 2023
1 parent 794a375 commit abc7d58
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
12 changes: 11 additions & 1 deletion cinrad/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,21 @@ def quick_cr(r_list: Volume_T, resolution: tuple = (1000, 1000)) -> Dataset:
xarray.Dataset: composite reflectivity
"""
r_data = list()
for i in r_list:
# Get grid from the first tilt
r, x, y = grid_2d(
r_list[0]["REF"].values,
r_list[0]["longitude"].values,
r_list[0]["latitude"].values,
resolution=resolution,
)
r_data.append(r)
for i in r_list[1:]:
r, x, y = grid_2d(
i["REF"].values,
i["longitude"].values,
i["latitude"].values,
x_out=x,
y_out=y,
resolution=resolution,
)
r_data.append(r)
Expand Down
2 changes: 1 addition & 1 deletion cinrad/visualize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import matplotlib

if 'Arial' in matplotlib.rc_params()['font.sans-serif']:
if "Arial" in matplotlib.rc_params()["font.sans-serif"]:
matplotlib.rc("font", family="Arial")
from cinrad.visualize.ppi import *
from cinrad.visualize.rhi import *
6 changes: 2 additions & 4 deletions cinrad/visualize/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,7 @@ def _get_uniform_cmap(cmap: Any) -> Any:
_d = dic[0]
_d["VELSZ"] = _d["VEL"]

font = FontProperties(
fname=get_font_path()
)
font = FontProperties(fname=get_font_path())
plot_kw = {"fontproperties": font, "fontsize": 12}


Expand Down Expand Up @@ -315,7 +313,7 @@ def highlight_area(
area: Union[Array_T, str], linecolor: str = "red", **kwargs
) -> List[Line2D]:
r"""Return list of Line2D object for given area name"""
fpath = get_shp_file('City')
fpath = get_shp_file("City")
shp = shapefile.Reader(fpath, encoding="gbk")
rec = shp.shapeRecords()
lines = list()
Expand Down

0 comments on commit abc7d58

Please sign in to comment.