In [41]:
platein = (4567, 7830)
plate = ravel(platein)
In [42]:
int(plate)
In [39]:
print("What is this: {0:4d}".format(int(plate)))
In [50]:
spplate_hdunames = ('flux','invvar','andmask','ormask','disp','plugmap','sky','loglam', )
tryspplate_hdunames = ('flux','invvar','andmask','ormask','disp','plugmap','sky','lloglam', )
In [52]:
for thishdu in tryspplate_hdunames:
print(thishdu, type(thishdu))
print spplate_hdunames.index(thishdu)
if type(thishdu) != str:
raise TypeError("hdunames should be strings")
if thishdu not in spplate_hdunames:
raise ValueError("{0} is not in the hdu/loglam list: {1}".format(thishdu, spplate_hdunames))
print spplate_hdunames.index(thishdu)
In [1]:
import sdssspec
In [14]:
output = ('loglam', 'flux',)
plate = 7319
mjd = 56962
fiber = array([30, 40, 50])
path = "/Users/Benjamin/AstroData/SDSS/v5_7_6"
In [15]:
results = sdssspec.read_spec(plate, mjd, fiber, path, output)
In [16]:
flux = results['flux']
loglam = results['loglam']
flux.shape
Out[16]:
In [13]:
plot(np.power(10., loglam), flux[7,:])
Out[13]:
In [68]:
c0 = hdr['coeff0']
c1 = hdr['coeff1']
npix = hdr['naxis1']
Out[68]:
In [1]:
low_state = {'J': array(['1/2', '3/2', '5/2', '7/2', '9/2'])}
absorption = {'LOWJ': '3/2'}
In [12]:
jvalue = absorption['LOWJ']
ilevel = ((nonzero(low_state['J']==jvalue)))[0]
In [13]:
ilevel
Out[13]:
In [14]:
weightMatrix = [{'A':0,'C':0,'G':0,'T':0} for k in range(10)]
In [21]:
weightMatrix[0] = {'A':1}
In [22]:
weightMatrix[0]
Out[22]:
In [24]:
def transition_dtype():
out_dtype = [('XPOS', 'f4'),
('YPOS_TEXT', 'f4'),
('LOWJ', 'S3'),
('HIGHJ', 'S3'),
('TEXT', 'S30')]
return out_dtype
In [25]:
tran_dtype = transition_dtype()
In [26]:
emission = np.zeros(1, dtype=tran_dtype)
In [29]:
emission[0] = (0.23, 0.32, 1/2, '3/2', '2600.17 2.35E8 2.39E-1')
In [30]:
emission[0]
Out[30]:
In [3]:
import ebossspec
In [8]:
(outwave, fluxmedian, fluxmean, oiifluxmedian, oiifluxmean) = ebossspec.new_feiimgii_composite_bootstrap(nbootstrap=10)
In [7]:
reload(ebossspec)
Out[7]:
In [9]:
print outwave.shape
print fluxmedian.shape
In [13]:
figsize(15,10)
for i in arange(10):
plot(outwave, fluxmedian[:,i])
xlim(2200, 2900)
Out[13]:
In [ ]: