keflavich / cube-line-extractor

4 stars 1 forks source link

Setting apply_width_mask to False results in error #3

Closed jmangum closed 7 years ago

jmangum commented 7 years ago

Setting apply_width_mask=False in the definition for cubelinemoment_multiline leads to the following error:

---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)
/Users/jmangum/Python/mangum_galaxies-master/CubeLineMoment.py in <module>()
    577
    578 if __name__ == "__main__":
--> 579     new_locals = main()
    580     locals().update(new_locals)

/Users/jmangum/Python/mangum_galaxies-master/CubeLineMoment.py in main()
    532                              centroid_map=centroid_map, max_map=max_map,
    533                              noisemap=noisemap, width_map=width_map, fit=False,
--> 534                              **params)
    535
    536     params.pop('signal_mask_limit')

/Users/jmangum/Python/mangum_galaxies-master/CubeLineMoment.py in cubelinemoment_multiline(cube, peak_velocity, centroid_map, max_map, noisemap, signal_mask_limit, my_line_list, my_line_widths, my_line_names, target, spatial_mask, width_map, width_map_scaling, width_cut_scaling, fit, apply_width_mask, **kwargs)
    369             pl.subplot(2,2,3).imshow(signal_mask.include().max(axis=0), origin='lower', interpolation='nearest')
    370         pl.subplot(2,2,3).set_title("signal mask")
--> 371         pl.subplot(2,2,4).imshow(width_mask_cube.max(axis=0), origin='lower', interpolation='nearest')
    372         pl.subplot(2,2,4).set_title("width mask")
    373         pl.savefig("DEBUG_plot_{0}_{1}_widthscale{2:0.1f}_sncut{3:0.1f}_widthcutscale{4:0.1f}.png"

UnboundLocalError: local variable 'width_mask_cube' referenced before assignment