def test_3Q_VAS_general(): """3Q-VAS method test""" mth = ThreeQ_VAS(channels=["87Rb"], spectral_dimensions=[{}, {}]) assert mth.name == "ThreeQ_VAS" assert mth.description == "Simulate a 3Q variable-angle spinning spectrum." assert mth.spectral_dimensions[0].events[0].transition_query == [ TransitionQuery(ch1={ "P": [-3], "D": [0] }) ] assert mth.spectral_dimensions[1].events[0].transition_query == [ TransitionQuery(ch1={ "P": [-1], "D": [0] }) ] assert ThreeQ_VAS.parse_dict_with_units(mth.json()) == mth assert np.allclose(mth.affine_matrix, [0.5625, 0.4375, 0.0, 1.0]) serialize = mth.json() _ = serialize.pop("affine_matrix") assert serialize == { "channels": ["87Rb"], "description": "Simulate a 3Q variable-angle spinning spectrum.", "name": "ThreeQ_VAS", **sample_test_output(-3), }
def test_3Q_VAS_general(): """3Q-VAS method test""" mth = ThreeQ_VAS(channels=["87Rb"], spectral_dimensions=[{}, {}]) assert mth.name == "ThreeQ_VAS" assert mth.description == "Simulate a 3Q variable-angle spinning spectrum." assert mth.spectral_dimensions[0].events[ 0].transition_query == TransitionQuery(P={"channel-1": [[-3]]}, D={"channel-1": [[0]]}) assert mth.spectral_dimensions[1].events[ 0].transition_query == TransitionQuery(P={"channel-1": [[-1]]}, D={"channel-1": [[0]]}) assert Method.parse_dict_with_units(mth.json()) == mth
def test_3QMAS(): """3Q MAS correlation method declaration""" mth = ThreeQ_VAS( channels=["87Rb"], magnetic_flux_density=9.4, # in T spectral_dimensions=[ { "count": 512, "spectral_width": 5e6 }, { "count": 128, "spectral_width": 5e4 }, ], ) assert np.allclose(mth.affine_matrix, [0.5625, 0.4375, 0, 1]) assert ThreeQ_VAS.parse_dict_with_units(mth.json()) == mth