First install the Python module:
pip install casjobs
Then set the environment variables:
export CAS_DR9_WSID="1234567890" # get yours here: http://skyserver.sdss3.org/CasJobs/ChangeDetails.aspx
| import numpy as np | |
| import scipy.linalg as la | |
| # create data matrix and design matrices A (for sinusoids) and B (for nuisances) and M (for both) | |
| y = np.random.normal(size=(100)) # data | |
| A = np.random.normal(size=(2, 100)) # components we care about | |
| B = np.random.normal(size=(10, 100)) # nuisance components | |
| M = np.vstack((B, A)) | |
| C = np.diag(0.25 * np.ones(100)) | |
| Cinv = np.diag(4.00 * np.ones(100)) |
| import numpy as np | |
| import time as tt | |
| def main(): | |
| timing = np.array([]) | |
| log2N = np.arange(6) + 8 | |
| for N in 2 ** log2N: | |
| uu = np.random.normal(size=(N, N+2)) | |
| matrix = np.dot(uu, uu.T) | |
| print matrix.shape |
| <img width="20" height="20" align="absmiddle" src="http://octodex.github.com/images/nyantocat.gif" class="emoji" alt=":nyantocat:"> |
First install the Python module:
pip install casjobs
Then set the environment variables:
export CAS_DR9_WSID="1234567890" # get yours here: http://skyserver.sdss3.org/CasJobs/ChangeDetails.aspx
| echo Hello World |
| import pyfits | |
| import csv | |
| if __name__ == "__main__": | |
| hdulist = pyfits.open("foo.fits") | |
| blob = hdulist[-1].data | |
| with open('foo.csv', 'wb') as f: | |
| writer = csv.writer(f) | |
| writer.writerows(blob) |
| 0 |