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
#ost.dtel = 9.1 #telescope diameter m 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)
ejas = exocounts.InstClass() ejas.lamb = 1.4 * u.micron #micron ejas.dlam = 0.6 * u.micron #micron ejas.dtel = 0.31 * u.m #telescope diameter m ejas.dstel = 0.09 * u.m #secondary telescope diameter m ejas.throughput = 0.7 ejas.ndark = 60.0 / u.s #dark current ejas.nread = 30.0 #nr ejas.fullwell = 80000. 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 = 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 shot = [] dark = [] read = [] H = [] J = [] Hw = []
target.teff = 5800.0 * u.K #K target.rstar = 1.0 * const.R_sun #Rsolar target.d = 5.0 * u.pc #pc planet = planet.PlanetClass() planet.rplanet = 1.0 * const.R_earth #Re planet.a = 1.0 * u.AU #AU planet.albedo = 0.3 planet.phase = np.pi / 2.0 planet.compute_reflectivity() print("Star-Planet Contrast =", planet.reflectivity) #set planet scattered light as a target target.contrast = planet.reflectivity obs = exocounts.ObsClass(habex, target) obs.texposure = 1.0 * u.h #= [hour] obs.tframe = 10.0 * u.s #time for one frame [sec] obs.napix = 1 # number of the pixels in aperture obs.mu = 1 obs.effnpix = 0.5 obs.target = target obs.update() magdict = convmag.get_magdict() print("magnitude=", convmag.get_mag("V", obs.flux, magdict)) print(obs.nphoton_brightest / habex.fullwell) print(obs.sat) print("photon/pix/frame=", obs.nphoton_frame)
target.d = 5.0*u.pc #pc #Table 3 ###### planet=planet.PlanetClass() planet.rplanet = 1.0*const.R_earth #Re planet.a = 0.0485*u.AU #AU #Table 2 planet.albedo = 0.3 planet.phase = np.pi/2.0 #planet.compute_reflectivity() print("Star-Planet Contrast =",planet.reflectivity) #set planet scattered light as a target #target.contrast = planet.reflectivity obs=exocounts.ObsClass(fm21,target) # # each side # 32deg 11.26d for mid M # 40deg 2.27d for late M # obs.texposure = 40.0/360.0*2.27*u.d obs.tframe = 1800.0*u.s #time for one frame [sec] obs.napix = 1 # number of the pixels in aperture obs.mu = 1 obs.effnpix = 1.0