Ejemplo n.º 1
0
def test_get_magdict():
    band = "J"
    mag = 10.0
    magdict = get_magdict()
    mask = magdict['band'] == band
    flux = get_flux(band, mag, magdict)
    assert flux.to(u.erg/u.s/u.m/u.m/u.nm).value - 3.3113112148259078e-09 == 0.0
Ejemplo n.º 2
0
def test_ejas_bb():
    """ unit test for blackbody photon count and other noises  assuming JASMINE (2022 April)

    """
    ejas = exocounts.InstClass()
    ejas.lamb = 1.25 * u.micron  #micron
    ejas.dlam = 0.7 * u.micron  #micron
    ejas.dtel = 0.34 * u.m  #telescope diameter m
    ejas.dstel = 0.14 * u.m  #secondary telescope diameter m or 12.4 (3 tels)

    QE = 0.7
    ejas.throughput = QE * 0.85 * 0.95
    ejas.ndark = 15.5 / u.s  #dark current
    ejas.nread = 15.0  #nr
    ejas.fullwell = 150000.

    target = exocounts.TargetClass()
    target.teff = 3000.0 * u.K  #K
    target.rstar = 0.2 * const.R_sun  #Rsolar
    target.d = 15.0 * u.pc  #pc

    obs = exocounts.ObsClass(ejas, target)

    obs.texposure = 0.0833 * u.h  #cadence [hour]
    obs.tframe = 12.5 * u.s  #time for one frame [sec]
    obs.napix = 15  # number of the pixels in aperture
    obs.mu = 1
    S = 1.8 * 1.8 * np.pi  #core size
    obs.effnpix = S / 3.0  #3 is an approx. increment factor of PSF
    obs.mu = 1

    target.d = 16.0 * u.pc  #change targets
    obs.target = target
    obs.update()

    magdict = convmag.get_magdict()
    print("H mag=", convmag.get_mag("H", obs.flux, magdict))
    print("J mag=", convmag.get_mag("J", obs.flux, magdict))
    print(
        "Hw mag=", 0.7 * convmag.get_mag("J", obs.flux, magdict) +
        0.3 * convmag.get_mag("H", obs.flux, magdict))
    print("V mag=", convmag.get_mag("V", obs.flux, magdict))
    print("=========================")
    print("saturation?", obs.sat)
    print("dark [ppm]=", obs.sigd)
    print("readout [ppm]=", obs.sigr)
    print("photon [ppm]=", obs.sign)
    print("=========================")
    print("photon relative=", obs.sign_relative)

    assert not obs.sat
    assert obs.sigd - 264.04942719119845 == 0.0
    assert obs.sigr - 284.5480627240326 == 0.0
    assert obs.sign - 3392.713732726309 == 0.0
    assert obs.sign_relative - 294.74930064212117 == 0.0
Ejemplo n.º 3
0
ost.dtel = 5.9 * u.m  #telescope diameter m

ost.dstel = 0.00 * u.m  #secondary telescope diameter m
ost.throughput = 0.1
ost.ndark = 0.17  #dark current
ost.nread = 14.0  #nr
ost.fullwell = 80000.

target = exocounts.TargetClass()
target.name = "Trappist e"
target.teff = 2559.0 * u.K  #K
target.rstar = 0.117 * const.R_sun  #Rsolar
target.d = 12.1 * u.pc  #pc

obs = exocounts.ObsClass(ost, target)

obs.texposure = 30.0 * u.h  #cadence [hour] # 30 x visits (1 hr=transit dur trappist e)
obs.tframe = 7.1 * u.s  #time for one frame [sec]
obs.napix = 15  # number of the pixels in aperture
obs.mu = 1
S = 1.8 * 1.8 * np.pi  #core size
obs.effnpix = S / 3.0  #3 is an approx. increment factor of PSF
obs.mu = 1

obs.target = target
obs.update()

magdict = convmag.get_magdict()
print("photon noise [ppm]=", obs.sign_relative)
print("photon N for exp=", obs.nphoton_exposure)