lowlim = np.array([[0, 2.07, 0, 0], # fronting medium [15, 3.47, 0, 1], # 1st layer [200, 0.10, 0, 1], # 2nd layer [0, 6.36, 0, 1]]) # backing medium hilim = np.array([[0, 2.07, 0, 0], # fronting medium [50, 3.47, 0, 9], # 1st layer [300, 3.00, 0, 9], # 2nd layer [0, 6.36, 0, 9]]) # backing medium # create a linear array of the parameters # coefs[1] is the scale factor # coefs[6] is the background # these will both be 1 and 0 respectively to start off with coefs = reflect.convert_layer_format_to_coefs(layers) lowlim = reflect.convert_layer_format_to_coefs(lowlim) hilim = reflect.convert_layer_format_to_coefs(hilim) coefs[1] = 1.0 coefs[6] = 3.e-6 lowlim[1] = 0.6 hilim[1] = 1.2 lowlim[6] = 0. hilim[6] = 9e-6 bounds = zip(lowlim, hilim) # create a parameter instance
def test_format_conversion(self): coefs = reflect.convert_layer_format_to_coefs(self.layer_format) assert_equal(coefs, self.coefs)