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

Add ABI L1B system tests #232

Merged
merged 1 commit into from
Mar 20, 2018
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions satpy/tests/features/feature-real-load-process-write.feature
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Feature: Loading real data in many formats with the same command
Examples: ABI L1 data
| format | composite | area |
| abi_l1b | overview | - |
| abi_l1b | true_color | - |
| abi_l1b | true_color | north_america |
| abi_l1b | airmass | - |
| abi_l1b | natural | - |

# Examples: ACSPO data
# | format | composite | area |
Expand Down
18 changes: 12 additions & 6 deletions satpy/tests/features/steps/steps-real-load-process-write.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def step_impl(context, dformat):
context.data_path = data_path


@when(u'the user loads the {composite} composite')
@when(u'the user loads the {composite} composite') # noqa
def step_impl(context, composite):
from satpy import Scene
scn = Scene(reader=context.dformat,
Expand All @@ -98,22 +98,28 @@ def step_impl(context, composite):
context.composite = composite


@when(u'the user resamples the data to {area}')
@when(u'the user resamples the data to {area}') # noqa
def step_impl(context, area):
context.lscn = context.scn.resample(area)
if area != '-':
context.lscn = context.scn.resample(area)
else:
context.lscn = context.scn.resample(resampler='native')
context.area = area


@when(u'the user saves the composite to disk')
@when(u'the user saves the composite to disk') # noqa
def step_impl(context):
with NamedTemporaryFile(suffix='.png', delete=False) as tmp_file:
context.lscn.save_dataset(context.composite, filename=tmp_file.name)
context.new_filename = tmp_file.name


@then(u'the resulting image should match the reference image')
@then(u'the resulting image should match the reference image') # noqa
def step_impl(context):
ref_filename = context.composite + "_" + context.area + ".png"
if context.area == '-':
ref_filename = context.composite + ".png"
else:
ref_filename = context.composite + "_" + context.area + ".png"
ref_filename = os.path.join(context.data_path, "ref", ref_filename)
assert os.path.exists(ref_filename), "Missing reference file."
assert_images_match(ref_filename, context.new_filename)
Expand Down