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

trf.estimate gives error due to empty pts_target array #4

Open
RubenImhoff opened this issue Feb 13, 2019 · 5 comments
Open

trf.estimate gives error due to empty pts_target array #4

RubenImhoff opened this issue Feb 13, 2019 · 5 comments

Comments

@RubenImhoff
Copy link

Hi Georgy,

With a small test for a local event, I got the following error when running the Sparse model:

<C:\Anaconda\lib\site-packages\numpy\core\fromnumeric.py:2909: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
C:\Anaconda\lib\site-packages\numpy\core_methods.py:73: RuntimeWarning: invalid value encountered in true_divide
ret, rcount, out=ret, casting='unsafe', subok=False)
C:\Anaconda\lib\site-packages\skimage\transform_geometric.py:53: RuntimeWarning: invalid value encountered in double_scalars
rms = math.sqrt(np.sum((points - centroid) ** 2) / points.shape[0])
Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/imhof_rn/Documents/Scripts/RainyMotion_Catchment.py', wdir='C:/Users/imhof_rn/Documents/Scripts')

File "C:\Anaconda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)

File "C:\Anaconda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 87, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/Users/imhof_rn/Documents/Scripts/RainyMotion_Catchment.py", line 276, in
optical_flow(data, eval_idx, results, "Sparse")

File "C:/Users/imhof_rn/Documents/Scripts/RainyMotion_Catchment.py", line 191, in optical_flow
nowcast = model.run()

File "build\bdist.win-amd64\egg\rainymotion\models.py", line 215, in run
trf.estimate(pts_source, pts_target)

File "C:\Anaconda\lib\site-packages\skimage\transform_geometric.py", line 679, in estimate
_, _, V = np.linalg.svd(A)

File "C:\Anaconda\lib\site-packages\numpy\linalg\linalg.py", line 1368, in svd
_assertNoEmpty2d(a)

File "C:\Anaconda\lib\site-packages\numpy\linalg\linalg.py", line 226, in _assertNoEmpty2d
raise LinAlgError("Arrays cannot be empty")

LinAlgError: Arrays cannot be empty>

It seems that pts_target is an empty array for that time step, even though all data files seems okay and contain data.
Are you familiar with this error?

To make it reproducible, I have added the data in a zip-file. It's a case with data from the Dutch KNMI (rows = 765, cols = 700, temp interval = 5 min.) and I use a lead time of 6 hours (72 steps).

If you need any more information, let me know!

Thanks!

Ruben

@RubenImhoff
Copy link
Author

Odd, github seems to have a bad day. The code did not show up as code and I believe no zip-file attached..

@hydrogo
Copy link
Owner

hydrogo commented Feb 14, 2019

Hi Ruben,

Could you, please, send me an email with your code and data? ayzel AT uni-potsdam.de

I will try to reproduce the problem.

At first glance, the problem is in corners identification -- probably, no corners were identified, so it is impossible to calculate transformation matrix (at least four corners are needed).

@RubenImhoff
Copy link
Author

Hi Georgy,

I tried this case again with the same data, but minus the first two hours (I seemed to go wrong after 50 minutes or so) and that worked perfectly.
Hence, I think the problem is in the data. Possibly something is indeed wrong with one of the corners..

I'll study the data and I will let you know if I can't find any issues there. For now, I think we can close this issue.

Thanks!

@hydrogo
Copy link
Owner

hydrogo commented Feb 14, 2019

By the way, we have substantially improved the Dense group of 'rainymotion' models -- at the moment they are both efficient and fast. You can try them too.

And thank you for your reports!

@RubenImhoff
Copy link
Author

That's great news, I'll try it out!

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