Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in parameters.py file #3

Open
dliupmo opened this issue Oct 22, 2020 · 2 comments
Open

Problem in parameters.py file #3

dliupmo opened this issue Oct 22, 2020 · 2 comments

Comments

@dliupmo
Copy link

dliupmo commented Oct 22, 2020

The parameters "vgap_threshold" in parameters.py is 105e-6 now, so when using the _find_gap_voltage() function to calculate the gap voltage, Method 1 is always called, and Method 2 is never called. There will lead to incorrect calculation of gap voltage.

Please check it.

# Unpack keyword arguments
vgap_threshold = kw.get('vgap_threshold', PARAMS['vgap_threshold'])

# Method 1: current threshold
if vgap_threshold is not None:
    idx = np.abs(curr_a - vgap_threshold).argmin()
    vgap = volt_v[idx]
    return vgap

# Method 2: max derivative
vstep = volt_v[1] - volt_v[0]
mask = (1.5e-3 < volt_v) & (volt_v < 3.5e-3)
der = slope(volt_v[mask], curr_a[mask])
der = gauss_conv(der, sigma=0.2e-3 / vstep)
vgap = volt_v[mask][der.argmax()]
@dliupmo
Copy link
Author

dliupmo commented Oct 22, 2020

The parameters "vgap_threshold" in parameters.py should be "None"

@garrettj403
Copy link
Owner

Hi @dliupmo,

Sorry for the late reply. I've changed the default value of vgap_threshold to None (see commit 26f61d0).

In the future, I think a better option would be to have a vgap_method argument that would allow you to specify which method that you would like to use explicitly. I'll try to do this in the next week or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants