Trace sometimes starts with bad data #2

Open
opened 2025-07-07 22:30:11 -06:00 by brendanhaines · 0 comments

See in this plot how the S11 trace doesn't start until ~180MHz.
image.png

Note that frequency is the inner-most loop in this code.

Encountered with vna_dev.py in 339dbe255e.

Since all of these are relative measurements, that means that the a measurement (incident signal) has at least one time sample exactly equal to zero.

This output occasionally happens but only after a fresh "start". That doesn't mean power on reset but does mean a freshly initialized sdr. IDK if there's really anything I can do to make this not happen since I think it's happening in the Pluto but I can at least detect it and throw out data until it is good.

It appears that once I get good data it stays good indefinitely.

Details
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide
  s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0])
/home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce
  ret = umr_sum(arr, axis, dtype, out, keepdims, where=where)
See in this plot how the S11 trace doesn't start until ~180MHz. ![image.png](/attachments/7ee4cb29-1428-4fe2-8b76-608d33ae314c) Note that frequency is the inner-most loop in this code. Encountered with `vna_dev.py` in 339dbe255e32cdb4325a75f0bdb45f94583cb53d. Since all of these are relative measurements, that means that the `a` measurement (incident signal) has at least one time sample exactly equal to zero. This output occasionally happens but only after a fresh "start". That doesn't mean power on reset but does mean a freshly initialized sdr. IDK if there's really anything I can do to make this not happen since I think it's happening in the Pluto but I can at least detect it and throw out data until it is good. It appears that once I get good data it stays good indefinitely. <details> <summary>Details</summary> ```python /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: divide by zero encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/charon_vna/vna.py:343: RuntimeWarning: invalid value encountered in divide s.loc[dict(frequency=freq, m=m, n=n)] = np.mean(rx[1] / rx[0]) /home/brendan/Documents/projects/charon/.venv/lib/python3.10/site-packages/numpy/_core/_methods.py:135: RuntimeWarning: invalid value encountered in reduce ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) ``` </details>
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: brendanhaines/charon_vna#2
No description provided.