2019年9月16日 星期一

Add a column in fits file

import pyfits

data = pyfits.open('old_file')[1].data
head = pyfits.open('old_file')[1].header
cols = []
cols.append(
    pyfits.Column(name='new_column_name', format='D', array= new_data_array)
    )
orig_cols = data.columns
new_cols = pyfits.ColDefs(cols)
hdu = pyfits.BinTableHDU.from_columns(orig_cols + new_cols)
hdu.writeto('new_table.fits')  # just rewrite the file.




Also using astropy:







2019年8月21日 星期三

8/20 Chapter 11.8, 14.1

Chemical Evolution of Disk Galaxies
11-8-1
1. age-metallicity tracer: iron abundance of long-lived star, metallicity distribution of long-lived G dwarfs, oxygen/iron ratio.
2. stellar age is hard to determined. The age-metallicity is poorly constraint.
3. G dwarf problem:  Prediction from closed box model expect ~28% of G dwarfs have low metallicity ([Fe/H]<-0.7), while the data shows only 3% of G dwarfs with such low metallicity.
4. Raising the initial metallicity (by the massive star pollution from the bugle, stellar halo, thick disk) does not solve the problem
5.Consider the gas inflow (compare the total gas mass in the Milky Way vs SFR, it is reasonable to believe galaxy has constant inflow gas , due to dark matter and so on)
6. [alpha/Fe] as a constraint. ([Fe/H]<-1 forms earlier)



11-8-2
1. review: more massive( more luminous)--> more gas phase metal.
2. Close box: metallicity directly related to Gas mass fraction. --> LESS MASSIVE GALAXY HAS MORE GAS FRACTION?  (young or star formation inefficient)
3. Inflow metal poor gas drop the metallicity. outflow (I FELT THAT IT CAN EITHER RAISE OR DROP THE METALLICITY)
4. yield ?
5. Metallicity Gradients (inside the galaxy): the inner part has more metal . (+ red, crowed, old)


14-1
1. Regular galaxy: powered by star, spectrum is roughly a sum of Planck spectra. (3000K~40000K  which corresponds to 4000A to 20000A)
2. AGN: boarder range of spectrum (from X ray to UV)  nontermal emission from a small central region.
3. Seyfert Galaxy, Radio Galaxy, QSO, OVVs