def plate_scale(platescale):
 if platescale.unit.is_equivalent((si.arcsec / si.m)):
  platescale_val = platescale.to((si.radian / si.m)).value
 elif platescale.unit.is_equivalent((si.m / si.arcsec)):
  platescale_val = (1 / platescale).to((si.radian / si.m)).value
 else:
  raise UnitsError(u'The pixel scale must be in angle/distance or distance/angle')
 return [(si.m, si.radian, (lambda d: (d * platescale_val)), (lambda rad: (rad / platescale_val)))]

def plate_scale ( platescale ) : if platescale . unit . is_equivalent ( ( si . arcsec / si . m ) ) : platescale_val = platescale . to ( ( si . radian / si . m ) ) . value elif platescale . unit . is_equivalent ( ( si . m / si . arcsec ) ) : platescale_val = ( 1 / platescale ) . to ( ( si . radian / si . m ) ) . value else : raise UnitsError ( u'The pixel scale must be in angle/distance or distance/angle' ) return [ ( si . m , si . radian , ( lambda d : ( d * platescale_val ) ) , ( lambda rad : ( rad / platescale_val ) ) ) ]
convert between lengths and angular units with a specified platescale .