casangi / astrohack

Antenna panel and position corrections.
https://astrohack.readthedocs.io/
GNU General Public License v3.0
9 stars 3 forks source link

astrohack.dio.fix_pointing_table breaks if MS is not in current directory #188

Closed Kitchi closed 11 months ago

Kitchi commented 12 months ago

I have an older EVLA holography data set that needed the pointing table to be fixed. If I try running fix_pointing_table as (for example)

fix_pointing_table(ms_name = '../<holography_name>.ms', reference_antenna=['ea01', 'ea02'])

it fails with the following error :

RuntimeError: Error in TaQL command: 'using style Python select NAME from ../THOL0001_sb31146700_1.57287.317363055554_HOLORASTER.timeavg.ms/ANTENNA'                                                               │
Error in select expression: :: or . is invalid in table name ../THOL0001_sb31146700_1.57287.317363055554_HOLORASTER.timeavg.ms/ANTENNA: no previous table available   

but if I move the MS into my current directory it works without issue. I suspect it might be because the path of the input MS is not properly sanitized when it is being ingested into the function.

tnakazato commented 12 months ago

I think enclosing table name with double quotes solves the problem.

According to TaQL documentation "3.5 FROM table_list",

A persistent table can be used by giving its name which can contain path specification and environment variables or the UNIX ~ notation. If the tablename contains a special character, the character can be escaped with a backslash or the table name can be enclosed in single or double quotes.

jrhosk commented 12 months ago

@Kitchi I added a patch for this just now and it will be pushed in the next version release. By the way, it shouldn't break even now if you use the absolute path instead of "../". The new version should be out by the end of the day.

fix_pointing_table