def __init__(self, start, end, near=None): self.start = parse_time(start) self.end = parse_time(end) self.near = None if near is None else parse_time(near) _Range.__init__(self, self.start, self.end, self.__class__) Attr.__init__(self)
def __init__(self, start, end, near=None): self.start = anytim(start) self.end = anytim(end) self.near = None if near is None else anytim(near) _Range.__init__(self, start, end, self.__class__) Attr.__init__(self)
def __init__(self, start, end, near=None): self.start = start self.end = end self.near = near _Range.__init__(self, start, end, self.__class__) Attr.__init__(self)
def __init__(self, wavemin, wavemax, waveunit='Angstrom'): self.min, self.max = sorted( to_angstrom(v, waveunit) for v in [float(wavemin), float(wavemax)]) self.unit = 'Angstrom' Attr.__init__(self) _Range.__init__(self, self.min, self.max, self.__class__)
def __init__(self, x, y, width, length, type_): Attr.__init__(self) self.x = x self.y = y self.width = width self.length = length self.type = type_
def __init__(self, x, y, width, length, atype): Attr.__init__(self) self.x = x self.y = y self.width = width self.length = length self.type = atype
def __init__(self, wavemin, wavemax, waveunit='Angstrom'): self.min, self.max = sorted( to_angstrom(v, waveunit) for v in [wavemin, wavemax] ) self.unit = 'Angstrom' Attr.__init__(self) _Range.__init__(self, self.min, self.max, self.__class__)
def __init__(self, start, end=None, near=None): if end is None and not isinstance(start, _TimeRange): raise ValueError("Specify start and end or start has to be a TimeRange") if isinstance(start, _TimeRange): self.start = start.start self.end = start.end else: self.start = parse_time(start) self.end = parse_time(end) self.near = None if near is None else parse_time(near) _Range.__init__(self, self.start, self.end, self.__class__) Attr.__init__(self)
def __init__(self, wavemin, wavemax=None): """ Specifies the wavelength or spectral energy range of the detector. Parameters ---------- wavemin : `~astropy.units.Quantity` The lower bounds of the range. wavemax : `~astropy.units.Quantity` The upper bound of the range, if not specified it will default to the lower bound. Notes ----- The VSO understands the 'wavelength' in one of three units, Angstroms, kHz or keV. Therefore any unit which is directly convertable to these units is valid input """ if not wavemax: wavemax = wavemin if not all(isinstance(var, u.Quantity) for var in [wavemin, wavemax]): raise TypeError("Wave inputs must be astropy Quantities") if not all([wavemin.isscalar, wavemax.isscalar]): raise ValueError("Both wavemin and wavemax must be scalar values") # VSO just accept inputs as Angstroms, kHz or keV, the following # converts to any of these units depending on the spectral inputs # Note: the website asks for GHz, however it seems that using GHz # produces weird responses on VSO. supported_units = [u.AA, u.kHz, u.keV] for unit in supported_units: if wavemin.unit.is_equivalent(unit): break else: unit = None if unit is None: raise u.UnitsError( "This unit is not convertable to any of {}".format( supported_units)) self.min, self.max = sorted([wavemin.to(unit), wavemax.to(unit)]) self.unit = unit Attr.__init__(self) _Range.__init__(self, self.min, self.max, self.__class__)
def __init__(self, start, end=None): if end is None and not isinstance(start, _TimeRange): raise ValueError("Specify start and end or start has to be a TimeRange") if isinstance(start, _TimeRange): self.start = start.start self.end = start.end else: self.start = start if isinstance(start, astropyTime) else astropyTime(parse_time(start)) self.end = end if isinstance(end, astropyTime) else astropyTime(parse_time(end)) if self.start > self.end: raise ValueError("End time must be after start time.") _Range.__init__(self, self.start, self.end, self.__class__) Attr.__init__(self)
def __init__(self, wavemin, wavemax=None): """ Specifies the wavelength or spectral energy range of the detector. Parameters ---------- wavemin : `~astropy.units.Quantity` The lower bounds of the range. wavemax : `~astropy.units.Quantity` The upper bound of the range, if not specified it will default to the lower bound. Notes ----- The VSO understands the 'wavelength' in one of three units, Angstroms, kHz or keV. Therefore any unit which is directly convertible to these units is valid input. """ if not wavemax: wavemax = wavemin if not all(isinstance(var, u.Quantity) for var in [wavemin, wavemax]): raise TypeError("Wave inputs must be astropy Quantities") if not all([wavemin.isscalar, wavemax.isscalar]): raise ValueError("Both wavemin and wavemax must be scalar values") # VSO just accept inputs as Angstroms, kHz or keV, the following # converts to any of these units depending on the spectral inputs # Note: the website asks for GHz, however it seems that using GHz # produces weird responses on VSO. supported_units = [u.AA, u.kHz, u.keV] for unit in supported_units: if wavemin.unit.is_equivalent(unit): break else: unit = None if unit is None: raise u.UnitsError("This unit is not convertable to any of {}".format(supported_units)) self.min, self.max = sorted([wavemin.to(unit), wavemax.to(unit)]) self.unit = unit Attr.__init__(self) _Range.__init__(self, self.min, self.max, self.__class__)
def __init__(self, wavemin, wavemax): if not all(isinstance(var, u.Quantity) for var in [wavemin, wavemax]): raise TypeError("Wave inputs must be astropy Quantities") # VSO just accept inputs as Angstroms, kHz or keV, the following # converts to any of these units depending on the spectral inputs # Note: the website asks for GHz, however it seems that using GHz # produces weird responses on VSO. convert = {'m': u.AA, 'Hz': u.kHz, 'eV': u.keV} for k in convert.keys(): if wavemin.decompose().unit == (1 * u.Unit(k)).decompose().unit: unit = convert[k] try: self.min, self.max = sorted( value.to(unit) for value in [wavemin, wavemax] ) self.unit = unit except NameError: raise ValueError("'{0}' is not a spectral supported unit".format(wavemin.unit)) Attr.__init__(self) _Range.__init__(self, self.min, self.max, self.__class__)
def __init__(self, value): if not (isinstance(value, u.Quantity) or isinstance(value, list)): raise TypeError("Wave inputs must be astropy Quantities") Attr.__init__(self) self.value = value
def __init__(self, value): Attr.__init__(self) self.value = value
def __init__(self, label, value): Attr.__init__(self) self.label = label self.value = value