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

Multiple Primary Targets not yet managed #18

Open
ebrassfieldbourke opened this issue Dec 11, 2024 · 0 comments
Open

Multiple Primary Targets not yet managed #18

ebrassfieldbourke opened this issue Dec 11, 2024 · 0 comments

Comments

@ebrassfieldbourke
Copy link
Contributor

This is a reminder to address this for caom2.5 refactor, as we are currently collecting the primary target from the text generated from a pickle file, and if there is more than one primary target, it shows up as a string, i.e.
0811+2449,1056+4146,1433+4842,1436+4928
When the casatools tries to then use the value of the primary target to collect the RA and Dec from the Measurement Set, it causes an eventual RuntimeError because the 'field name' is unknown.
Requirement for code to discern whether target is comma-delimited or not, and if so, separate into multiple targets for which RA and Dec will be collected, and for which each a Plane (and possibly Derived Observation?) would be generated. Which target is selected for the Simple Observation or Derived Observation as the primary target is yet to be determined.

2024-12-11 10:56:07 INFO MSMetaData::_computeScanAndSubScanProperties Computing scan and subscan properties...
2024-12-11 10:56:08 SEVERE msmetadata_cmpt.cc::scansforfield Exception Reported: Exception: Unknown field name 0811+2449,1056+4146,1433+4842,1436+4928.
2024-12-11 10:56:08 SEVERE msmetadata_cmpt.cc::scansforfield+ ... thrown by std::set casa6core::MSMetaData::getFieldIDsForField(const casa6core::String &) const at File: casacore/ms/MSOper/MSMetaData.cc, line: 2516
Traceback (most recent call last):
File "run_script.py", line 4, in
a.build_metadata()
File "/Users/user/repos/emerlin2caom-uploading_in_python/emerlin2caom2/main_app.py", line 290, in build_metadata
casa_info = casa.msmd_collect(self.ms_dir_main, pickle_obj['targets'])
File "/Users/user/repos/emerlin2caom-uploading_in_python/emerlin2caom2/casa_reader.py", line 44, in msmd_collect
'num_scans': len(msmd.scansforfield(targ_name)),
File "/Users/user/miniconda3/envs/py38/lib/python3.8/site-packages/casatools/msmetadata.py", line 548, in scansforfield
return self._swigobj.scansforfield(_any_ec(field), obsid, arrayid)
File "/Users/user/miniconda3/envs/py38/lib/python3.8/site-packages/casatools/casac/msmetadata.py", line 2366, in scansforfield
return _msmetadata.msmetadata_scansforfield(self, *args, **kwargs)
RuntimeError: Exception: Unknown field name 0811+2449,1056+4146,1433+4842,1436+4928.
... thrown by std::set casa6core::MSMetaData::getFieldIDsForField(const casa6core::String &) const at File: casacore/ms/MSOper/MSMetaData.cc, line: 2516

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