Skip to main content
51 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,788
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
  • 34.1k
20 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
  • 153k
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
  • 153k
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
  • 36.6k
10 votes

How to calculate the true distance of the sun and the earth using skyfield?

Your procedure is sound! Here is the same calculation, using Skyfield's ability to build a vector of all the hours of the year 2030, and NumPy's ability to find where the maximum and minimum occur in ...
Brandon Rhodes's user avatar
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'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
  • 123k
8 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
  • 153k
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
  • 38.5k
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
  • 153k
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
  • 153k
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.7k
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
  • 569
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,357
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
  • 38.5k
6 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
  • 30.6k
6 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
  • 17.1k
5 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
  • 30.6k
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
  • 123k
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
  • 153k
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
  • 34.1k
5 votes
Accepted

What objects can I search for using astropy.coordinates?

The astropy.coordinates packages has the SkyCoord.from_name() convenience method (docs link) uses the Sesame name resolver at ...
astrosnapper's user avatar
  • 8,357
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
  • 153k
5 votes
Accepted

How can I get a list of the closest x stars and their distances from the Gaia ESA Archive using Python?

I faced this issue recently, and the solution I came up with was to write a custom query using the ADQL documentation and then use astroquery to process the query. <...
Roy Smart's user avatar
  • 1,492
5 votes

Help with simulating long-term orbital dynamics of exoplanetary systems using Rebound

Your units look all mixed up. You set G to SI units, but you do nothing with this value, so the simulator will continue to use sim.G = 1. If you are setting G to ...
James K's user avatar
  • 123k
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,357

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