def test_hashable(): lu1 = u.dB(u.mW) lu2 = u.dB(u.m) lu3 = u.dB(u.mW) assert hash(lu1) != hash(lu2) assert hash(lu1) == hash(lu3) luset = {lu1, lu2, lu3} assert len(luset) == 2
def test_hashable(): lu1 = u.dB(u.mW) lu2 = u.dB(u.m) lu3 = u.dB(u.mW) assert hash(lu1) != hash(lu2) assert hash(lu1) == hash(lu3) luset = {lu1, lu2, lu3} assert len(luset) == 2
mixin_cols = { 'tm': tm, 'dt': TimeDelta([1, 2] * u.day), 'sc': sc, 'scc': scc, 'scd': SkyCoord([1, 2], [3, 4], [5, 6], unit='deg,deg,m', frame='fk4', obstime=['J1990.5', 'J1991.5']), 'x': [1, 2] * u.m, 'qdb': [10, 20] * u.dB(u.mW), 'qdex': [4.5, 5.5] * u.dex(u.cm / u.s**2), 'qmag': [21, 22] * u.ABmag, 'lat': Latitude([1, 2] * u.deg), 'lon': Longitude([1, 2] * u.deg, wrap_angle=180. * u.deg), 'ang': Angle([1, 2] * u.deg), 'el2': el2, } time_attrs = ['value', 'shape', 'format', 'scale', 'location'] compare_attrs = { 'c1': ['data'],
't_a_from_powerflux_nu', 'powerflux_nu_from_t_a', 'free_space_loss', 'Erx_unit', 'R0', 'MU0', 'EPS0', 'C', 'KB', 'efield_equivalency', ] + UNITS # define some useful dB-Scales # dimless = apu.Unit(1) dimless = apu.dimensionless_unscaled dB = dBi = dBc = apu.dB(dimless) dB_W = apu.dB(apu.W) dB_W_Hz = apu.dB(apu.W / apu.Hz) dB_W_m2 = apu.dB(apu.W / apu.m**2) dB_W_m2_Hz = apu.dB(apu.W / apu.Hz / apu.m**2) dB_Jy_Hz = apu.dB(apu.Jy * apu.Hz) dBm = dB_mW = apu.dB(apu.mW) dBm_MHz = dB_mW_MHz = apu.dB(apu.mW / apu.MHz) dB_uV_m = apu.dB(apu.uV**2 / apu.m**2) dB_1_m = apu.dB(1. / apu.m) # for antenna factor # Astropy.unit equivalency between linear and logscale field strength # this is necessary, because the dB_uV_m is from E ** 2 (dB scale is power) # one can make use of the equivalency in the .to() function, e.g.: # Erx_unit.to(cnv.dB_uV_m, equivalencies=efield_equivalency) # this conflicts with apu.logarithmic():
'powerflux_from_efield', 'efield_from_powerflux', 'ptx_from_efield', 'efield_from_ptx', 'powerflux_from_ptx', 'ptx_from_powerflux', 'prx_from_powerflux', 'powerflux_from_prx', 'prx_from_ptx', 'ptx_from_prx', 't_a_from_prx_nu', 'prx_nu_from_t_a', 't_a_from_powerflux_nu', 'powerflux_nu_from_t_a', 'free_space_loss', 'Erx_unit', 'R0', 'efield_equivalency', ] + UNITS # define some useful dB-Scales # dimless = apu.Unit(1) dimless = apu.dimensionless_unscaled dB = dBi = dBc = apu.dB(dimless) dB_W = apu.dB(apu.W) dB_W_Hz = apu.dB(apu.W / apu.Hz) dB_W_m2 = apu.dB(apu.W / apu.m ** 2) dB_W_m2_Hz = apu.dB(apu.W / apu.Hz / apu.m ** 2) dB_Jy_Hz = apu.dB(apu.Jy * apu.Hz) dBm = dB_mW = apu.dB(apu.mW) dBm_MHz = dB_mW_MHz = apu.dB(apu.mW / apu.MHz) dB_uV_m = apu.dB(apu.uV ** 2 / apu.m ** 2) dB_1_m = apu.dB(1. / apu.m) # for antenna factor # Astropy.unit equivalency between linear and logscale field strength # this is necessary, because the dB_uV_m is from E ** 2 (dB scale is power) # one can make use of the equivalency in the .to() function, e.g.: # Erx_unit.to(cnv.dB_uV_m, equivalencies=efield_equivalency) # this conflicts with apu.logarithmic():
def get_scaling(self): return float( self._interface.query("DISP:WIND:SUBW:TRAC:Y:SCAL:RLEV?")) * u.dB( u.mW)