Skip to content
Snippets Groups Projects

WS-2834: Correct piperestore scripts made with CASA < 5

Merged Daniel Nemergut requested to merge ws2834-edit_piperestore_hif into 2.8.5-DEVELOPMENT
All threads resolved!

String replacing hif_restoredata with hif(a/v)_restoredata when the calibration was made with CASA < 5.

Tested this by making a custom piperestore that needed both the import and hif fixes:

>> casa_home_major = 6
>>> recipes = "from recipes"
>>> casarecipes = "from casarecipes"
>>> hif = "hif_restoredata"
>>> hifv = "hifv_restoredata"
>>> with open("member.uid___A001_X1296_Xf59.hifa_calimage.casa_piperestorescript.py", "r") as f:
...     content = f.read()
...     content = content.replace(recipes, casarecipes) if casa_home_major > 5 else content.replace(casarecipes, recipes)
...     content = content.replace(hif, hifv) if casa_home_major >= 5 else content.replace(hifv, hif)
>>> with open("test.py", "w") as f:
...     f.write(content)

Contents of member.uid___A001_X1296_Xf59.hifa_calimage.casa_piperestorescript.py:

from recipes.almahelpers import fixsyscaltimes # SACM/JAO - Fixes
__rethrow_casa_exceptions = True
h_init()
try:
    hif_restoredata (vis=['uid___A002_Xc6c0d5_X74ad', 'uid___A002_Xc6d2f9_X170b', 'uid___A002_Xc6d2f9_X2276'], session=['session_1', 'session_2', 'session_2'], ocorr_mode='ca')
finally:
    h_save()

Corrected output in test.py:

from casarecipes.almahelpers import fixsyscaltimes # SACM/JAO - Fixes
__rethrow_casa_exceptions = True
h_init()
try:
    hifv_restoredata (vis=['uid___A002_Xc6c0d5_X74ad', 'uid___A002_Xc6d2f9_X170b', 'uid___A002_Xc6d2f9_X2276'], session=['session_1', 'session_2', 'session_2'], ocorr_mode='ca')
finally:
    h_save()

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    Compare with previous version

  • Charlotte Hausman approved this merge request

    approved this merge request

  • Charlotte Hausman resolved all threads

    resolved all threads

  • can we get another set of eyes on this one please?

  • Brittany Faciane approved this merge request

    approved this merge request

  • mentioned in commit 998d3a55

  • Please register or sign in to reply
    Loading