Source
print ' TIMEs='+str([myqa.time(str(t)+'s',form='ymd')[0] for t in uTIMEs])+' --> '+str(myqa.time(str(newtime)+'s',form='ymd')[0])+' w/ INTERVAL='+str(newinterval)
#!/usr/bin/env python
#
# almahelpers.py
#
# History:
# v1.0 (scorder, gmoellen, jkern; 2012Apr26) == initial version
# v1.1 (gmoellen; 2013Mar07) Lots of improvements from Eric Villard
# v1.2 (gmoellen; 2013Apr09) Added fixsyscaltimes and calantsub methods
# to handle Tsys irregularities
# v1.3 (dpetry; 2017Sept11) Added genImageName
# v1.4 (gmoellen; 2021Jul08) fixsyscaltimes now returns True if a fix
# was applied, otherwise returns False
#
# This script defines several functions useful for ALMA data processing.
#
# tsysspwmap - generate an "applycal-ready" spwmap for TDM to FDM
# transfer of Tsys
# fixsyscaltimes - repairs the TIME and INTERVAL columns of the MS
# SYSCAL subtable so that gencal properly generates
# the Tsys caltable
# calantsub - provides for substitution of cal solutions by antenna
#
# genImageName - generate canonical image file names
#
# To access these functions, type (at the CASA prompt):
#
# from recipes.almahelpers import *
#
# For more information about each function type
#
# help tsysspwmap
# help fixsyscaltimes
# help calantsub
# help genImageName
#
#
import numpy
import taskinit
import os
import csv # used by editIntentscsv
class SpwMap:
"""
This object is basically set up to hold the information needed
"""
def __init__(self,calSpwId):
self.calSpwId = calSpwId
self.validFreqRange = []
self.mapsToSpw = []
self.bbNo = None
class SpwInfo:
def __init__(self,msfile,spwId) :
self.tb = taskinit.tbtool()
self.setTableAndSpwId(msfile,spwId)
def setTableAndSpwId(self,msfile,spwId) :
self.setTable(msfile)
self.setSpwId(spwId)
def setTable(self,msfile) :
self.tableName = "%s/SPECTRAL_WINDOW" % msfile
self.tb.open(self.tableName)