astronomy

Python Ephem / Datetime calculation

社会主义新天地 提交于 2019-12-10 18:54:08
问题 the output should process the first date as "day" and second as "night". I've been playing with this for a few hours now and can't figure out what I'm doing wrong. Any ideas? Edit I assume that the problem is due to my date comparison implementation Output: $ python time_of_day.py * should be day: event date: 2010/4/6 16:00:59 prev rising: 2010/4/6 09:24:24 prev setting: 2010/4/5 23:33:03 next rise: 2010/4/7 09:22:27 next set: 2010/4/6 23:34:27 day * should be night: event date: 2010/4/6 00

How to compute (alt, az) for given Galactic coordinate (GLON, GLAT) with PyEphem?

一个人想着一个人 提交于 2019-12-10 17:44:11
问题 For a given observer (lon, lat, time) on Earth and a given Galactic coordinate (GLON, GLAT), how can I compute the corresponding (alt, az) point in the sky with PyEphem? 回答1: Given the way that PyEphem currently works, there are two steps to answering your question. First, you have to convert a pair of galactic coordinates into an equatorial RA/dec pair of coordinates instead. import ephem # Convert a Galactic coordinate to RA and dec galactic_center = ephem.Galactic(0, 0) eq = ephem

Fitting an ellipse through orbital data

二次信任 提交于 2019-12-10 16:25:46
问题 I've generated a bunch of data for the (x,y,z) coordinates of a planet as it orbits around the Sun. Now I want to fit an ellipse through this data. What I tried to do: I created a dummy ellipse based on five parameters: The semi-major axis & eccentricity that defines the size & shape and the three euler angles that rotate the ellipse around. Since my data is not always centered at origin I also need to translate the ellipse requiring additional three variables (dx,dy,dz). Once I initialise

Why is my astronomy simulation inaccurate?

人走茶凉 提交于 2019-12-10 10:53:48
问题 I've made a program that simulates movement of bodies in the solar system, however, I'm getting various inaccuracies in my results. I believe that it probably has something to do with my integration method. tl;dr there's a slight difference between the position and velocity of Earth between my simulation and NASA's data, if you could please look at my code below and tell me whether my math is wrong. The test I've ran is a 10 day long (864000 seconds) simulation, that starts at Thu Mar 13 18

Is it possible to make a correlation between an image and a constellation?

瘦欲@ 提交于 2019-12-10 10:02:30
问题 What I'm trying to do is to create a relation between an image which has been taken by a mobile phone and a constellation. Let's suppose I've been given the whole coordinates of each constellations from NASA and I can recognize some specified objects as coordinate points on the image. How can I make a relation between those different coordinates? How can I point geometrical similarities between image and any constellation? What kind of an algorithm could help the situation? 回答1: I think you

Results for Observer() seemingly not accounting for elevation effects in PyEphem

若如初见. 提交于 2019-12-10 02:41:50
问题 I've a query on the results given by the PyEphem module relating to Observer() queries, and the effects of elevation. I understand from a couple of sources (such as http://curious.astro.cornell.edu/question.php?number=388) that the elevation of the observer has a marked effect on sunset time. However in the following code, I see next to no difference: import ephem emphemObj = ephem.Observer() emphemObj.date = '2011/08/09' emphemObj.lat = '53.4167' emphemObj.long = '-3' emphemObj.elevation = 0

Use of scipy.signal.lombscargle

孤人 提交于 2019-12-09 02:32:30
For class, we are trying to prove a simple example of the Lomb-Scargle Periodogram using the embedded package in scipy. There is little documentation on how to use this function, and I have not been able to find any help online. When I run the code, I get a value of ~6.3 for the main peak of the periodogram, as opposed to the expected ~23.3. The data that we are pulling from is a simple .dat file with lists of numbers. Here is the code, any ideas on what's happening? import scipy as sp import math as m import numpy as np from scipy.signal import lombscargle import pylab as plt from numpy

Use of scipy.signal.lombscargle

瘦欲@ 提交于 2019-12-08 06:24:29
问题 For class, we are trying to prove a simple example of the Lomb-Scargle Periodogram using the embedded package in scipy. There is little documentation on how to use this function, and I have not been able to find any help online. When I run the code, I get a value of ~6.3 for the main peak of the periodogram, as opposed to the expected ~23.3. The data that we are pulling from is a simple .dat file with lists of numbers. Here is the code, any ideas on what's happening? import scipy as sp import

Using the Ruby Date class for Astronomical data

早过忘川 提交于 2019-12-08 02:54:20
问题 ~ Approximate Solar Noon lw = 88.743 # my longitude jdate = Date.ordinal_to_jd(Time.now.year, Time.now.yday) n = (jdate - 2451545 - 0.0009 - lw / 360).round # lw is users longitude west of 0. j_noon = 2451545 + 0.0009 + lw / 360 + n puts j_noon => 2455616.24740833 As an update, part of the confusion would be that solar noon is where all calculations started since January 1, 4713 BC Greenwich noon. The correct use of Date.ordinal_to_jd has not compensated for this fact. So by adding or

Slicing a circle in equal segments, Python

时间秒杀一切 提交于 2019-12-07 02:32:14
问题 I have a set of close of 10,000 points on the sky. They are plotted using the RA (right ascension) and DEC (declination) on the sky. When plotted, they take the shape of a circle. What I would like to do is to slice the circle into 8 equal parts and remove each part one at a time and do some calculations using the remaining parts. To do so I came up with this illustration in mind, i.e. slicing them using the arcs. I know that the equation of the arc is given by: S = r * theta where r -->