astronomy

Objective-C Library for Sunrise and Sunset?

六月ゝ 毕业季﹏ 提交于 2019-12-20 09:16:50
问题 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? 回答1: EDSunriseSet is an open source and free Objective-C wrapper for the C languages routines created by Paul Schlyter. Calculation is done entirely by the C-code routines. EDSunrisetSet bridges those calculations to common Cocoa classes (NSDate, NSTimeZone, ...) 回答2: I've actually ported the KosherJava Library and plan to make it available

Python satellite tracking with spg4, pyephem- positions not matching

感情迁移 提交于 2019-12-19 23:24:31
问题 I'm trying to write a basic python scrip that will track a given satellite, defined with tle's, from a given location. I'm not a asto/orbital person but am trying to become smarter on it. I am running into a problem where the different models I'm using are giving me very different position answers. I have tried using: pyEphem spg4 predict (exec system call from script) The satellites I'm testing with are the ISS and directv10 (one fixed, one moving- with internet tracking available for

Trying to fit a sine function to phased light curve

有些话、适合烂在心里 提交于 2019-12-18 07:24:28
问题 import numpy as np import matplotlib.pyplot as plt from lmfit import Model,Parameters f2= "KELT_N16_lc_006261_V01_west_tfa.dat" t2="TIMES" # file name NewData2 = np.loadtxt(t2, dtype=float, unpack=True) NewData = np.loadtxt(f2,dtype=float, unpack=True, usecols=(1,)) flux = NewData time= NewData2 new_flux=np.hstack([flux,flux]) # fold period = 2.0232 # period (must be known already!) foldTimes = ((time)/ period) # divide by period to convert to phase foldTimes = foldTimes % 1 # take fractional

Local solar time function from UTC and longitude

人盡茶涼 提交于 2019-12-18 04:09:16
问题 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. 回答1: Or if you want to go even shorter, you could use NOAA's low-accuracy equations: #!/usr/local/bin/python import sys from datetime import datetime, time, timedelta from math import pi, cos, sin def solar_time(dt, longit): return ha def main(): if len(sys.argv) !=

Local solar time function from UTC and longitude

☆樱花仙子☆ 提交于 2019-12-18 04:09:09
问题 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. 回答1: Or if you want to go even shorter, you could use NOAA's low-accuracy equations: #!/usr/local/bin/python import sys from datetime import datetime, time, timedelta from math import pi, cos, sin def solar_time(dt, longit): return ha def main(): if len(sys.argv) !=

Extract historic leap seconds from tzdata

六眼飞鱼酱① 提交于 2019-12-18 03:12:06
问题 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 case is to convert between gps-time (which is basically the number of seconds since the first GPS-satellite was switched on in 1980) and UTC or local time. UTC is adjusted for leap-seconds every now and then, while gps-time increases linearly. This

Extract historic leap seconds from tzdata

拈花ヽ惹草 提交于 2019-12-18 03:11:19
问题 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 case is to convert between gps-time (which is basically the number of seconds since the first GPS-satellite was switched on in 1980) and UTC or local time. UTC is adjusted for leap-seconds every now and then, while gps-time increases linearly. This

Calculating dawn and sunset times using PyEphem

风流意气都作罢 提交于 2019-12-17 18:18:46
问题 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 回答1: For dawn amd dusk , see pyephem documentation regarding twilight In a nutshell, dawn and dusk express the time when the center of the Sun is at a particular angle below the horizon; the angle used for this calculation varies for the definition of the "civilian", navigation (nautical) and astronomical twilights which use 6,

Curve fitting with y points on repeated x positions (Galaxy Spiral arms)

匆匆过客 提交于 2019-12-17 16:53:10
问题 I currently have a MATLAB program which takes RGB images of traced spiral arms from galaxies and selects the biggest arm component and plots only that. I have tried using matlab's built in curve fitting tool with smoothing spline to fit it and I get the following result: I have tried using interp1 with parametric fitting to only get bad results. Is there a way to fit this type of curve at all? 回答1: Your fail is due to that you handle your 2D curve as function which is not the case (you got

swift sphere combine star data

两盒软妹~` 提交于 2019-12-17 07:57:49
问题 i want to build a stargazing app. And now i already built a sphere and cover it with a star map (based on celestial coordinates). ( https://svs.gsfc.nasa.gov/cgi-bin/details.cgi?aid=3895 ) now i have a json file which has the star catalog from YBS. (also based on celestial coordinates). ( http://tdc-www.harvard.edu/catalogs/bsc5.html ) i want to combine the data with star map, wishing the map to show the name of Constellation whenever my camera node turn to that place. but i don't know how to