Hot answers tagged

7

Your approach is completely correct, just note three things: Logarithmic distribution First, since the distribution of masses is logarithmic in nature (as is most other things), be sure to bin them logarithmically. Otherwise you will oversample (undersample) the bins at the low-(high-)mass end. Comoving densities Second, to be able to compare mass ...


6

Random points on the surface of a sphere can be generated by allowing the azimuthal angle $\phi$ to take a uniformly distributed random value between 0 and $2\pi$. To convert this to RA in degrees you multiply by $180/\pi$. To convert to hours, minutes and seconds you divide the $\phi$ in degrees by 15, which gives the hours, divide the remainder by 60 which ...


5

Heres more python than you can shake a telescope at. I just used @RobJeffries' algorithm. This is just a python script, the real answer to the question is @RobJeffries' answer and I've just scripted it. The mathematics behind generating statistically uniform distributions is explained very nicely there as well. Python is below the plots. You can see on an X-...


5

While I'm not familiar with the package, a very quick look at the documentation suggests that you want In [90]: c.M_sun.uncertainty instead. I've just checked and this appears to be correct. > python -c "from astropy import constants as c ; print c.M_sun.uncertainty" 5e+25


4

I personally use Astropy, specifically astropy.io.fits, although I'm not a seasoned user of FITS files and I don't really know their layout. As an example snippet of code, I often load data from FITS files using from astropy.io import fits data = fits.open('data_file.fits')[0].data You'll find more information in the documentation on the FITS module.


4

Your feeling is right: You shouldn't convolve the spectrum and the filter, you should only multiply so that flux outside the bandpass is suppressed. Subsequently you integrate the resulting function over wavelength, so that flux density (in energy/time/area/wavelength) becomes flux (in energy/time/area). Simply setting the flux to 0 outside $\lambda_1$ and $...


4

There is no obvious astronomy error, but your use of math.pow is wrong You write constgrav = math.pow(6.67,-11). That means $G = 6.67^{-11}$. You mean constgrav = 6.67e-11 or $G=6.67\times 10^{-11}$. With completely different initial conditions, it is not surprising that the Earth flies off into space. As a suggestion, try not using SI units for this, ...


4

I haven't done much astronomical image processing before, but as this question is unanswered I'll give it a shot - hopefully to some avail. If the problem is more specific, a code sample/image sample would probably be useful for further diagnosis, but otherwise this example may help. It discusses the process of writing a 3-channel image to separate FITS ...


3

I want to say that's a Mollweide projection. I know that they're pretty common in astronomy; many images of the CMB use them. I was actually working with one recently. Given latitude $\varphi$ and longitude $\lambda$, the $x$ and $y$ coordinates of an object are $$x=R\frac{2\sqrt{2}}{\pi}(\lambda-\lambda_0)\cos\theta,\quad y=R\sqrt{2}\sin\theta$$ for ...


3

From eq. 10 in Hogg's classic paper, assuming that the peculiar velocity $v_\mathrm{pec} \ll c$: $$v_\mathrm{pec} = c \frac{z_\mathrm{obs} - z_\mathrm{cos}}{1 + z_\mathrm{cos}},$$ where $z_\mathrm{obs}$ is the observed redshift, and $z_\mathrm{cos}$ is the redshift from cosmological expansion only. Let me invert that and wrap it up in Python for ya: def ...


3

If you were working with a rectangular coordinate system as shown in the figure below (that also had no bounds), then it is correct that the right ascension would be $RA=RA_p\pm d$ (points 1 and 3) and the declination would be $Dec=Dec_p \pm d$ (points 2 and 4) where d is the radius of the circle. The sky is spherical, so the lines of RA are not a constant ...


3

Not sure what you are expecting to see from the two datasets. Both datasets are examples of light curves, flux against time with different arbitrary origins for the time axis; SuperWASP TMID is integer seconds from Julian Date 2453005.5, Kepler uses BKJD = Barycentric Kepler Julian Date, but offset by 2454833.0. i.e., BKJD = BJD - 2454833.0. The SuperWASP ...


3

