astronomy

Python implementation of n-body problem issue

筅森魡賤 提交于 2021-02-16 08:59:07
问题 I am currently trying to implement the N-body problem using Euler's method for solving differential equations. However, the graphical outputs do not seem correct, and I'm not sure where the issue in my code is after a while of testing. I'm currently using approximate values for Alpha Centauri A and B to test. This is my code: import numpy as np import matplotlib.pyplot as plt from math import floor # gravitation constant G = 6.67430e-11 # astronomical units au = 1.496e11 sec_in_day = 60 * 60

Sort out same star from Photutils DAOStarFinder Tables of multiple figures

橙三吉。 提交于 2021-01-29 19:55:20
问题 I have a series of .fit figures of the CCD telescope observation, I use DAOStarFinder in photutils to do the photometrys. I want to find out data of same stars and plot their light curves. The stars table obtained from one figure looks like: id xcentroid ycentroid sharpness roundness1 roundness2 npix sky peak flux mag JD-HELIO 1 7.2507764 7.1405824 0.25877792 -0.27655266 -0.014479976 361 0 422 12.624582 -2.7530425 2458718.4 2 2740.913 7.1539345 0.30025149 0.25451119 0.018093909 361 0 458 13

Numerical integration: Why does my orbit simulation yield the wrong result?

我的未来我决定 提交于 2021-01-28 18:01:42
问题 I read Feynman's Lecture on Physics Chapter 9 and tried to my own simulation. I used Riemann integrals to calculate velocity and position. Although all start-entry is same, my orbit look's like a hyperbola. Here is lecture note: https://www.feynmanlectures.caltech.edu/I_09.html (Table 9.2) import time import matplotlib.pyplot as plt x=list() y=list() x_in=0.5 y_in=0.0 x.append(x_in) y.append(y_in) class Planet: def __init__(self,m,rx,ry,vx,vy,G=1): self.m=m self.rx=rx self.ry=ry self.a=0 self

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

岁酱吖の 提交于 2020-12-22 05:17:34
问题 ( 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, y) with respect to A . Even worse, some points that are present in A are missing in B , and B contains many points that are not in A . I need to find the appropriate scaling, rotation, and translation that must be applied to the B set in order

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

做~自己de王妃 提交于 2020-12-22 05:13:55
问题 ( 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, y) with respect to A . Even worse, some points that are present in A are missing in B , and B contains many points that are not in A . I need to find the appropriate scaling, rotation, and translation that must be applied to the B set in order

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

半世苍凉 提交于 2020-12-22 05:13:30
问题 ( 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, y) with respect to A . Even worse, some points that are present in A are missing in B , and B contains many points that are not in A . I need to find the appropriate scaling, rotation, and translation that must be applied to the B set in order

Make a 2D histogram with HEALPix pixellization using healpy

这一生的挚爱 提交于 2020-08-01 07:00:47
问题 The data are coordinates of objects in the sky, for example as follows: import pylab as plt import numpy as np l = np.random.uniform(-180, 180, 2000) b = np.random.uniform(-90, 90, 2000) I want to do a 2D histogram in order to plot a map of the density of some point with (l, b) coordinates in the sky, using HEALPix pixellization on Mollweide projection. How can I do this using healpy ? The tutorial: http://healpy.readthedocs.io/en/v1.9.0/tutorial.html says how to plot a 1D array, or a fits

Image plotted from a FITS file with matplotlib oriented incorrectly

女生的网名这么多〃 提交于 2020-06-11 10:50:16
问题 I'm having a little issue with something regarding plotting a fits image using matplotlib 's imshow . It seems that my image is flipped both horizontally and vertically. I'm sure there is something simple I am overlooking, if anyone could point me in the right direction that would be great. This is what my image should look like: So, I'm loading my image as: from astropy.io import fits import matplotlib import matplotlib.pyplot as pyplot #Opening/reading in my fits file hdulist = fits.open('.

Plotting Idealized Blackbody Spectra

天涯浪子 提交于 2020-06-01 06:44:46
问题 So I am getting a couple errors RuntimeWarning: overflow encountered in exp intensity = a/ ( (wav**5) * (np.exp(b) - 1.0) ) and RuntimeWarning: invalid value encountered in multiply intensity = a/ ( (wav**5) * (np.exp(b) - 1.0) ) Even with these errors (and one more about dividing by zero that I ignore lol) my graph gets produced correctly either way. I am just wondering if anyone can help me clear up these errors? Please and thanks. Here is the full code: import numpy as np import matplotlib

How do I automate the usage of a program in Python?

不羁岁月 提交于 2020-02-07 00:04:32
问题 so basically what I need to do is write a program which will look in a directory and load all the files of a specific file type into a program called "Astrometrica". I then want the code to basically automate what I would do in the program. I'm working on my science fair project which I'm entering into the astronomy category. --.fits = flexible image transport system. My images are stored in this file type. --I'm looking at images of space and certain stars. What I usually do in Astrometrica