Skip to content

Commit

Permalink
removed nearest
Browse files Browse the repository at this point in the history
  • Loading branch information
sliu008 committed Mar 7, 2024
1 parent a34d28d commit d54539a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
22 changes: 6 additions & 16 deletions podaac/tig/tig.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,13 @@ def get_swot_expert_data(self, group):

return lon_array, lat_array, var_array

def generate_images(self, image_format='png', nearest=False, world_file=False, granule_id=""):
def generate_images(self, image_format='png', world_file=False, granule_id=""):
"""
Generates images for each configured variable in a NetCDF file.
Parameters
----------
image_format : string
Any output image formatted supported by matplotlib
nearest : bool
Fill in values from the nearest grid cell to match pixel resolution
world_file : bool
Output an Esri world file for each image that can be used by GIS tools
granule_id : string
Expand All @@ -403,20 +401,18 @@ def generate_images(self, image_format='png', nearest=False, world_file=False, g
output_images = []
if self.config.get('multi_lon_lat'):
for group in self.config.get('multi_groups'):
output_images += self.generate_images_group(image_format, nearest, world_file, granule_id, group=group)
output_images += self.generate_images_group(image_format, world_file, granule_id, group=group)
else:
output_images = self.generate_images_group(image_format, nearest, world_file, granule_id, group=None)
output_images = self.generate_images_group(image_format, world_file, granule_id, group=None)
return output_images

def generate_images_group(self, image_format='png', nearest=False, world_file=False, granule_id="", group=None):
def generate_images_group(self, image_format='png', world_file=False, granule_id="", group=None):
"""
Generates images for each configured variable in a NetCDF file.
Parameters
----------
image_format : string
Any output image formatted supported by matplotlib
nearest : bool
Fill in values from the nearest grid cell to match pixel resolution
world_file : bool
Output an Esri world file for each image that can be used by GIS tools
granule_id : string
Expand Down Expand Up @@ -484,7 +480,6 @@ def generate_images_group(self, image_format='png', nearest=False, world_file=Fa
lat_array,
alpha,
image_format,
nearest,
world_file,
granule_id,
group,
Expand Down Expand Up @@ -584,7 +579,6 @@ def process_variable(self,
lat_array,
alpha,
image_format='png',
nearest=False,
world_file=False,
granule_id="",
param_group=None,
Expand All @@ -604,8 +598,6 @@ def process_variable(self,
Whether or not the image should contain an alpha channel
image_format : string
Any output image formatted supported by imageio
nearest : bool
Fill in values from the nearest grid cell to match pixel resolution
world_file : bool
Output an Esri world file for each image that can be used by GIS tools
granule_id : string
Expand Down Expand Up @@ -664,8 +656,7 @@ def process_variable(self,
lat_array,
fill_value,
rows,
cols,
nearest)
cols)
output_vals[output_vals == fill_value] = np.nan
out_array = np.flip(output_vals.flatten().reshape(rows, cols), 0)

Expand Down Expand Up @@ -709,8 +700,7 @@ def generate_image_output(self,
lat_array,
fill_value,
rows,
cols,
nearest # pylint: disable=unused-argument
cols
):
"""
Generates output that matches image extents using discrete global grids
Expand Down
1 change: 0 additions & 1 deletion regression_test/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def download_configs(config_dir):
api_url = f"https://api.github.com/repos/podaac/forge-tig-configuration/contents/config-files"
response = requests.get(api_url)

i = 0
if response.status_code == 200:
for file in response.json():
url = file.get('download_url')
Expand Down

0 comments on commit d54539a

Please sign in to comment.