Astronomy--Programs to Compute Siderial Time?

W

W. eWatson

Is there a smallish Python library of basic astronomical functions?
There are a number of large such libraries that are crammed with
excessive functions not needed for common calculations.
 
W

W. eWatson

W. eWatson said:
Is there a smallish Python library of basic astronomical functions?
There are a number of large such libraries that are crammed with
excessive functions not needed for common calculations.
It looks like I've entered a new era in my knowledge of Python. I found
a module somewhat like I want, siderial.py. You can see an intro to it
at <http://infohost.nmt.edu/tcc/help/lang/python/examples/sidereal/ims//>.
It appears that I can get the code for it through section 1.2, near the
bottom. I scooped it siderial.py up, and placed it in a corresponding
file of the same name and type via NotePad. However, there is a xml file
below it. I know little about it. I thought maybe I could do the same,
but Notepad didn't like some characters in it. As I understand Python
doc files are useful. So how do I get this done, and where do I put the
files?
 
R

Roy Smith

"W. eWatson said:
Is there a smallish Python library of basic astronomical functions?
There are a number of large such libraries that are crammed with
excessive functions not needed for common calculations.

FWIW, if you have any interest in this kind of stuff, you must read the
classic book on the subject:

http://www.amazon.com/Astronomical-Formulae-Calculators-Jean-Meeus/dp/094339
6220

This is not some textbook which takes graduate level physics to understand.
It's a straight-forward primer for people who want to use calculators to
compute phase of the moon and stuff like that.
 
W

W. eWatson

Roy said:
FWIW, if you have any interest in this kind of stuff, you must read the
classic book on the subject:

http://www.amazon.com/Astronomical-Formulae-Calculators-Jean-Meeus/dp/094339
6220

This is not some textbook which takes graduate level physics to understand.
It's a straight-forward primer for people who want to use calculators to
compute phase of the moon and stuff like that.
Thanks, but I'm quite familiar with it. My copy is some 10-15 years old.
I suspect he never wrote a newer edition for any computer language. I
do have access to a C++ library, but I don't think that's going to do me
much good with Python.

My problem at the moment is finding either someone who has implemented
it or another similar module.

Note I posted just before you that I have found a siderial.py module,
but am not familiar with how one installs them or the doc mechanism.
 
J

John Machin

It looks like I've entered a new era in my knowledge of Python.

Mild curiosity: this would be a wonderful outcome, but what makes it
look so?
I found
a module somewhat like I want, siderial.py. You can see an intro to it
at <http://infohost.nmt.edu/tcc/help/lang/python/examples/sidereal/ims//>..
It appears that I can get the code for it through section 1.2, near the
bottom. I scooped it siderial.py up, and placed it in a corresponding
file of the same name and type via NotePad. However, there is a xml file
below it. I know little about it. I thought maybe I could do the same,
but Notepad didn't like some characters in it. As I understand Python
doc files are useful. So how do I get this done, and where do I put the
files?

The file you need is sidereal.py, not your twice-mentioned siderial.py
(the existence of which on the referenced website is doubtful).

What you have been reading is the "Internal maintenance
specification" (large font, near the top of the page) for the module.
The xml file is the source of the docs, not meant to be user-legible.
A very tiny amount of googling "sidereal.py" (quotes included) leads
to the user documentation at http://infohost.nmt.edu/tcc/help/lang/python/examples/sidereal/

Where do you put the files? Well, we're now down to only one file,
sidereal.py, and you put it wherever you'd put any other module that
you'd like to call ... if there's only going to be one caller, put it
in the same directory as that caller's code. More generally, drop it
in <YOUR_PYTHON_INSTALL_DIR>/Lib/site-packages
 
W

W. eWatson

John said:
Mild curiosity: this would be a wonderful outcome, but what makes it
look so?
I actually need to learn how to make a module that can be imported,
which in the short interlude I have done. Also looked into docstrings
and docs, which I now have a decent grasp of. Never really used either
doc info or writing my own module before. Easy.
The file you need is sidereal.py, not your twice-mentioned siderial.py
(the existence of which on the referenced website is doubtful).
How right you are. I misspelled it twice, and quickly found that out
when I tried to use the [side][real] (easy mnemonic, two words) module.
sidereal.
What you have been reading is the "Internal maintenance
specification" (large font, near the top of the page) for the module.
The xml file is the source of the docs, not meant to be user-legible.
What is it used for? Do I need it?
A very tiny amount of googling "sidereal.py" (quotes included) leads
to the user documentation at http://infohost.nmt.edu/tcc/help/lang/python/examples/sidereal/
Found that too as I cruised around.
Where do you put the files? Well, we're now down to only one file,
sidereal.py, and you put it wherever you'd put any other module that
you'd like to call ... if there's only going to be one caller, put it
in the same directory as that caller's code. More generally, drop it
in <YOUR_PYTHON_INSTALL_DIR>/Lib/site-packages
Again in my "learning about modules", discovered that too. I think I'm
on my way. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top