getListOfFilesFromFile

Return to directory of Todd's CASA extensions

Reads a list of measurement set or asdm names from a text file, one per line, and return a list of measurement set names (with .ms appended if not present). Ignores lines containing beginning with a comment character (pound sign).

Usage:

au.getListOfFilesFromFile(filename, appendms=True)
  • appendms: if True, will append ".ms" to the end of each filename, if not already present

Example:

CASA <2>: au.getListOfFilesFromFile('datasets.txt')
  Out[2]: 
['uid___A002_X65c1ab_X1ae.ms',
 'uid___A002_X67ccac_X2e4.ms',
 'uid___A002_X6dabc7_X367.ms',
 'uid___A002_X6dabc7_X3a2.ms',
 'uid___A002_X6dabc7_X434.ms',
 'uid___A002_X6dabc7_X471.ms',
 'uid___A002_X6dbad4_X8d.ms',
 'uid___A002_X6dbad4_Xca.ms',
 'uid___A002_X6dbad4_X134.ms',
 'uid___A002_X6dbad4_X19e.ms',
 'uid___A002_X6dbad4_X1db.ms',
 'uid___A002_X6dd5bb_X2e.ms',
 'uid___A002_X6dd5bb_X65.ms',
 'uid___A002_X6dd5bb_X724.ms',
 'uid___A002_X6e019b_X3e9.ms',
 'uid___A002_X6e23cb_X30b.ms',
 'uid___A002_X6e23cb_X35f.ms',
 'uid___A002_X6e7cf2_Xe3b.ms',
 'uid___A002_X6eaeaa_X25e.ms',
 'uid___A002_X6ee915_X20b.ms',
 'uid___A002_X6ee915_X25d.ms']

-- ToddHunter - 2013-10-18

This topic: ALMA > TWikiUsers > ToddHunter > CasaExtensions > GetListOfFilesFromFile
Topic revision: 2013-10-18, ToddHunter
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback