Exemplo n.º 1
0
def contsub(script,parameters, continfo, linespw, comments, fitspw = False): # this is going to change all your spw indices if you do it...

    finalvis = "finalvis='calibrated_final.ms'\n"
    
    uvcontsub = "uvcontsub(vis=finalvis,\n\
          spw=linespw, # spw to do continuum subtraction on\n\
          fitspw=fitspw, # select spws to fit continuum. exclude regions with strong lines.\n\
          combine='spw', \n\
          solint='int',\n\
          fitorder=1,\n\
          want_cont=False) # This value should not be changed.\n\n"

    if fitspw:
        fitspw = "fitspw = '" + fitspw + "'\n"
    else:
        fitspw = "fitspw ='" + continfo['spwall'] + "' # example only\n\n" # should I put contspws here?

    if comments == False:
        script = script + com.contsub_header() + finalvis +linespw + fitspw + uvcontsub
    else:
        script = script + com.contsub() + finalvis +linespw + fitspw + uvcontsub
    return script
Exemplo n.º 2
0
def contsub(script,parameters, continfo, linespw, comments, fitspw = False): # this is going to change all your spw indices if you do it, but that was fixed in sort_spws
    """write the portion of the script that does uvcontsub"""

    finalvis = "finalvis='calibrated_final.ms'\n"
    
    uvcontsub = "uvcontsub(vis=finalvis,\n\
          spw=linespw, # spw to do continuum subtraction on\n\
          fitspw=fitspw, # select spws to fit continuum. exclude regions with strong lines.\n\
          combine='spw', \n\
          solint='int',\n\
          fitorder=1,\n\
          want_cont=False) # This value should not be changed.\n\n"

    if fitspw: #for the future in case it's possible to steal hifa_flagchannels output to do continuum flagging
        fitspw = "fitspw = '" + fitspw + "'\n"
    else:
        fitspw = "fitspw ='" + continfo['spwall'] + "' # example only\n\n" # should I put contspws here?

    if comments == False:
        script = script + com.contsub_header() + finalvis +linespw + fitspw + uvcontsub
    else:
        script = script + com.contsub() + finalvis +linespw + fitspw + uvcontsub
    return script