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

Closing MS cleanly #9

Open
iniyannatarajan opened this issue Aug 2, 2023 · 0 comments
Open

Closing MS cleanly #9

iniyannatarajan opened this issue Aug 2, 2023 · 0 comments

Comments

@iniyannatarajan
Copy link

I am using some casatools and casatasks with PythonCall for some functionality currently unavailable in Casacore.jl. Once I open an MS in Update mode and write some data into it, it seems like there is no way to close or free it for further manipulation by a different module. Is there a clean way to close an MS so that I can use casatools/casatasks on it?

For instance, I write some data into an MS using Casacore.jl and then want to use exportuvfits() on it. This is what I get when I call exportuvfits from my code:

[ Info: Creating test.uvfits from test.ms...
2023-08-02 17:51:06     SEVERE  exportuvfits::ms::open  Exception Reported: RegularFileIO: error in open or create of file /home/iniyan/software/dev/Anime.jl/examples/output/test.ms/table.f2: No such file or directory
2023-08-02 17:51:06     SEVERE  exportuvfits::::casa    Task exportuvfits raised an exception of class RuntimeError with the following message: RegularFileIO: error in open or create of file /home/iniyan/software/dev/Anime.jl/examples/output/test.ms/table.f2: No such file or directory
ERROR: LoadError: Python: RuntimeError: RegularFileIO: error in open or create of file /home/iniyan/software/dev/Anime.jl/examples/output/test.ms/table.f2: No such file or directory
Python stacktrace:
 [1] open
   @ casatools.__casac__.ms ~/software/dev/Anime.jl/.CondaPkg/env/lib/python3.8/site-packages/casatools/__casac__/ms.py:151
 [2] open
   @ casatools.ms ~/software/dev/Anime.jl/.CondaPkg/env/lib/python3.8/site-packages/casatools/ms.py:79
 [3] exportuvfits
   @ casatasks.private.task_exportuvfits ~/software/dev/Anime.jl/.CondaPkg/env/lib/python3.8/site-packages/casatasks/private/task_exportuvfits.py:15
 [4] __call__
   @ casatasks.exportuvfits ~/software/dev/Anime.jl/.CondaPkg/env/lib/python3.8/site-packages/casatasks/exportuvfits.py:182
Stacktrace:
 [1] pythrow()
   @ PythonCall ~/.julia/packages/PythonCall/1f5yE/src/err.jl:94
 [2] errcheck
   @ ~/.julia/packages/PythonCall/1f5yE/src/err.jl:10 [inlined]
 [3] pycallargs
   @ ~/.julia/packages/PythonCall/1f5yE/src/abstract/object.jl:211 [inlined]
 [4] pycall(::PythonCall.Py; kwargs::Base.Pairs{Symbol, String, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:vis, :fitsfile, :datacolumn), Tuple{String, String, String}}})
   @ PythonCall ~/.julia/packages/PythonCall/1f5yE/src/abstract/object.jl:222
 [5] pycall
   @ ~/.julia/packages/PythonCall/1f5yE/src/abstract/object.jl:218 [inlined]
 [6] #_#11
   @ ~/.julia/packages/PythonCall/1f5yE/src/Py.jl:341 [inlined]
 [7] mstouvfits(msname::String, uvfits::String, datacolumn::String; field::String, spw::String, antenna::String, timerange::String, overwrite::Bool)
   @ Main.Anime ~/software/dev/Anime.jl/src/storageutils/generatems.jl:165
 [8] mstouvfits(msname::String, uvfits::String, datacolumn::String)
   @ Main.Anime ~/software/dev/Anime.jl/src/storageutils/generatems.jl:156
 [9] top-level scope
   @ ~/software/dev/Anime.jl/examples/AnimeExample.jl:127
in expression starting at /home/iniyan/software/dev/Anime.jl/examples/AnimeExample.jl:127

But if I

  1. exit the script and run exportuvfits manually or
  2. avoid opening the MS in Update mode with Casacore.jl and run exportuvfits() from within my script

then I do not get any errors. Any ideas? Thanks for your help!

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

1 participant