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

SPWs with different channel numbers causes crash (even if only one SPW is referenced in the main table) #85

Open
IanHeywood opened this issue Dec 22, 2020 · 3 comments

Comments

@IanHeywood
Copy link
Collaborator

I think this might be a CASA bug rather than a shadems bug, as I don't think the former updates the SPW table after Hanning smoothing has been applied, but:

2020-12-22 17:22:16 - shadems - INFO - : Indexing MS and building dataframes (167778 rows, chunk size is 5000
)
.008705092594_spw27_hanning-minmax-cache.json
2020-12-22 17:22:16 - shadems - INFO - axis: FREQ, range (None, None), discretization None
2020-12-22 17:22:16 - shadems - INFO - axis: amp(CORRECTED_DATA), corr 3, range (None, None), discretization
None
2020-12-22 17:22:16 - shadems - INFO - axis: _(ANTENNA1), corr False, range (None, None), discretization 27
2020-12-22 17:22:16 - shadems - INFO - axis: amp(CORRECTED_DATA), corr 0, range (None, None), discretization
None
2020-12-22 17:22:16 - shadems - INFO -                  : you have asked for 2 plots employing 4 unique datum
s
2020-12-22 17:22:16 - shadems - INFO - : Indexing MS and building dataframes (167778 rows, chunk size is 5000
)
Traceback (most recent call last):
  File "/usr/local/bin/shadems", line 8, in <module>
    main.main([a for a in sys.argv[1:]])
  File "/usr/local/lib/python3.6/dist-packages/shade_ms/main.py", line 675, in main
    row_chunk_size=options.row_chunk_size)
  File "/usr/local/lib/python3.6/dist-packages/shade_ms/data_plots.py", line 199, in get_plot_data
    f"{axis.mapper.fullname}: size {value.shape[0]}, expected {shape[timefreq_axis]}"
AssertionError: frequency: size 64, expected 128

wsclean also crashed with a very similar message:

>>> An invalid channel range was specified! Measurement set only has 64 channels, requested imaging range is 64 -- 128.
@IanHeywood
Copy link
Collaborator Author

Actually hanningsmooth might not be the culprit. The parent MS has a mixture of X-band and P-band in the SPW table (X-band being a pointing scan I guess). The X-band SPWs (0-15) all have 64 channels, the P-band SPWs have 128...

@o-smirnov
Copy link
Collaborator

Ah! Now that's an open problem in shadeMS. I was lazy -- there's some shortcuts in there that make assumptions about SPW/DDID. Need to go in and clean that up.

How were you so unfortunate as to end up with an MS like that? Why not keep them separate?

@IanHeywood
Copy link
Collaborator Author

It arrived like this from the archive. There are 16 X-band SPWs that are not referenced by any rows in the main table, which is what made me think it was a pointing scan (I didn't make the SBs).

My first attempt to process this involved using mstransform to split out SPWs 16-31 containing just the P-band data. I then ran split-ms-spw.py to get a MS per SPW. This preserves the full SPECTRAL_WINDOW table, even though the main table only references one row in it, which is what seems to be causing the tricolour issue.

My second attempt I skipped the mstransform step and went straight for split-ms-spw.py. This took the X-band SPWs with it, and the varying number of channels between the two halves of the SPW table are (I guess) what's causing this trouble.

So I do want to keep it all separate, firstly because this is going to be a very hands-on reduction and it's more manageable this way, and secondly because having multiple SPWs seems to be a complete pain in the ass for all my favourite software.

@IanHeywood IanHeywood changed the title Plotting MS following Hanning smoothing (using CASA) fails SPWs with different channel numbers causes crash (even if only on SPW is referenced in the main table) Dec 22, 2020
@IanHeywood IanHeywood changed the title SPWs with different channel numbers causes crash (even if only on SPW is referenced in the main table) SPWs with different channel numbers causes crash (even if only one SPW is referenced in the main table) Dec 22, 2020
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