def test_get_center_attr_err(): """if no center provided for modes that are not IFU, center is assigned to (0.0, 0.0)""" datmod = MultiSlitModel() x_pos, y_pos = get_center("NRS_MSASPEC", datmod) assert(x_pos==y_pos==0.0)
def test_get_center_exptype(): """ If exptype is "NRS_MSASPEC" | "NRS_FIXEDSLIT" | "NRS_BRIGHTOBJ" and source_xpos and source_ypos exist in datamod.slits, make sure it's returned""" datmod = MultiSlitModel() datmod.slits.append({'source_xpos':1, 'source_ypos':2}) for exptype in ["NRS_MSASPEC", "NRS_FIXEDSLIT", "NRS_BRIGHTOBJ"]: x_pos, y_pos = get_center(exptype, datmod.slits[0]) assert(x_pos==1) assert(y_pos==2)
def test_get_center_exp_type(): """if exp_type is not in NRS, center is returned (0.0,0.0)""" datmod = MultiSlitModel() x_pos, y_pos = get_center("NRC_IMAGE", datmod) assert(x_pos==y_pos==0.0)
def test_get_center_ifu(): """get_center assumes IFU targets are centered @ (0.0, 0.0)""" x_pos,y_pos = get_center("NRS_IFU", None) assert(x_pos==y_pos==0.0)