コード例 #1
0
ファイル: test_MercuryiPS.py プロジェクト: tyqh03/Qcodes
def driver_spher_lim():

    def spherical_limits(x, y, z):
        """
        Checks that the field is inside a sphere of radius 2
        """
        return np.sqrt(x**2 + y**2 + z**2) <= 2

    mips_sl = MercuryiPS('mips_sl', address='GPIB::1::INSTR',
                         visalib=visalib, field_limits=spherical_limits)

    yield mips_sl
    mips_sl.close()
コード例 #2
0
ファイル: test_MercuryiPS.py プロジェクト: tyqh03/Qcodes
def driver_cyl_lim():
    def cylindrical_limits(x, y, z):
        """
        Checks that the field is inside a particular cylinder
        """
        rho_check = np.sqrt(x**2 + y**2) <= 2
        z_check = z < 3 and z > -1

        return rho_check and z_check

    mips_cl = MercuryiPS('mips_cl', address='GPIB::1::INSTR',
                         visalib=visalib, field_limits=cylindrical_limits)

    yield mips_cl
    mips_cl.close()
コード例 #3
0
def test_wrong_field_limit_raises():
    # check that a non-callable input fails
    with pytest.raises(ValueError):
        MercuryiPS('mips',
                   address='GPIB::1::INSTR',
                   visalib=visalib,
                   field_limits=0)
コード例 #4
0
ファイル: test_MercuryiPS.py プロジェクト: tyqh03/Qcodes
def driver():
    mips = MercuryiPS('mips', address='GPIB::1::INSTR',
                      visalib=visalib)
    yield mips
    mips.close()