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

Gaintables cannot be written in Python 3 mode due to current casacore implementation issues #440

Open
o-smirnov opened this issue Mar 4, 2021 · 13 comments
Assignees

Comments

@o-smirnov
Copy link
Collaborator

Are there still casacore issues blocking this?

@caseyjlaw
Copy link

I'd like to understand this issue. Can someone tag the other relevant discussions here? Also, is the recommended workaround to reinstall with the entire python2 stack?

@o-smirnov
Copy link
Collaborator Author

Well there was this: #269

But I do have a nagging suspicion we can just disable the warning and let it write the damn tables and see if anything breaks. There was a nasty interregnum when python3-casacore had some teething issues, and that's when @bennahugo put this in. I believe the upstream issues have now been solved.

@bennahugo
Copy link
Collaborator

bennahugo commented Mar 29, 2021

it has been an issue on my list. Unfortunately haven't got back to this yet as I'm trying to roll a release for killms at the moment. You can try removing the warnings, however it may be that you need to add UTF-8 encoding to the columns meant to contain casacore::string types like the antenna name column, etc. Unfortunately you cannot roll back to python 2.7. We no longer support it. In the interm you can always plot the cubical native paramdb tables from ipython?

@bennahugo
Copy link
Collaborator

@caseyjlaw
Copy link

caseyjlaw commented Mar 29, 2021

Thanks for the quick feedback, all.
I have commented out the lines that stop execution of saving calibration information. After rebuilding, I demonstrated that I can run cubical and that it saves paramdb files. I can read them into an ipython session and make plots of amplitude and phase of bandpasses. Is that sufficient to test this issue?
Incidentally, I'm a bit confused as to why casacore is required to write these paramdb files. They seem to be python data structures, so how is casacore used?

@JSKenyon
Copy link
Collaborator

JSKenyon commented Mar 30, 2021 via email

@o-smirnov
Copy link
Collaborator Author

Yep, paramdb is the native format and it is always written. The CASA table export is the extra feature that's been disabled. @JSKenyon if you can take a look what's up there, that'd be great.

@caseyjlaw another plotting option (for parmdb files) are the plot-xxx-solutions scripts in CubiCal.

@JSKenyon
Copy link
Collaborator

There are definitely still problems to be solved. I removed all the checks and run into conformance errors. I am doing a little digging now to see if I can figure out if there is an easy fix.

@JSKenyon
Copy link
Collaborator

Ah - I can see where at least one conformance error comes from. It looks like some of the subtables in the casa gain table end up with the wrong number of rows e.g. 40 rows get added, but then a putcol is attempted with 28 rows. Trying to figure out why it happens.

@JSKenyon
Copy link
Collaborator

@bennahugo I think you may be better suited to chase this further. What I have found is that the blank table actually contains a non-zero number of rows. Thus, when we do table.addrows, we actually end up with excess rows and conformance errors when we attempt to write to the table. I am not sure if the blank table just needs to be replaced/fixed (something you are more familiar with than me).

@JSKenyon
Copy link
Collaborator

For reference, the problems seem to be caused by code like:

t.addrows(nrows=len(db.anttype))

@bennahugo
Copy link
Collaborator

bennahugo commented Mar 30, 2021 via email

@JSKenyon
Copy link
Collaborator

JSKenyon commented Apr 1, 2021

Just a heads up that #448 may fix this for anyone wanting to take it for a spin.

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

No branches or pull requests

4 participants