def non_celestial_pixel_scales(inwcs):
 if inwcs.is_celestial:
  raise ValueError(u'WCS is celestial, use celestial_pixel_scales instead')
 pccd = inwcs.pixel_scale_matrix
 if np.allclose(np.extract((1 - np.eye(*pccd.shape)), pccd), 0):
  return (np.abs(np.diagonal(pccd)) * u.deg)
 else:
  raise ValueError(u'WCS is rotated, cannot determine consistent pixel scales')

def non_celestial_pixel_scales ( inwcs ) : if inwcs . is_celestial : raise ValueError ( u'WCS is celestial, use celestial_pixel_scales instead' ) pccd = inwcs . pixel_scale_matrix if np . allclose ( np . extract ( ( 1 - np . eye ( * pccd . shape ) ) , pccd ) , 0 ) : return ( np . abs ( np . diagonal ( pccd ) ) * u . deg ) else : raise ValueError ( u'WCS is rotated, cannot determine consistent pixel scales' )
calculate the pixel scale along each axis of a non-celestial wcs .