blah balh
blah blah blah
| import numpy as np | |
| import pywcs | |
| import pyfits | |
| class EventFile(object): | |
| def __init__(self, filename, hdu=1): | |
| self.filename= filename | |
| hdus = pyfits.open(filename) | |
| self.header = hdus[hdu].header | |
| self.hdus = hdus |
| import scipy.spatial | |
| from astropy.table import Table | |
| dat = Table.read('sources_ra_dec_z.fits') | |
| ok = ((dat['z'] > 0) | |
| & (dat['ra'] > 150.0) & (dat['ra'] < 151.0) | |
| & (dat['dec'] > 2.0) & (dat['dec'] < 3.0)) | |
| datok = dat[ok] |
| # -*- coding: utf-8 -*- | |
| # | |
| # Eng archive documentation build configuration file, created by | |
| # sphinx-quickstart on Mon Nov 23 22:45:31 2009. | |
| # | |
| # This file is execfile()d with the current directory set to its containing dir. | |
| # | |
| # Note that not all possible configuration values are present in this | |
| # autogenerated file. | |
| # |
| """ | |
| Version numbering for this module. The `major`, `minor`, and `bugfix` variables | |
| hold the respective parts of the version number (bugfix is '0' if absent). The | |
| `release` variable is True if this is a release, and False if this is a | |
| development version. | |
| NOTE: this code copied from astropy.version and simplified. Any license restrictions | |
| therein are applicable. | |
| """ |
| def get_options(): | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("filename", | |
| help="Model file") | |
| parser.add_argument("--days", | |
| type=float, | |
| default=15, | |
| help="Number of days in fit interval (default=90") | |
| parser.add_argument("--stop", | |
| help="Stop time of fit interval (default=model values)") |
| import asciitable | |
| def structured_array(arr, colnames): | |
| """Select and possibly re-order columns from a structured array. | |
| :param arr: numpy structured array | |
| :param colnames: column names to include | |
| """ | |
| dtypes = [(x, arr[x].dtype, arr[x].shape[1:]) for x in colnames] | |
| dat = np.ndarray(len(arr), dtype=dtypes) |
| """Provide examples of defining asciitable inconsistent_handler routines to | |
| deal with tables that have rows that are inconsistent with the header | |
| definition. | |
| """ | |
| import asciitable | |
| DEBUG = True | |
| def skip_bad_lines(self, str_vals, ncols): |
| import numpy as np | |
| import xija | |
| from Chandra.Time import DateTime | |
| from Ska.Matplotlib import plot_cxctime | |
| import Ska.DBI | |
| import Ska.engarchive.fetch_sci as fetch | |
| import matplotlib.pyplot as plt | |
| db = Ska.DBI.DBI(server='sybase', dbi='sybase', user='aca_read') |
| import numpy as np | |
| from numpy import pi, sin, cos, exp | |
| from scipy.interpolate import interp1d | |
| from multiprocessing import Pool | |
| RAD2ARCSEC = 180. * 3600. / pi # convert to arcsec for better scale | |
| class CalcScatter(object): |