Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for missing a grid cell at longitudes close to min_lon #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/geodarn/gridding.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,14 @@ def create_grid_records(located, lat_min=50, lat_width=1.0, hemisphere='north'):
matching_points_lat = np.logical_and(lat < located.location[:, 1], located.location[:, 1] < lat + lat_width)
matching_indices_lat = np.argwhere(matching_points_lat)
lon_divs_for_lat = lon_divs[lat_idx[0]]
lon_indices = np.argwhere(np.logical_and(min_lon < lon_divs_for_lat, lon_divs_for_lat < max_lon))
lon_indices_temp = np.argwhere(np.logical_and(min_lon < lon_divs_for_lat, lon_divs_for_lat < max_lon))
if not lon_indices_temp.any():
# For when min_lat and max_lat have too small of a delta to grid
continue
if lon_indices_temp[0] != 0: # Just to be sure
lon_indices = np.append([lon_indices_temp[0].T-1], lon_indices_temp, axis=0)
if lon_indices_temp[-1] == len(lon_divs_for_lat) - 1:
lon_indices = lon_indices[0:-1]

# Loop through the longitude bins with data
for lon_idx in lon_indices:
Expand Down