Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixing some bugs with lon/lat in space gridding

  • Loading branch information...
commit 6bb1bca1dee67bf69e3177fdb9b3ee94fc7ed5d7 1 parent 7de41a9
Eva Schiffer authored
Showing with 6 additions and 6 deletions.
  1. +4 −4 stg/space_gridding.py
  2. +2 −2 stg/space_time_gridding.py
View
8 stg/space_gridding.py
@@ -29,10 +29,10 @@ def calculate_index_from_nav_data (aux_data, grid_degrees) :
"""
# figure out where the day/night indexes will fall
- day_lon_index = numpy.round(aux_data[LON_KEY][aux_data[DAY_MASK_KEY]] / grid_degrees)
- day_lat_index = numpy.round(aux_data[LAT_KEY][aux_data[DAY_MASK_KEY]] / grid_degrees)
- night_lon_index = numpy.round(aux_data[LON_KEY][aux_data[NIGHT_MASK_KEY]] / grid_degrees)
- night_lat_index = numpy.round(aux_data[LAT_KEY][aux_data[NIGHT_MASK_KEY]] / grid_degrees)
+ day_lon_index = numpy.round((aux_data[LON_KEY][aux_data[DAY_MASK_KEY]] + 90.0) / grid_degrees)
+ day_lat_index = numpy.round((aux_data[LAT_KEY][aux_data[DAY_MASK_KEY]] + 180.0) / grid_degrees)
+ night_lon_index = numpy.round((aux_data[LON_KEY][aux_data[NIGHT_MASK_KEY]] + 90.0) / grid_degrees)
+ night_lat_index = numpy.round((aux_data[LAT_KEY][aux_data[NIGHT_MASK_KEY]] + 180.0) / grid_degrees)
return day_lon_index, day_lat_index, night_lon_index, night_lat_index
View
4 stg/space_time_gridding.py
@@ -146,8 +146,8 @@ def space(*args):
grid_degrees = float(options.gridDegrees)
# determine the grid size in number of elements
- grid_lat_size = int(math.ceil(180.0 / grid_degrees))
- grid_lon_size = int(math.ceil(360.0 / grid_degrees))
+ grid_lat_size = int(math.ceil(360.0 / grid_degrees))
+ grid_lon_size = int(math.ceil(180.0 / grid_degrees))
space_grid_shape = (grid_lon_size, grid_lat_size) # TODO, is this the correct order?
# look through our files and figure out what variables we expect from them
Please sign in to comment.
Something went wrong with that request. Please try again.