def test_match_resolution(): cube = MaNGADataCube.from_plateifu(7815, 3702, directory_path=remote_data_file()) tpl = TemplateLibrary('MILESHC', cube=cube, match_resolution=True, velscale_ratio=4, hardcopy=False) # Resolution should be virtually identical in unmasked regions indx = tpl['MASK'].data == 0 assert numpy.std(tpl.sres(tpl['WAVE'].data[indx[0]]) - tpl['SPECRES'].data[0,indx[0]]) < 0.1, \ 'Spectral resolution difference is above tolerance.'
def test_match_resolution(): cube = MaNGADataCube.from_plateifu(7815, 3702, directory_path=remote_data_file()) tpl = TemplateLibrary('MILESHC', cube=cube, match_resolution=True, velscale_ratio=4, hardcopy=False, output_path=remote_data_file()) # Resolution should be virtually identical in unmasked regions indx = tpl['MASK'].data == 0 assert numpy.std(tpl.sres(tpl['WAVE'].data[indx[0]]) - tpl['SPECRES'].data[0,indx[0]]) < 0.1, \ 'Spectral resolution difference is above tolerance.' # Check the file that would have been written has the expected path assert cube.directory_path == tpl.directory_path, 'Cube and TPL paths should match.' assert tpl.file_name().startswith( cube.output_root), 'TPL file should start with the cube root'