4 ms·
For folks who might be interested in astronomical calculations but who don't want to roll their own library, astropy (https://www.astropy.org/ https://www.astro
by gammarator 4y ago
For folks who might be interested in astronomical calculations but who don't want to roll their own library, astropy (https://www.astropy.org/ https://www.astropy.org/) is widely used by professional astronomers.
- mturmon 4y agoExcellent point. The unit conversions in OP are all in astropy, as well as projections into the many possible coordinate systems. Another resource is the star/exoplanet catalogs at (https://exoplanetarchive.ipac.caltech.edu/docs/MissionStellar.html https://exoplanetarchive.ipac.caltech.edu/docs/MissionStella...), see also (https://exoplanetarchive.ipac.caltech.edu/ https://exoplanetarchive.ipac.caltech.edu/).
- nerdponx 4y agoI actually wish the unit system was split off into a separate library. I use it occasionally in my data science work, but it feels kind of silly because I don't use pretty much anything else in the library.
- ngoldbaum 4y agoYou might find unyt useful: https://unyt.readthedocs.io https://unyt.readthedocs.io Disclaimer: I am the primary unyt maintainer.
- nigamanth 4y agoWould be useful to add the standard units (SI units) from physics and for all quantities that can possibly be used.
- nerdponx 4y agoThanks, I might indeed! The one thing I really like about the Astropy system is that it's built on PEP-593 annotations and Numpy, The former being effectively free and transparent at runtime, and the latter being a nearly universal standard for numerical and scientific computing. The docs also reminded me of the existence of Pint, which is yet another standalone unit system that I keep forgetting to try. Do you have some kind of comparison document among Astropy, Pint, and Unyt? It would be helpful to have a sense of how Unyt differs from the others, otherwise my default behavior is to go with whatever is the most popular.
- ngoldbaum 4y agoMaybe you'll find the paper I wrote describing unyt (https://joss.theoj.org/papers/10.21105/joss.00809 https://joss.theoj.org/papers/10.21105/joss.00809) useful? unyt doesn't have type annotations so if you need that then it's not a good fit.
- jwrallie 4y agoPython reigns on library support, and it is usually faster than implementing your own procedures, but I found out that when you are trying to solve a complex problem where you are both learning it and solving it simultaneously, having a repl like the one in common lisp really helps you get into the zone and deeply understand your software. Sometimes it makes sense to pays the price to implement a library just for this.
- thwoeuri324 4y agoIsn't that what ipython is for ?
- ngcc_hk 4y agoIf you compare try to understand actually JavaScript has the most accessible (for normal mortal) on the state of the system. IPython you have to type and sort of print. Python on code might help as you can checkpoint and get some state during that checkpoint. If there is no problem I am not sure lisp give that much (for our mortal). Obviously when problem occur in unexpected place and suddenly the availability of the stack is great. And that is lisp winning. Not sure for general understanding as usually you have a case in mind and want to trace the state. In that case still think JavaScript, Python with code, iPython for document still ok.
- medo-bear 4y agoipython can handle this situation fine, however, cl repl leaves ipython in the dust for more complex programs also python is fine when all you are after is the end result. however if you try to understand what is going on at a deeper level in your program you will quickly discover that python is just a front end to some "black box" (how black it is will depend on your understanding of python's ffi, c, c++, fortran)
- zetalyrae 4y agoThe reason to roll my own was: what I cannot create, I do not understand.
- nynx 4y agoLove this philosophy
- ngcc_hk 4y agoIf you can, and also less dependence has less issue of security … but understanding great how about testing especially not use your use cases but others. That is a reason we still have Fortran. And for that matter lisp. Also understanding for one is great and as a libertarian and conservative, yes. But real life not just individual. If one wor n in a group, understanding in a widely use langauage like Python may be important. Key is not pure OR but and-and-sometimes-and-not.
- medo-bear 4y agowell the OP made a blog post detailing his work so everyone else can follow, clearly not about the individual
- brabel 4y agoJust wanted to thank you for the article! I really enjoyed it. It has a cool backstory: travelling between stars at the speed of light using laers... it shows practical use of CLOS which is something I've always wanted to get into but never found the time... and it shows how ChatGPT can be very helpful to write tedious code (as someone who's written really tedious parsing, bit manipulation code, I will definitely look into using it for those cases). Really recommended reading the whole thing for anyone just checking comments.