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

Implementing V1.1 #1224

Closed
radonnachie opened this issue Nov 16, 2022 · 6 comments · Fixed by #1225
Closed

Implementing V1.1 #1224

radonnachie opened this issue Nov 16, 2022 · 6 comments · Fixed by #1225

Comments

@radonnachie
Copy link
Contributor

I'm updating my V1.0 implementation to write out V1.1 (repo).

This meant implementing the /Header/phase_center_catalog/# groups.

I'm verifying my file by ingesting it with pyuvdata:
UVData().read(args.filepath)

I encounter an error because pyuvdata is not triggered to believe that the file is V1.1, and fails to find the datasets it expects from a V1.0 file: at uvh5.py:329 because "phase_type" doesn't exist.

I see in the source code that pyuvdata needs to have self.multi_phase_center evaluate positively in order for the file to be treated as V1.1 and I can only interpret that I have to put a boolean multi_phase_center dataset in the /Header group in order to get that to happen.

If that's the requirement, could it be revised or at least documented? Thanks folks.

pyuvdata in /home/radonn/.local/lib/python3.8/site-packages (2.2.10)
@bhazelton
Copy link
Member

Hi @radonnachie,

Sorry about that! This is a code bug not a mistake in the documentation. I opened a PR to fix it, see #1225.

@radonnachie
Copy link
Contributor Author

Epic! Thanks.

@radonnachie
Copy link
Contributor Author

I now encounter an error due to a lack of Nphase.

This also isn't documented anywhere. I anticipate the len() of the catalog dataset should suffice, but perhaps that breaks form and so Nphase should be placed alongside Npols/Ntime etc...

Traceback (most recent call last):
  File "../check_uvh5.py", line 9, in <module>
    uv = UVD.read(args.filepath)
  File "/home/radonn/.local/lib/python3.8/site-packages/pyuvdata/uvdata/uvdata.py", line 12704, in read
    self.read_uvh5(
  File "/home/radonn/.local/lib/python3.8/site-packages/pyuvdata/uvdata/uvdata.py", line 11714, in read_uvh5
    uvh5_obj.read_uvh5(
  File "/home/radonn/.local/lib/python3.8/site-packages/pyuvdata/uvdata/uvh5.py", line 1013, in read_uvh5
    self._read_header(
  File "/home/radonn/.local/lib/python3.8/site-packages/pyuvdata/uvdata/uvh5.py", line 297, in _read_header
    self.Nphase = int(header["Nphase"][()])
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/home/radonn/.local/lib/python3.8/site-packages/h5py/_hl/group.py", line 328, in __getitem__
    oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5o.pyx", line 190, in h5py.h5o.open
KeyError: "Unable to open object (object 'Nphase' doesn't exist)"

@radonnachie
Copy link
Contributor Author

radonnachie commented Dec 5, 2022

Writing the length of the catalog to /Header/Nphase satisfies it. No further issues AFAICT.

@radonnachie
Copy link
Contributor Author

@bhazelton Should I open another issue in mimicry for the lack of Nphase in documentation? In 72 hours I'll get around to a PR for this if it's not tackled by then.

@bhazelton
Copy link
Member

sure, that'd be great. We made a release to get the other fix out but had a problem with putting it on pypi. We're working on resolving that now.

radonnachie added a commit to MydonSolutions/pyuvdata that referenced this issue Dec 8, 2022
radonnachie added a commit to MydonSolutions/pyuvdata that referenced this issue Dec 12, 2022
bhazelton pushed a commit that referenced this issue Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants