Ejemplo n.º 1
0
def test_LatGaussFitFR():
    from PYME.localization.Test import fitTestJigWC as fitTestJig
    
    tj = fitTestJig.fitTestJig.fromMDFile(os.path.join(TESTPATH, 'gauss.md'))
    tj.runTests(nTests=100)
    
    errors_over_pred_IQR = fitTestJig.IQR((tj.error('x0') / tj.res['fitError']['x0']))
    print(errors_over_pred_IQR)
    
    assert errors_over_pred_IQR < 2.5
Ejemplo n.º 2
0
def test_Dumbell3DFitR():
    from PYME.localization.Test import fitTestJigWC as fitTestJig
    
    tj = fitTestJig.fitTestJig.fromMDFile(os.path.join(TESTPATH, 'dumbell_3d.md'))
    tj.runTests(nTests=100)
    
    def error(tj, varName0, varName1):
        xv = tj.ps[varName0].ravel()
        yv = tj.res['fitResults'][varName1]
        if hasattr(tj, varName0):
            yv = yv + tj.__getattribute__(varName0)
        
        return yv - xv
    
    errors_over_pred_IQR0 = fitTestJig.IQR((error(tj, 'x0', 'x0') / tj.res['fitError']['x0']))
    errors_over_pred_IQR1 = fitTestJig.IQR((error(tj, 'x0', 'x1') / tj.res['fitError']['x1']))
    errors_over_pred_IQR = min(errors_over_pred_IQR0, errors_over_pred_IQR1)
    print(errors_over_pred_IQR0, errors_over_pred_IQR1)
    
    assert errors_over_pred_IQR < 7.0
Ejemplo n.º 3
0
def test_SplitterFitInterpNR_astigmatism():
    """Test the 3D interpolated fit by fitting some randomly generated events. The pass condition here is fairly
    loose, but should be sufficient to detect when the code has been broken"""
    from PYME.localization.Test import fitTestJigWC as fitTestJig
    
    tj = fitTestJig.fitTestJig.fromMDFile(os.path.join(TESTPATH, 'astig_splitter.md'))
    tj.runTests(nTests=100)
    
    errors_over_pred_IQR = fitTestJig.IQR((tj.error('x0') / tj.res['fitError']['x0']))
    print(errors_over_pred_IQR)
    
    assert errors_over_pred_IQR < 2.5