Questions tagged [astronomy]

Astronomy is the study of celestial objects, such as planets, stars, and galaxies. Any astronomy question on this site should be programming related; other astronomy questions should be asked on our sister site Astronomy Stack Exchange.

Astronomy is the study of celestial objects, such as planets, stars, and galaxies. Any astronomy question on this site should be programming related; other astronomy questions should be asked on our sister site Astronomy Stack Exchange.

619 questions
88
votes
6 answers

Position of the sun given time of day, latitude and longitude

This question has been asked before a little over three years ago. There was an answer given, however I've found a glitch in the solution. Code below is in R. I've ported it to another language, however have tested the original code directly in R to…
SpoonNZ
  • 3,780
  • 1
  • 20
  • 25
44
votes
8 answers

Moon / Lunar Phase Algorithm

Does anyone know an algorithm to either calculate the moon phase or age on a given date or find the dates for new/full moons in a given year? Googling tells me the answer is in some Astronomy book, but I don't really want to buy a whole book when I…
Scott Bailey
  • 7,748
  • 2
  • 23
  • 21
28
votes
8 answers

Star B-V color index to apparent RGB color

I'm trying to convert a star's B-V color index to an apparent RGB color. Besides look up tables and color ramps, it seems like there's no well known algorithm for doing this. What's a B-V color index? It's a number astronomers assign to a star to…
melhosseiny
  • 9,992
  • 6
  • 31
  • 48
28
votes
12 answers

What are some algorithms that will allow me to simulate planetary physics?

I'm interested in doing a "Solar System" simulator that will allow me to simulate the rotational and gravitational forces of planets and stars. I'd like to be able to say, simulate our solar system, and simulate it across varying speeds (ie, watch…
Gaius
  • 349
  • 1
  • 4
  • 5
25
votes
8 answers

How can I compute sunrise/sunset times?

I like to keep track of sunrise and sunset times. For the past couple of years I've been doing this with a small program written with a popular library for my favorite programming language. The last two months I've been keeping track of these…
skiphoppy
  • 97,646
  • 72
  • 174
  • 218
20
votes
1 answer

Stacking astronomy images with Python

I thought this was going to be easier but after a while I'm finally giving up on this, at least for a couple of hours... I wanted to reproduce this a trailing stars image from a timelapse set of pictures. Inspired by this: The original author used…
20
votes
2 answers

Extract historic leap seconds from tzdata

Is there a way to extract the moment of historic leap seconds from the time-zone database that is distributed on most linux distributions? I am looking for a solution in python, but anything that works on the command line would be fine too. My use…
Bas Swinckels
  • 18,095
  • 3
  • 45
  • 62
19
votes
7 answers

Objective-C Library for Sunrise and Sunset?

Is there an Objective-C (or C) library (that is compatible with core location) that can tell me the time of sunrise and sunset for any given calendar day?
Moshe
  • 57,511
  • 78
  • 272
  • 425
19
votes
3 answers

Produce a RA vs DEC equatorial coordinates plot with python

I'm trying to generate an equatorial coordinates plot that should look more or less like this one: (The figure is taken from this article, and it shows the position of the Large and Small MCs in equatorial coordinates) Important things to notice…
Gabriel
  • 40,504
  • 73
  • 230
  • 404
19
votes
3 answers

Calculating dawn and sunset times using PyEphem

Is it possible to calculate Dawn, Dusk, and sunset times using PyEphem? I've used PyEphem to produce day and night time, but I didn't find anything on sunset/dusk/dawn
dassouki
  • 6,286
  • 7
  • 51
  • 81
16
votes
2 answers

Match set of x,y points to another set that is scaled, rotated, translated, and with missing elements

(Why am I doing this? See explanation below) Consider two sets of points, A and B as shown below It might not look like it, but set A is "hidden" within set B. It can not be easily seen because points in B are scaled, rotated, and translated in (x,…
Gabriel
  • 40,504
  • 73
  • 230
  • 404
14
votes
2 answers

How to plot Gaia astrometry data to TESS images

Long story short: I want to plot Gaia astrometry data to TESS imagery in Python. How is it possible? See below for elaborated version. I have 64x64 pixel TESS imagery of a star with Gaia ID 4687500098271761792. Page 8 of the TESS Observatory Guide…
zabop
  • 6,750
  • 3
  • 39
  • 84
14
votes
13 answers

Interactive Data Language, IDL: Does anybody care?

Anyone use a language called Interactive Data Language, IDL? It is popular with scientists. I think it is a poor language because it is proprietary (every terminal running it has to have an expensive license purchased) and it has minimal support…
Alex
  • 8,521
  • 6
  • 31
  • 33
13
votes
4 answers

How do I compute equinox/solstice moments?

What algorithms or formulas are available for computing the equinoxes and solstices? I found one of these a few years ago and implemented it, but the precision was not great: the time of day seemed to be assumed at 00:00, 06:00, 12:00, and 18:00…
skiphoppy
  • 97,646
  • 72
  • 174
  • 218
13
votes
5 answers

Local solar time function from UTC and longitude

I'm wondering if there is a python function/module that calculates the local time after midnight (or local solar time) given the UTC time and longitude? It doesn't need to take into account daylight saving time. Thanks in advance.
Shejo284
  • 4,541
  • 6
  • 32
  • 44
1
2 3
41 42