old_contents: from __future__ import absolute_import
  
  import numpy as np
  from scipy.constants import constants
  
  __all__ = ['degrees_to_hours', 'degrees_to_arc', 'kelvin_to_keV', 
             'keV_to_kelvin', 'to_angstrom']
             
  def degrees_to_hours(angle):
      """Converts an angle from the degree notation to the hour, arcmin, arcsec 
      notation (returned as a tuple)."""
      hour = int(np.floor(angle / 15))
      remainder = angle / 15.0 - hour
      arcminute = int(np.floor(remainder * 60))
      remainder =  remainder * 60 - arcminute
      arcsecond = remainder * 60.0
      return [hour, arcminute, arcsecond]
  
  def degrees_to_arc(angle):
      """Converts decimal degrees to degree, arcminute, 
      arcsecond (returned as a tuple)."""
      degree = int(np.floor(angle))
      remainder = angle - degree
      arcminute = int(np.floor(remainder * 60))
      remainder =  remainder * 60 - arcminute
      arcsecond = remainder * 60.0
      return [degree, arcminute, arcsecond]
  
  wavelength = [
      ('Angstrom', 1e-10),
      ('nm', 1e-9),
      ('micron', 1e-6),
      ('micrometer', 1e-6),
      ('mm', 1e-3),
      ('cm', 1e-2),
      ('m', 1e-6),
  ]
  
  energy = [
      ('eV', 1),
      ('keV', 1e3),
      ('MeV', 1e6),
  ]
  
  frequency = [
      ('Hz', 1),
      ('kHz', 1e3),
      ('MHz', 1e6),
      ('GHz', 1e9),
  ]
  
  units = {}
  for k, v in wavelength:
      units[k] = ('wavelength', v)
  for k, v in energy:
      units[k] = ('energy', v)
  for k, v in frequency:
      units[k] = ('frequency', v)
  
  def to_angstrom(value, unit):
      C = 299792458.
      ANGSTROM = units['Angstrom'][1]  
      try:
          type_, n = units[unit]
      except KeyError:
          raise ValueError('Cannot convert %s to Angstrom' % unit)
      
      if type_ == 'wavelength':
          x = n / ANGSTROM
          return value / x
      elif type_ == 'frequency':
          x = 1 / ANGSTROM / n
          return x * (C / value)
      elif type_ == 'energy':
          x = 1 / (ANGSTROM / 1e-2) / n
          return x * (1 / (8065.53 * value))
      else:
          raise ValueError('Unable to convert %s to Angstrom' % type_)
  
  def kelvin_to_keV(temperature):
      """Convert from temperature expressed in Kelvin to a 
      temperature expressed in keV"""
      return temperature / (constants.e / constants.k * 1000.0) 
  
  def keV_to_kelvin(temperature):
      """Convert from temperature expressed in keV to a temperature 
      expressed in Kelvin"""
      return temperature * (constants.e / constants.k * 1000.0) 
new_contents: from __future__ import absolute_import
  
  import numpy as np
  from scipy.constants import constants
  from astropy import units
  
  __all__ = ['degrees_to_hours', 'degrees_to_arc', 'kelvin_to_keV', 
             'keV_to_kelvin', 'to_angstrom']
             
  def degrees_to_hours(angle):
      """Converts an angle from the degree notation to the hour, arcmin, arcsec 
      notation (returned as a tuple)."""
      hour = int(np.floor(angle / 15))
      remainder = angle / 15.0 - hour
      arcminute = int(np.floor(remainder * 60))
      remainder =  remainder * 60 - arcminute
      arcsecond = remainder * 60.0
      return [hour, arcminute, arcsecond]
  
  def degrees_to_arc(angle):
      """Converts decimal degrees to degree, arcminute, 
      arcsecond (returned as a tuple)."""
      degree = int(np.floor(angle))
      remainder = angle - degree
      arcminute = int(np.floor(remainder * 60))
      remainder =  remainder * 60 - arcminute
      arcsecond = remainder * 60.0
      return [degree, arcminute, arcsecond]
  
  def to_angstrom(value, unit):
      """Given a value with a unit (given in a string), convert to angstroms"""
      value_quantity = value * units.Unit(unit)
      return value_quantity.to(units.angstrom, equivalencies=units.spectral()).value
  
  def kelvin_to_keV(temperature):
      """Convert from temperature expressed in Kelvin to a 
      temperature expressed in keV"""
      return temperature / (constants.e / constants.k * 1000.0) 
  
  def keV_to_kelvin(temperature):
      """Convert from temperature expressed in keV to a temperature 
      expressed in Kelvin"""
      return temperature * (constants.e / constants.k * 1000.0) 
subject: fix to issue #579 using astropy.units