Usage of plotAtmosphere

Return to directory of Todd's CASA extensions

This is a simple plotter for atmospheric transmission, opacity, sky temperature, or system temperature as a function of frequency for the specified observatory and/or weather conditions.

Usage

def plotAtmosphere(vis=None, spw=-1, scan=0, intent='OBSERVE_TARGET',
                   frequency=[0,1000],
                   pwv=None, bandwidth=None,telescope='ALMA',
                   temperature=None, altitude=None, latitudeClass=None,
                   pressure=None, humidity=None, numchan=1000, airmass=1.0,
                   elevation=0, plotfile='', plotrange=None, 
                   quantity='transmissionPercent', h0=None,
                   drawRectangles=[], drawVerticalBars = [], overlay=False,
                   fontsize=12, showgrid=False, linewidth=[1,1,1],
                   color=['b','b','b'], linestyle=['-','--',':'], 
                   drawWVR=False, verbose=False, outfile='', 
                   delimiter=' ', showplot=True, Trx=100.0, Feff=0.99, 
                   SBGain=0.99, Tamb=270.0, marker=['','',''], mymsmd=None,
                   dP=5.0, dPm=1.1, maxAltitude=60., resampleChan=0,
                   window=None, caltable=None, dumpO3opacityOnly=False,
                   representativeFrequency=None,
                   clearplot=True, title1='', title2='', rectangleFaceColor='0.9,0.9,0.9'):
    Simple plotter of atmospheric transmission. You can enter either:
    a) vis ( + spw + scan)
    b) frequency
    c) caltable + spw
    Returns: one value based on quantity parameter (only if numchan>1, and
          representative frequency is within the specified frequency range)
    quantity: can be one of:
       'opacity': total opacity value computed closest to rep. frequency
       'o3opacity': O3 opacity value computed closest to rep. frequency
       'transmission': transmission value computed closest to rep. frequency
       'tsky':  TebbSky value computed closest to rep. frequency
       'tsys':  Tsys value computed closest to rep. frequency
    frequency in GHz (either a single value, or a list of 2 values or a tuple for the range)
    vis: if specified, then use the specified spw (or first with specified intent)
         (overrides the frequency parameter)
    caltable: if specified, then use the specified spw 
    spw: integer or string
    scan: if specified (along with vis), then read the elevation for this scan
          if not specified, then use the first scan with specified intent
    numchan: this sets the resolution of the spectrum (if vis+spw is not given)
    pwv: in mm (if not specified, and vis is specified, then it uses getMedianPWV())
    plotfile: if specified, then write a plot file; if True, use +'atm.png'
              or +'_atm.png' if vis is not specified
    verbose: if True, then print the spw and scan chosen
    bandwidth: in GHz (only used if frequency is a single value)
    temperature: in K
    altitude: in m
    latitudeClass: 'tropical', 'midLatitudeWinter'(default), or 'midLatitudeSummer'
    pressure: in mbar
    humidity: in percentage
    elevation: in degrees
    plotrange: for y axis, e.g. [0,100]
    telescope: if not '', then apply nominal values for 'ALMA' or 'EVLA' (ignored if vis is set)
    quantity: 'transmission', 'transmissionPercent', 'opacity', 'O3opacity', 'tsky', or 'tsys'
    h0: scale height of H2O in km (default is 1.0km for ALMA, 2.0km for others)
    dP: pressure step, has units of pressure (mb)
    dPm: pressure step factor (unitless) called PstepFact in TelCal
    drawRectangles: e.g. ([[x0,x1],[x2,x3],...])
    rectangleFaceColor: either a list of lists [[1,1,1],[0,0,0]] or  single string for all rectangles
    drawVerticalBars: e.g. ([x0,x1,...])
    overlay: if True, the show wet component, dry component and their sum (transmission or opacity only)
    fontsize: of tick labels and axis labels
    showgrid: if True, show dotted lines on major ticks
    linewidth: list of linewidths for each component: [sum, dry, wet]
    color: list of pylab colors for each component 
    marker: list of pylab marker for each component
    linestyle: list of pylab linestyles for each component
    outfile: if specified, then write an ASCII-format file with columns:
       freq, dryOpacity, wetOpacity, totalOpacity, transmission, Tsky, O3LineOpacity
       (units of transmission are set by the quantity parameter)
       unless dumpO3opacityOnly=True, then dump only frequency and O3 opacity
    delimiter: the character to use as delimited in outfile
    showplot: if False, then do not show the plot
    Trx, Feff, SBGain, Tamb: values to use for computing Tsys.
    resampleChan: if specified, and quantity='tsky', then resample to this 
       number of channels using np.interp
    representativeFrequency: if specified, (GHz or string with units), then return
       the calculated value at this frequency
    title1: '' for default title; None for none, string for manual text
    title2: '' for default second line; None for none, string for manual text
    Note: uses the global physical constants: h and k

Examples:

CASA <2>: au.plotAtmosphere(frequency=660, bandwidth=3.75, telescope='ALMA', pwv=.472, showgrid=True, plotfile='alma.660.png')
Built atmospheric profile with 32 layers for altitude 5059 m.
Mean transmission: 52.532393 percent
Wrote alma.660.png

alma.660.png

CASA <3>: au.plotAtmosphere(frequency=[0,250],pwv=4,telescope='VLA',overlay=True,quantity='opacity',plotrange=[0,0.41],fontsize=16,linewidth=[3,3,3],color=['k','r','b'],linestyle=['-','--','-'],plotfile='vla_atm.png') 
Built atmospheric profile with 37 layers for altitude 2124 m.
Wrote vla_atm.png
  • vla_atm.png:
    vla atm.png
Topic attachments
I Attachment Action Size Date Who Comment
alma.660.pngpng alma.660.png manage 36 K 2012-06-26 - 14:10 ToddHunter  
vla_atm.pngpng vla_atm.png manage 79 K 2014-05-13 - 17:54 ToddHunter  
Topic revision: r7 - 2022-03-23, 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