Skip to content

Commit

Permalink
update tests to remove filenames as input parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
jemorrison committed Apr 3, 2023
1 parent 9d57732 commit 8d1466e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 38 deletions.
3 changes: 0 additions & 3 deletions jwst/cube_build/cube_build_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ def process(self, input):
self.log.info("Number of Single IFUCube models returned %i ",
len(cube_container))



# Else standard IFU cube building - the result returned from build_ifucube will be 1 IFU CUBR
else:
result, status = thiscube.build_ifucube()
Expand All @@ -350,7 +348,6 @@ def process(self, input):

del thiscube


# irrelevant WCS keywords we will remove from final product
rm_keys = ['v2_ref', 'v3_ref', 'ra_ref', 'dec_ref', 'roll_ref',
'v3yangle', 'vparity']
Expand Down
28 changes: 5 additions & 23 deletions jwst/cube_build/tests/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ def test_calspec2_config(_jail, miri_ifushort_short):
input_models = []
input_filenames = []
input_models.append(miri_ifushort_short)
input_filenames.append(input_file)

pars = {
'channel': pars_input['channel'],
Expand All @@ -232,13 +231,12 @@ def test_calspec2_config(_jail, miri_ifushort_short):

cubeinfo = cube_build.CubeData(
input_models,
input_filenames,
par_filename,
**pars)

master_table = file_table.FileTable()
this_instrument = master_table.set_file_table(
cubeinfo.input_models, cubeinfo.input_filenames)
cubeinfo.input_models)

assert this_instrument == 'MIRI'

Expand Down Expand Up @@ -268,9 +266,6 @@ def test_calspec3_config_miri(_jail, miri_full_coverage):

input_file = 'test.fits'
num_files = len(miri_full_coverage)
input_filenames = []
for i in range(num_files):
input_filenames.append(input_file)

pars = {
'channel': pars_input['channel'],
Expand All @@ -283,13 +278,12 @@ def test_calspec3_config_miri(_jail, miri_full_coverage):

cubeinfo = cube_build.CubeData(
miri_full_coverage,
input_filenames,
par_filename,
**pars)

master_table = file_table.FileTable()
this_instrument = master_table.set_file_table(
cubeinfo.input_models, cubeinfo.input_filenames)
cubeinfo.input_models)

assert this_instrument == 'MIRI'

Expand Down Expand Up @@ -348,9 +342,6 @@ def test_calspec3_config_miri_multi(_jail, miri_full_coverage):

input_file = 'test.fits'
num_files = len(miri_full_coverage)
input_filenames = []
for i in range(num_files):
input_filenames.append(input_file)

pars = {
'channel': pars_input['channel'],
Expand All @@ -363,13 +354,12 @@ def test_calspec3_config_miri_multi(_jail, miri_full_coverage):

cubeinfo = cube_build.CubeData(
miri_full_coverage,
input_filenames,
par_filename,
**pars)

master_table = file_table.FileTable()
this_instrument = master_table.set_file_table(
cubeinfo.input_models, cubeinfo.input_filenames)
cubeinfo.input_models)

assert this_instrument == 'MIRI'

Expand Down Expand Up @@ -409,9 +399,6 @@ def test_calspec3_config_nirspec(_jail, nirspec_medium_coverage):

input_file = 'test.fits'
num_files = len(nirspec_medium_coverage)
input_filenames = []
for i in range(num_files):
input_filenames.append(input_file)

pars = {
'channel': pars_input['channel'],
Expand All @@ -424,13 +411,12 @@ def test_calspec3_config_nirspec(_jail, nirspec_medium_coverage):

cubeinfo = cube_build.CubeData(
nirspec_medium_coverage,
input_filenames,
par_filename,
**pars)

master_table = file_table.FileTable()
this_instrument = master_table.set_file_table(
cubeinfo.input_models, cubeinfo.input_filenames)
cubeinfo.input_models)

assert this_instrument == 'NIRSPEC'

Expand Down Expand Up @@ -464,9 +450,6 @@ def test_calspec3_config_nirspec_multi(_jail, nirspec_medium_coverage):

