Skip to content

CASA concat MS error #780

@Victoria-Samboco

Description

@Victoria-Samboco

I wrote a Stimela recipe step to concatenate scans using the task concat from CASA, but I'm having a SyntaxError, which I need help understanding how to fix; please advise ...

───────────────────────────────────────── boom.concat_scans ──────────────────────────────────────────
2023-05-03 11:44:04 STIMELA.boom.concat_scans INFO: ### validated inputs
2023-05-03 11:44:04 STIMELA.boom.concat_scans INFO: cab casa:
2023-05-03 11:44:04 STIMELA.boom.concat_scans INFO:   vis_list = 
['obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_0.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_1.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_10.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_11.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_12.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_13.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_14.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_15.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_16.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_17.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_18.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_19.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_2.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_20.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_21.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_22.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_3.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_4.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_5.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_6.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_7.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_8.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_9.ms']
2023-05-03 11:44:04 STIMELA.boom.concat_scans INFO:   timesort = True
2023-05-03 11:44:04 STIMELA.boom.concat_scans INFO:   concatvis = 
obs3/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_concat.ms
### running casa --log2term --nologger --nologfile -c import sys, json; kw=json.loads(sys.argv[-1]); 
kw={key: (str(value) if type(value) is unicode else value) for key, value in kw. items()}; casa 
--log2term --nologger --nologfile -c 
"concat(vis='['obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_0.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_1.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_10.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_11.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_12.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_13.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_14.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_15.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_16.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_17.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_18.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_19.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_2.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_20.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_21.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_22.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_3.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_4.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_5.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_6.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_7.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_8.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_9.ms']', 
concatvis='obs3/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_concat.ms', timesort=True)"(**kw); 
{"vis_list": ["obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_0.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_1.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_10.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_11.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_12.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_13.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_14.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_15.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_16.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_17.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_18.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_19.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_2.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_20.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_21.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_22.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_3.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_4.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_5.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_6.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_7.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_8.ms", 
"obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_9.ms"], "time sort": true, 
"concatvis": "obs3/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_concat.ms"}
# 
# =========================================
# The start-up time of CASA may vary
# depending on whether the shared libraries
# are cached or not.
# =========================================
# 
# /opt/causality/lib/python2.7/site-packages/IPython/core/interactive shell.py:724: UserWarning: 
Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the 
virtualenv.
#   warn("Attempting to work in a virtualenv. If you encounter problems, please "
# IPython 5.1.0 -- An enhanced Interactive Python.
# 
# CASA 5.6.0-60   -- Common Astronomy Software Applications
# 
# Found an existing telemetry logfile: 
/home/samboco/.casa/casastats-560-60-1022843ce4242e0312-20230427-162428.log
# Telemetry initialized. Telemetry will send anonymized usage statistics to NRAO.
# You can disable telemetry by adding the following line to your ~/.casarc file:
# EnableTelemetry: False
# 2023-05-03 09:44:08   INFO    ::casa  CASA Version  5.6.0-60
# --> CrashReporter initialized.
# Traceback (most recent call last):
#   File "/opt/casalite/lib/python2.7/init_welcome.py", line 60, in <module>
#     exec(casa['flags'].execute[0])
#   File "<string>", line 1
#     import sys, json; kw=json.loads(sys.argv[-1]); kw={key: (str(value) if type(value) is unicode 
else value) for key, value in kw.items()}; casa --log2term --nologger --nologfile -c 
"concat(vis='['obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_0.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_1.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_10.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_11.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_12.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_13.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_14.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_15.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_16.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_17.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_18.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_19.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_2.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_20.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_21.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_22.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_3.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_4.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_5.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_6.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_7.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_8.ms', 
'obs3/perscan_ms/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_scan_9.ms']', 
concatvis='obs3/1583662427_sdp_l0.1024ch-J033230_280757-corr_self_concat.ms', timesort=True)"(**kw);
#                                                                                                     
^
# SyntaxError: invalid syntax

Here is the cab

  concat_MS:
    command:  casa --log2term --nologger --nologfile -c "concat(vis='{current.vis_list}', concatvis='{current.concatvis}', timesort=True)"
    flavour: casa-task
    inputs:
      vis_list:
        dtype: List[str]
        required: true
      commands:
        dtype: List[str]
        policies:
          repeat: list
      timesort:
        dtype: bool  
      concatvis:
        dtype: str
        #default: '{recipe.ms}-output'
        required: true

and recipe step

    concat_scans:
      cab: concat_MS
      info: ' Concatenate multiple measurement sets into a single output.'
      params:
        timesort: true
        vis_list: =GLOB("{recipe.dir_out}/{recipe.perscan_dir_out}/*scan*")
        concatvis: ="{recipe.dir_out}" + "/" + STRIPEXT(BASENAME(recipe.ms)) + "_concat.ms"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions