Usage of astropy.coordinates in SunPy

Going into the technical details a bit, I used only units of astropy into sunpy.sun. Once Cadair pointed out that there is a Latitude, Longitude and Angle classes to represent a quantity with angles, much more cleanly, I thought it would be a good idea to use them for following reasons:

1) Users can easily change the given output of the functions to the unit they desire by using the attributes of the above said class.
For example, if the output is in degrees, and someone wishes to see that in arcsec, they can use
`result = sun.some_function(“2012/11/11″)

       result.arcsec `

    Just by using this attribute the units can be converted.

2) It would be easier to find out errors. For example, an input for the Latitude class cannot exceed 90°, so if the user gives more than       that it would display an error(even though quite obvious). 

3)  And matching with the original intent, it forces the user to be more explicit about their input. Although in this case(sun.py), the input is not in some quantity, the output is explicit about the unit being used.

Thats about it. Perhaps I should post some screenshots of the output next time.
Cheers!

Leave a comment