Exemplo n.º 1
0
def main():
  basename=os.path.basename(sys.argv[0])

  parser = OptionParser("filename")
  parser.add_option("-t", "--tabs", dest="tabs",
                    action="store_true", help="use tabs for display")
  parser.add_option("-c", "--color", dest="color", default=False,
                    action="store_true", help="use color for display")
  parser.add_option("-l", "--level", dest="level", default="6",
                    action="store", type="int", help="level of HDF5 structure to display l=0..6 (default=6)")
  parser.add_option("-p", "--sap", dest="sap", default="all",
                    action="store", type="string", help="display this sap, one out of [0->NSAP] or 'all'")
  parser.add_option("-b", "--beam", dest="beam", default="all",
                    action="store", type="string", help="display this beam, one out of  [0->NBeam] or 'all'")
  parser.add_option("-s", "--stokes", dest="stokes", default="all",
                    action="store", type="string", help="display these stokes one out of [IQUV], [Xr,Xi,Yr,Yi], or 'all'")
  #parser.add_option("-v", "--verbose", dest="verbose", default=False,
  #                  action="store_true", help="display verbose output")
  (options, args) = parser.parse_args()
  
  if len(sys.argv)==1:
    parser.print_help()
    sys.exit()
  else:
    filename=args[0]
    fh=dal.BF_File(filename)      # open file

    dal.bfmeta(fh, tabs=options.tabs, color=options.color, sap=options.sap, beam=options.beam, stokes=options.stokes, level=options.level) #verbose=options.verbose)
Exemplo n.º 2
0
def dispatch_to_headerinfo_util(filename):
	# (try to) open as CLA to see what LOFAR data product type it is
	fh = dal.CLA_File(filename)
	ftype = fh.fileType().value

	if ftype == 'tbb':
		lofar_tbb_headerinfo.print_tbb_header(filename)
	elif ftype == 'bf' or ftype == 'dynspec':
		dal.bfmeta(0, filename=filename)
	elif ftype is None:
		print 'The file', filename, 'does not appear to be a LOFAR data product, or it just lacks the FILETYPE attribute.'
	else:
		lofar_tbb_headerinfo.print_cla(fh)