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.

530 questions
84
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,600
  • 1
  • 18
  • 25
38
votes
7 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
  • 6,342
  • 2
  • 21
  • 20
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
24
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,416
  • 5
  • 26
  • 47
23
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
  • 83,104
  • 64
  • 169
  • 214
21
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
  • 16,651
  • 3
  • 38
  • 58
19
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…
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
  • 55,729
  • 73
  • 263
  • 420
17
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
  • 5,921
  • 7
  • 47
  • 79
14
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
  • 32,750
  • 58
  • 187
  • 337
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
  • 7,351
  • 5
  • 27
  • 33
13
votes
2 answers

How to plot Gaia astrometry data to TESS images using Python?

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
  • 3,885
  • 3
  • 14
  • 47
12
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
  • 32,750
  • 58
  • 187
  • 337
12
votes
3 answers

Python coordinate transformation ECI to ECEF

I am using sgp4 python package (developed by Brandon Rhodes); I am inputting the TLE information for ISS(Zarya). I get the position of the satellite at a certain date, in the in ECI coordinate system. However, I want to convert it to ECEF coordinate…
11
votes
1 answer

Calculations of the path of the Sun

I'm writing several methods necessary to calculate the path of the Sun across a specific point. I have written the code using two different sources for my calculations and neither is producing the desired result. The sources are:…
wellington
  • 401
  • 1
  • 6
  • 18
1
2 3
35 36