About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: 10 December 2007

URL: http://cxc.harvard.edu/chips4.0/gallery/errors.py.html
Hardcopy (PDF): A4 | Letter

Gallery: Error bars (Python)

Examples


Symmetric Y errors

[ChIPS output]
Postscript version
crv = ChipsCurve()
crv.line.style = "noline"
add_curve("spectrum.fits[residuals][cols x,y,dylo]",crv)
set_curve(["symbol.style","circle","symbol.size",3.0,"symbol.color","red"])
log_scale(X_AXIS)

Errors for both the X and Y axes

[ChIPS output]
Postscript version
tbl = read_file("spectrum.fits[residuals]")
x = get_colvals(tbl,"x")
y = get_colvals(tbl,"y")
dylo = get_colvals(tbl,"dylo")
dyhi = get_colvals(tbl,"dyhi")
dxlo = get_colvals(tbl,"dxlo")
dxhi = get_colvals(tbl,"dxhi")
add_curve(x,y,[dylo,dyhi,dxlo,dxhi])
crv = ChipsCurve()
crv.line.style = "noline"
crv.symbol.style = "none"
crv.err.style = "capped"
set_curve(crv)
limits(X_AXIS,3.0,AUTO)

A histogram with errors and symbols

[ChIPS output]
Postscript version
tbl = read_file("histogram.fits")
xlo = get_colvals(tbl,"xlo")
xhi = get_colvals(tbl,"xhi")
y = get_colvals(tbl,"y")
dylo = get_colvals(tbl,"dylo")
dyhi = get_colvals(tbl,"dyhi")
add_histogram(xlo,xhi,y,dylo,dyhi)
set_histogram(["symbol.style","circle","symbol.size",3.0,"symbol.fill",0])
Hardcopy (PDF): A4 | Letter
Last modified: 10 December 2007


The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.