Assuming x, y = rrl_pm.l, rrl_pm.b The transformation you want is xx = [(q+180)%360 - 180 for q in x] Add 180, do modulo 360, then subtract 180. Then set your limits ax.set_xlim(180, -180) import matplotlib.pyplot as plt x = (0, 10, 20, 40, 80, 160, 200, 280, 320, 340, 350) y = (0, 10, 20, 30, 40, 50, -50, -40, -30, -20, -10) fig = plt.figure(...


3

This code reads coordinates as equatorial (ra, dec) and transforms them to galactic (l, b): eq = SkyCoord(xarr[:], yarr[:], unit=u.deg) gal = eq.galactic The contents of 'galacticwperiod.csv' are already in galactic coordinates and should not be transformed. Something like this may give better results: gal = SkyCoord(xarr[:], yarr[:], frame='galactic', ...


3

The La2010 long-term ephemeris Laskar et al. (2011), which is based on the INPOP numerical ephemeris integrated for 1 Myr, is valid for 250 million years before the present day and a unknown distance into the future. The authors note that due to chaotic motion in the Solar System, the accuracy degrades significantly beyond -50 Myr and likely a similar time ...


3

This is not an answer. I computed all major planet conjunctions in DE431 to answer How to calculate conjunctions of 2 planets and you might be able to port what I did (using CSPICE) to skyfield. Several of the more interesting conjunctions I found are here: http://search.astro.barrycarter.info/table.html including 5 and 6 planet conjunctions: http://...


2

From the documentation >>> c1 = SkyCoord(ra=10*u.degree, dec=9*u.degree, distance=10*u.pc, frame='icrs') >>> c2 = SkyCoord(ra=11*u.degree, dec=10*u.degree, distance=11.5*u.pc, frame='icrs') >>> c1.separation_3d(c2) <Distance 1.5228602415117989 pc> The rest of the code is just reading the excel files and printing the ...


2

There were a few other small errors in your translation (such as indenting too much stuff in two of the if statements), and I think you might have been trying to be too clever with changing SUBROUTINE into defined functions when it was a lot easier to just drop the code in-line since it was only used once. There were minor tweaks and as far as I can tell ...


2

Generating random galaxy catalogs for correlation functions ... the random catalog can be just be a uniform distribution of points in the same volume as the real data. However, real-world galaxy catalogs are not homogenous boxes, and have very irregular shapes and observationally induced redshift and angular distributions. Even some mock-catalogs ...


2

I believe the differences here are caused by the different timescales that are being used by SkyField vs NASA. It seems that SkyField uses the proleptic Gregorian calendar for dates in the past. However, NASA used the Julian Calendar for dates before 1582, so for example, the eclipse on 0150-12-06 (Julian) falls on 0150-12-05 in Gregorian. Also, I would ...


2

You can't really get a PSF for an extended object. The Point-Spread-Function is a parameter of your imaging system which describes the shape of the image of a putative point source. I don't have any knowledge of what your python package is intended to do, so I can't comment directly on the results. I will point (sorry) out that the geometric centroid of ...


2

There are a few details here that make this non-trivial. The year doesn't matter much, since the same stars are visible each year. Further, in Stellarium, you can set the date to 1889 so this is not an issue but we have to turn off atmospheric effects to make the stars visible. More tricky is that the Brazilian flag is designed as if viewed "from above". We ...


2

The issue appears to be in your understanding of the separation function. You state that it calculates the separation (angle) between those 2 planets with respect to their "x" projection in a plane. however, the documentation states The separation() function computes the angle in degrees between two bodies, as measured by their right ascension and ...


2

Imagine that you are at 80 degrees north and 0 degrees east (on the Prime Meridian). It is only 10 latitude degrees from you to the north pole. Notice that the distance from you to the 45th meridian (shown in green) is about 7 latitude degrees ($\sin{\pi/4}\cdot 10$) because if you walked to the closest point on the 45th meridian, the north pole would ...


2

I kinda found a solution, unfortunately it's a few hundredths of a degree off from those specified by Horizons. And it requires you to define a custom kernel for the observer's reference frame, which isn't bad as long as your doing a lot of observations from one location. The code below is in Python and requires spiceypy ("pip install spiceypy"). import ...


2

I forgot changing the unit of the distance from parsec to light year. This is a simple unit conversion error which should have been avoided. Ultimate Graph: Data Used: Name,RA(deg),Dec(deg),pm_RA(mas/yr),pm_Dec(mas/yr),Vr(km/s),parallax(mas) Wolf 359,164.120271,+07.014658,-3842.0,-2725.0,19.321,418.3 Proxima Centauri,217.42895219,-62.67948975,-...


2

Thank you for your guiding comments. Compute Moon's declination and searching for Moon to begin ascend/descend can be quite easily achieved though skyfield API so I am posting some starter python code here: from calendar import monthrange from skyfield.api import load planets = load('de431_part-2.bsp') earth, moon = planets['earth'], planets['moon'] ts =...


2

FFI means "full frame image". It does not contain any tables, so the unhelpful error message is almost certainly due to that. Chapter 2 of the Kepler Archive Manual is essential reading. Light curve files have a file name suffix of .llc or .slc (long and short cadence), as described in that document, and contain binary fits tables that can be opened and ...


1

The image is 2D pixels, the PSF fitting routine would do something like this. First, you pick the PSF function, which is a 2D gaussian in this case. Then, the routine will choose a centroid, mu, and variance (or mus and variances). A couple of things that will complicate the routine. i) Local peak due to a noise. This will mess up the centroid. Fixing is to ...


Only top voted, non community-wiki answers of a minimum length are eligible