Hot answers tagged

52 votes
Accepted

Why won't the Sun set for days at N66.2 which is below the arctic circle?

From the PyEphem Quick Reference Guide: Rising and setting are sensitive to atmospheric refraction at the horizon, and therefore to the observer’s temp and pressure; set the pressure to zero to turn ...
notovny's user avatar
  • 4,696
22 votes

Why won't the Sun set for days at N66.2 which is below the arctic circle?

Correct me if I am wrong, but if we count sunsets by the center of the Sun apparently crossing the horizon then the Sun is supposed to set every day at latitudes under the arctic circle. That is not ...
David Hammen's user avatar
  • 33.4k
21 votes

Why does the Fourier transform of this CMB image have a hole in it?

Having now looked at the paper by Aiola et al. (2020), it emerges that for that map, they filtered the data to exclude low frequency multipoles with $|l|<150$, corresponding to about 1 degree. This ...
ProfRob's user avatar
  • 146k
19 votes
Accepted

Why does the Fourier transform of this CMB image have a hole in it?

For that specific E-mode map we have applied a Wiener filter to highlight the high SN modes (those "rings"). I also further apply the following filter: $((1 + (kx/5)^{-4})^{-1}) * ((1 + (k/...
Simone Aiola's user avatar
11 votes

Is a Hertz ratio to 65M ☉ proof that Betelgeuse had a core collapse in 1491 from a gravitational wave on January 14, 2020?

No, for several reasons. The expected gravitational wave signature of a core collapse supernova looks nothing like that from a merging black hole binary system, so no sensible comparison can be done ...
ProfRob's user avatar
  • 146k
11 votes
Accepted

Astropy units issue

In Astropy, u.G represents a Gauss, not the gravitational constant. That's why you get the "A" in one of the error messages; it represents an ampere. To ...
HDE 226868's user avatar
  • 36k
9 votes

Why won't the Sun set for days at N66.2 which is below the arctic circle?

Wikipedia's article on the Arctic Circle provides the explanation. Firstly, it says: because the sun appears as a disk and not a point, part of the midnight sun may be seen on the night of the ...
Chappo Hasn't Forgotten Monica's user avatar
9 votes
Accepted

Convert from spectral type to RGB color?

Below is a model taken from Mitchel Charity's page, What color are the stars? Other points, if required, may be obtained by interpolation. There are plenty of caveats with this and you should ...
James K's user avatar
  • 115k
8 votes
Accepted

How do I create a galaxy stellar mass function?

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 ...
pela's user avatar
  • 37k
8 votes
Accepted

What does "additive fringing from the (multiplicative) twilights" mean?

The fringing pattern is caused by thin-film interference within the CCD. The signal received in a pixel will be proportional to the light falling on it, multiplied by a sensitivity, but then some ...
ProfRob's user avatar
  • 146k
8 votes

Determining period of an exoplanet using radial velocity data

Fit a model of the RVs predicted from a Keplerian orbit to the data (a sine wave for a circular orbit). The period obtained is the period of the orbit. In terms of an initial guess for the period - ...
ProfRob's user avatar
  • 146k
7 votes

Generate a uniform distribution on the sky

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 ...
ProfRob's user avatar
  • 146k
7 votes
Accepted

How do I plot galactic coordinates using matplotlib and astropy in python?

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 ...
Mike G's user avatar
  • 18.2k
7 votes

Open source code for the maths behind a heliostat?

I wrote the source you need some years ago: https://jumpjack.wixsite.com/progetti/sorgenti-ipsun The Arduino/Processing version was just a demo program to manually control a TENVIS camera by multiple ...
jumpjack's user avatar
  • 543
7 votes

Accessing SDSS server SQL server via python

You can do it via the astroquery SDSS module; there is a function called query_sql.
Eric Jensen's user avatar
  • 4,864
7 votes
Accepted

Different results for the same JPL Horizons query

The issue is with differences in how the defaults behave between the code and the website. In the code version of the API id=3 gives the Earth-Moon Barycenter (as ...
astrosnapper's user avatar
  • 8,313
6 votes
Accepted

How can I convolve a template spectrum with a photometric filter response spectrum?

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 ...
pela's user avatar
  • 37k
5 votes
Accepted

Generate a uniform distribution on the sky

Heres more python than you can shake a telescope at. I just used @ProfRob's algorithm. This is just a python script, the real answer to the question is @ProfRob's answer and I've just scripted it. The ...
uhoh's user avatar
  • 31.4k
5 votes

Earth Orbit Simulator

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 ...
James K's user avatar
  • 115k
5 votes

Get orbital period of exoplanet from light curve using astropy.timeseries

The second light curve you show has no obvious periodic behaviour and I cannot see any sign of a planetary transit. The period-finding algorithm appears to be working correctly. The planet (if it ...
ProfRob's user avatar
  • 146k
5 votes

What does "additive fringing from the (multiplicative) twilights" mean?

The visual appearance of fringing is caused by the CCD (thickness) being comparable to the size of the wavelength (thin-film interference). An everyday example (same physics except with more colors) ...
Astroturf's user avatar
  • 1,111
5 votes
Accepted

Cannot identify mistake in calculating orbital eccentricity vector; magnitude equals one instead of zero (with python code)

You are doing many things wrong. You are computing the eccentricity of one body with respect to the center of mass. You need to compute the eccentricity of one body with respect to the other. You ...
David Hammen's user avatar
  • 33.4k
5 votes
Accepted

How to extract galaxy spectra for different radii in Python for spectra taken by long slit spectrograph?

I was wondering why the absorbtion lines of the template are broader then those of the galaxy, since it actually should be the other way arround. You are correct that it should be the other way ...
Peter Erwin's user avatar
  • 16.4k
5 votes

Using Einsteinpy to plot the precession of a star orbiting a black hole?

This is an interesting development, thanks for bringing it to our (my) attention. Unfortunately, the documentation is lagging the code. The package is using natural, geometrised units, where $G=c=1$ ...
ProfRob's user avatar
  • 146k
5 votes

Plotting scatter graphs with fits binary file?

It's generally best to use Astropy's Table/QTable functionality to manipulate the table data, rather than dealing with the FITS binary table directly. Building on ...
astrosnapper's user avatar
  • 8,313
4 votes
Accepted

What is the 2D elliptical projection of the Celestial Sphere called, and how can I make one?

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 ...
HDE 226868's user avatar
  • 36k
4 votes

Generate a uniform distribution on the sky

Supplemental answer for future readers here who are more interested in the "uniformness" than the "randomness" or "realism" of the distribution. Here are two Stack ...
uhoh's user avatar
  • 31.4k
4 votes
Accepted

Python with image in fits format

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 ...
Warrick's user avatar
  • 2,827
4 votes

Converting an RGB image to fits (astropy)

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 ...
Nitesh Menon's user avatar
4 votes

Propagate Earth trajectory for 1 Myr

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 ...
astrosnapper's user avatar
  • 8,313

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