input_file = 'test.fits'
num_files = len(nirspec_medium_coverage)
input_filenames = []
for i in range(num_files):
input_filenames.append(input_file)

pars = {
'channel': pars_input['channel'],
Expand All @@ -479,13 +462,12 @@ def test_calspec3_config_nirspec_multi(_jail, nirspec_medium_coverage):

cubeinfo = cube_build.CubeData(
nirspec_medium_coverage,
input_filenames,
par_filename,
**pars)

master_table = file_table.FileTable()
this_instrument = master_table.set_file_table(
cubeinfo.input_models, cubeinfo.input_filenames)
cubeinfo.input_models)

assert this_instrument == 'NIRSPEC'

Expand Down
8 changes: 1 addition & 7 deletions jwst/cube_build/tests/test_miri_cubepars.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_miri_use_cubepars(_jail, miri_cube_pars):
'spaxel_debug': None}

pipeline = 3
filename = None

input_model = None
output_name_base = None
output_type = 'band'
Expand All @@ -160,7 +160,6 @@ def test_miri_use_cubepars(_jail, miri_cube_pars):
instrument_info = instrument_info
this_cube = ifu_cube.IFUCubeData(
pipeline,
filename,
input_model,
output_name_base,
output_type,
Expand Down Expand Up @@ -253,7 +252,6 @@ def test_miri_cubepars_user_defaults(_jail, miri_cube_pars):
'spaxel_debug': None}

pipeline = 3
filename = None
input_model = None
output_name_base = None
output_type = 'band'
Expand All @@ -264,7 +262,6 @@ def test_miri_cubepars_user_defaults(_jail, miri_cube_pars):
instrument_info = instrument_info
this_cube = ifu_cube.IFUCubeData(
pipeline,
filename,
input_model,
output_name_base,
output_type,
Expand Down Expand Up @@ -320,7 +317,6 @@ def test_miri_cubepars_user_defaults(_jail, miri_cube_pars):

this_cube = ifu_cube.IFUCubeData(
pipeline,
filename,
input_model,
output_name_base,
output_type,
Expand Down Expand Up @@ -429,7 +425,6 @@ def test_miri_cubepars_multiple_bands(_jail, miri_cube_pars):
'spaxel_debug': None}

pipeline = 3
filename = None
input_model = None
output_name_base = None
output_type = 'multi'
Expand All @@ -440,7 +435,6 @@ def test_miri_cubepars_multiple_bands(_jail, miri_cube_pars):
instrument_info = instrument_info
this_cube = ifu_cube.IFUCubeData(
pipeline,
filename,
input_model,
output_name_base,
output_type,
Expand Down
3 changes: 0 additions & 3 deletions jwst/cube_build/tests/test_nirspec_cubepars.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ def test_nirspec_cubepars(_jail, nirspec_cube_pars):
'spaxel_debug': None}

pipeline = 3
filename = None
input_model = None
output_name_base = None
output_type = 'band'
Expand All @@ -187,7 +186,6 @@ def test_nirspec_cubepars(_jail, nirspec_cube_pars):
instrument_info = instrument_info
this_cube = ifu_cube.IFUCubeData(
pipeline,
filename,
input_model,
output_name_base,
output_type,
Expand Down Expand Up @@ -244,7 +242,6 @@ def test_nirspec_cubepars(_jail, nirspec_cube_pars):

this_cube = ifu_cube.IFUCubeData(
pipeline,
filename,
input_model,
output_name_base,
output_type,
Expand Down
2 changes: 0 additions & 2 deletions jwst/cube_build/tests/test_wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ def test_setup_wcs():
'spaxel_debug': None}

pipeline = 3
filename = None
input_model = None
output_name_base = None
output_type = None
Expand All @@ -213,7 +212,6 @@ def test_setup_wcs():
instrument_info = None
thiscube = ifu_cube.IFUCubeData(
pipeline,
filename,
input_model,
output_name_base,
output_type,
Expand Down

0 comments on commit 8d1466e

Please sign in to comment.