예제 #1
0
def plot_filters():

    n = 1000
    for bessellfilter in filters:
        wavelength = (
            3000. +
            (9200. - 3000.) * numpy.array(range(n + 1)) / n) | units.angstrom
        xp = filter_data[bessellfilter]['wavelength']
        fp = filter_data[bessellfilter]['throughput']
        f = numpy.interp(
            wavelength.value_in(units.nano(units.m)),
            xp=xp.value_in(units.nano(units.m)),
            fp=fp,
            left=0.,
            right=0.,
        )

        pyplot.plot(lam.value_in(units.nano(units.m)), f)

    pyplot.show()
예제 #2
0
def wiens_T_from_lambda_max(l):
    b = 2897768.6 | units.nano(units.m) * units.K
    return b/l
예제 #3
0
def total_bolometric_flux(T):
    return sigma*T**4


if __name__ == "__main__":
    T = 10000. | units.K

    print((wiens_lambda_max(T)))

    print((energy_flux(T).in_(units.W * units.m**-2)))
    print((energy_flux2(T).in_(units.W * units.m**-2)))
    print(((sigma*T**4).in_(units.W * units.m**-2)))

    print()
    nf = photon_flux(T, lowfreq=freq_from_wavenumber(Ry))
    print((numpy.log10(nf.value_in(units.cm**-2 * units.s**-1))))
    print()

    a = photon_flux(T)
    print((numpy.log10(a.value_in(units.cm**-2 * units.s**-1))))
    b = sigma*T**4 / (kB*T)/2.7
    print((numpy.log10(b.value_in(units.cm**-2 * units.s**-1))))

    print((b/a))
    print((nf/b))

    print((wiens_T_from_lambda_max(300. | units.nano(units.m))))
    print((wiens_T_from_lambda_max(610. | units.nano(units.m))))
    print((wiens_T_from_lambda_max(920. | units.nano(units.m))))
예제 #4
0
def wiens_lambda_max(T):
    b = 2897768.6 | units.nano(units.m) * units.K
    return b/T
예제 #5
0
파일: xyz.py 프로젝트: JPGlaser/Fresco
import numpy

from amuse.units import units

this_dir, this_filename = os.path.split(__file__)
if this_dir == "":
    this_dir = "."
instrument = "WFPC_II_WFC3"
data_dir = this_dir + "/data/" + instrument + "/"

f = open(data_dir + "ciexyz31.csv", "r")

lines = f.readlines()

cielam = [] | units.nano(units.m)
x = []
y = []
z = []

for l in lines:
    line = l.split(",")
    cielam.append(float(line[0]) | units.nano(units.m))
    x.append(float(line[1]))
    y.append(float(line[2]))
    z.append(float(line[3]))
x = numpy.array(x)
y = numpy.array(y)
z = numpy.array(z)

xyz_data = dict()