Skip to content

Commit

Permalink
Resolve codacy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiggi committed Sep 3, 2024
1 parent 2121756 commit 5f030ab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
9 changes: 5 additions & 4 deletions gpm/gv/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def reflectivity_scatterplot(
add_colorbar=True,
marker="+",
title="GR / SR Offset",
cbar_kwargs={},
cbar_kwargs=None,
**plot_kwargs,
):
"""
Expand Down Expand Up @@ -269,7 +269,7 @@ def reflectivity_scatterplot(
# Initialize plot if necessary
if ax is None:
# Create a new figure and axis
fig, ax = plt.subplots()
_, ax = plt.subplots()

# Define plot limits if not specified
if gr_range is None:
Expand Down Expand Up @@ -453,7 +453,7 @@ def reflectivity_distribution(
# Initialize plot if necessary
if ax is None:
# Create a new figure and axis
fig, ax = plt.subplots()
_, ax = plt.subplots()

# Default vmin/vmax
vmin = np.nanmin([df[gr_z_column].min(), df[sr_z_column].min()])
Expand Down Expand Up @@ -487,7 +487,7 @@ def calibration_summary(
gr_range=None,
sr_range=None,
marker="+",
cbar_kwargs={},
cbar_kwargs=None,
# Histogram options
bin_width=2,
**plot_kwargs,
Expand Down Expand Up @@ -526,6 +526,7 @@ def calibration_summary(
The figure object containing the calibration summary plots.
"""
cbar_kwargs = {} if cbar_kwargs is None else cbar_kwargs
# Compute bias
dz = df[gr_z_column] - df[sr_z_column]

Expand Down
12 changes: 2 additions & 10 deletions gpm/gv/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,14 @@ def volume_matching(
crs_gr = ds_gr.xradar_dev.pyproj_crs

#### - Retrieve GR (lon, lat) coordinates
lon_gr, lat_gr, height_gr = reproject_coords(
lon_gr, lat_gr, _ = reproject_coords(
x=ds_gr["x"],
y=ds_gr["y"],
z=ds_gr["z"],
src_crs=crs_gr,
dst_crs=crs_sr,
)

#### - Add lon/lat coordinates to ds_gr
ds_gr["lon"] = lon_gr
ds_gr["lat"] = lat_gr
Expand Down Expand Up @@ -749,15 +750,6 @@ def volume_matching(
elevation_beamwidth=elevation_beamwidth_gr,
)

#### - Retrieve GR (lon, lat) coordinates
lon_gr, lat_gr, height_gr = reproject_coords(
x=ds_gr["x"],
y=ds_gr["y"],
z=ds_gr["z"],
src_crs=crs_gr,
dst_crs=crs_sr,
)

#### - Retrieve SR (x,y,z) coordinates
x_sr, y_sr, z_sr = retrieve_gates_projection_coordinates(ds_sr, dst_crs=crs_gr)

Expand Down
2 changes: 1 addition & 1 deletion gpm/gv/xradar/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def _add_lon_lat_coords(xr_obj):
crs_gr = xr_obj.xradar_dev.pyproj_crs

# Add lon/lat coordinates to GR
lon_gr, lat_gr, height_gr = reproject_coords(
lon_gr, lat_gr, _ = reproject_coords(
x=xr_obj["x"],
y=xr_obj["y"],
z=xr_obj["z"],
Expand Down

0 comments on commit 5f030ab

Please sign in to comment.