I think it might be worth making your code a bit more general and putting it in jointcal/bin
Sure, I'd be happy to do that. Probably that should be a new ticket though. Would you like to create one, assign me, and maybe indicate what generalities you have in mind?
You should be able to use SpherePoint.separation() in place of your angle_between_radec().
I used SpherePoint.separation() in the get_pixel_scale_orig() function. It's commented out in the main script right now, but it yields the same output as get_pixel_scale_iwc().
I'm also a bit confused about what angle_between_uv is doing.
Yeah, sorry; I should have added some more comments there (done now). The gist is that alpha/beta/gamma are the Euclidean coordinates of the deprojected tangent plane uv coordinates, assuming a gnomonic projection:
The code after that is a robust way (for angles that aren't nearly antipodal) to compute the angle between two points on a sphere given their 3D coordinates. (Stolen from https://github.com/LSSTDESC/Coord/blob/master/coord/celestial.py#L312)