ignore_pointing¶
- ignore_pointing(vis: str | list[str] | set[str])[source]¶
A context manager to ignore pointing tables of MSes during I/O operations.
The original pointing table will be temperarily renamed to POINTING_ORIGIN, and a new empty pointing table is created. When the context manager exits, the original table is restored.
For example, to ignore the pointing table of a MS during mstransform() calls, use:
- with ignore_pointing('test.ms'):
casatasks.mstransform(vis='test.ms',outputvis='test_output.ms',scan='16',datacolumn='data')
The pointing table of the output MS should be empty.
On the other hand, if the pointing table is needed in the output vis, e.g. for imaging with tclean(usepointing=True), we can manually create hardlinks of pointing table afterwards while minimizing the disk space usage:
import shutil, os shutil.rmtree('test_small.ms/POINTING') shutil.copytree('test.ms/POINTING', 'test_output.ms/POINTING', copy_function=os.link)
One can verify the inodes of the pointing table files, which should be the same:
ls -lih test.ms/POINTING ls -lih test_small.ms/POINTING