Patch CTF Error: Axis limits cannot be NaN or Inf

Dear users,

I encounter an error while running the Patch CTF job on CryoSPARC. It happened after processing the 4th micrograph.

The error message is as follows:
File “cryosparc_master/cryosparc_compute/run.py”, line 129, in cryosparc_master.cryosparc_compute.run.main File “cryosparc_master/cryosparc_compute/jobs/ctf_estimation/run.py”, line 400, in cryosparc_master.cryosparc_compute.jobs.ctf_estimation.run.run File “/blue/user/apps/cryosparc/cryosparc_worker/deps/anaconda/envs/cryosparc_worker_env/lib/python3.10/site-packages/matplotlib/pyplot.py”, line 1998, in ylim ret = ax.set_ylim(*args, **kwargs) File “/blue/user/apps/cryosparc/cryosparc_worker/deps/anaconda/envs/cryosparc_worker_env/lib/python3.10/site-packages/matplotlib/axes/_base.py”, line 3898, in set_ylim return self.yaxis._set_lim(bottom, top, emit=emit, auto=auto) File “/blue/user/apps/cryosparc/cryosparc_worker/deps/anaconda/envs/cryosparc_worker_env/lib/python3.10/site-packages/matplotlib/axis.py”, line 1210, in _set_lim v0 = self.axes._validate_converted_limits(v0, self.convert_units) File “/blue/user/apps/cryosparc/cryosparc_worker/deps/anaconda/envs/cryosparc_worker_env/lib/python3.10/site-packages/matplotlib/axes/_base.py”, line 3585, in _validate_converted_limits raise ValueError(“Axis limits cannot be NaN or Inf”) ValueError: Axis limits cannot be NaN or Inf

I am an inexperienced user and I was not able to find a way to fix this issue. Any help is greatly appreciated.

Edit:
I was able to solve the issue. I am typing for reference in case it can be useful for anyone.
I took note of the micrograph file name that causes the error message. I made a Curate exposures job and looked up that particular micrograph. It was a completely black image. I manually rejected it then ran the patch CTF job again. It proceeded without an error.

1 Like

Welcome to the forum @tct and thanks for sharing your solution!

1 Like

Hi tct,

we are having the same issue quite often with movies from our ‘old’ Glacios microscope.
The solution is as you described.

One other solution, for us at least, is to remove last 2 or 3 frames during Patch Motion Correction and in this way avoid getting ‘black’ micrographs (this are the ones that cause the error later during the Patch CTF job).

A suggestion for the CS team @wtempel
Perhaps you could make the Patch CTF fail gracefully, send a warninig and just move such micrographs to the ‘incomplete’ group? And continue without the entire job failing.

Best regards!

1 Like

Hi eMKiso,

Thank you for the suggestion, I will keep that in mind for the future.

Best regards!