original_docstring: 
      Automatically pick one science spw for the specified Tsys spw.  
      Ideally it would be the one with the widest bandwidth, but it will likely make very little
      difference, so just take the first one if there are more than one.
      
docstring: Automatically pick one science spw for the specified Tsys spw.
  Ideally it would be the one with the widest bandwidth, but it will likely make very little
  difference, so just take the first one if there are more than one.
docstring_tokens: Automatically pick one science spw for the specified Tsys spw . Ideally it would be the one with the widest bandwidth but it will likely make very little difference so just take the first one if there are more than one .
code: def scienceSpwForTsysSpw(mymsmd, tsysSpw):
      """
      Automatically pick one science spw for the specified Tsys spw.  
      Ideally it would be the one with the widest bandwidth, but it will likely make very little
      difference, so just take the first one if there are more than one.
      """
      baseband = mymsmd.baseband(tsysSpw)
      spws = np.intersect1d(mymsmd.almaspws(tdm=True,fdm=True),mymsmd.spwsforbaseband(baseband))
      if 'OBSERVE_TARGET#ON_SOURCE' in mymsmd.intents():
          spws = np.intersect1d(mymsmd.spwsforintent('OBSERVE_TARGET#ON_SOURCE'), spws)
      elif 'CALIBRATE_FLUX#ON_SOURCE' in mymsmd.intents():
          spws = np.intersect1d(mymsmd.spwsforintent('CALIBRATE_FLUX#ON_SOURCE'), spws)
      elif 'CALIBRATE_AMPLI#ON_SOURCE' in mymsmd.intents():
          spws = np.intersect1d(mymsmd.spwsforintent('CALIBRATE_AMPLI#ON_SOURCE'), spws)
          
      if (len(spws) > 1):
          print("Multiple science spws for this tsys spw (%d).  Picking the first one (%d)" % (tsysSpw, spws[0]))
          return(spws[0])
      elif (len(spws) < 1):
          print("No science spws for this tsys spw (%d)" % (tsysSpw))
      else:
          return(spws[0])
      return -1
code_tokens: def scienceSpwForTsysSpw ( mymsmd , tsysSpw ) : baseband = mymsmd . baseband ( tsysSpw ) spws = np . intersect1d ( mymsmd . almaspws ( tdm = True , fdm = True ) , mymsmd . spwsforbaseband ( baseband ) ) if 'OBSERVE_TARGET#ON_SOURCE' in mymsmd . intents ( ) : spws = np . intersect1d ( mymsmd . spwsforintent ( 'OBSERVE_TARGET#ON_SOURCE' ) , spws ) elif 'CALIBRATE_FLUX#ON_SOURCE' in mymsmd . intents ( ) : spws = np . intersect1d ( mymsmd . spwsforintent ( 'CALIBRATE_FLUX#ON_SOURCE' ) , spws ) elif 'CALIBRATE_AMPLI#ON_SOURCE' in mymsmd . intents ( ) : spws = np . intersect1d ( mymsmd . spwsforintent ( 'CALIBRATE_AMPLI#ON_SOURCE' ) , spws ) if ( len ( spws ) > 1 ) : print ( "Multiple science spws for this tsys spw (%d).  Picking the first one (%d)" % ( tsysSpw , spws [ 0 ] ) ) return ( spws [ 0 ] ) elif ( len ( spws ) < 1 ) : print ( "No science spws for this tsys spw (%d)" % ( tsysSpw ) ) else : return ( spws [ 0 ] ) return - 1
short_docstring: Automatically pick one science spw for the specified Tsys spw.
short_docstring_tokens: Automatically pick one science spw for the specified Tsys spw .
comment: """
      Automatically pick one science spw for the specified Tsys spw.  
      Ideally it would be the one with the widest bandwidth, but it will likely make very little
      difference, so just take the first one if there are more than one.
      """