Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

Questions about using the python programming language to solve astronomical problems.

0
votes
0answers
12 views

WCS.pix2world: Read in latitude and longitude of entire FITS field

I have FITS file in pixel coordinates. I want to basically read in its latitude and longitude. I know we can use something following: from astropy import WCS from astropy.units as units ...
1
vote
0answers
30 views

Plotting GAIA barycentric radial velocity data with python

Does anybody know of a good tutorial on how to use python and astropy to generate plots of GAIA, RAVE or any other database of barycentric (heliocentric) radial velocity data of stars in our galaxy? ...
2
votes
1answer
31 views

Calculating right ascension for two planets and their separation using python

I am experimenting with the Python library PyEphem for astronomy, and I am trying to recreate/understand some of the basic calculations there. There is a function called separation that, given two ...
2
votes
2answers
94 views

Fitting PSF to an image to get total flux (Python)

I have an image of a single unsaturated source (asteroid) that I'd like to fit guesses for various model PSFs to, so that I can then compare the total flux in each case. I've only recently begun ...
1
vote
0answers
29 views

Comoving distance between two points [(RA1, Dec1, z1) and (RA2, Dec2, z2)]

I have Redshift (z), RA and Dec positions for two points in a galaxy catalogue (say P1 = [<...
2
votes
1answer
154 views

How to construct a sky map

First of all, I have very basic knowledge of astronomy so sorry if I make some mistakes in my terminology. I'd like to plot the Southern Cross. I can find the name of its 5 stars. Also, I have some ...
1
vote
0answers
30 views

Efficiently calculating power spectra from galaxy catalogs

I am dealing with a problem which requires calculating either the correlation function or the power spectrum. At times, the 2-point-correlator seems the better route, at others, the PS. Right now I am ...
2
votes
2answers
233 views

Python: Find brightest pixel in fits-file and ignore brighter artefacts

I have 4000 fits-files images from SPITZER, each containing the same star over a time period. Each image is a photmetry cube of 32 pixel * 32 pixel * 64 consequent time frames. I need to look through ...
5
votes
1answer
121 views

Generating random galaxy catalogs for correlation functions

The galaxy correlation function, when computed directly from a galaxy catalog, relies on computing a randomly generated counterpart catalog. When dealing with a simulated galaxy mock-catalog, where ...
1
vote
0answers
68 views

Error bar in Python [closed]

I have two column data as magnitude and period of several stars. I have plotted magnitude vs. period, but I need to add a column as error bar for Y values. How can I write the code to put the error ...
4
votes
1answer
179 views

Tests for code that computes two-point correlation function of galaxies

I'm currently writing a code to compute the two-point correlation function of a set of galaxies. As I work with a loooot of galaxies, it was suggested to me not to do it in real space, but to compute ...
2
votes
1answer
36 views

Obtain IR diffuse data from WISE

I need some help obtaining IR background diffuse data from the WISE observation. There is already some work done in this regard; see: http://wise.skymaps.info/ . These are .fits files. How do I find ...
3
votes
0answers
123 views

Generate probability skymap

I am trying to generate skymaps for a set of Fermi GBM triggers, containing the probability that a trigger originated in a given part of the sky. For each trigger, I have access to the RA, dec, error ...
1
vote
0answers
55 views

Unsure how to obtain galactic roll?

I am having some issues with understanding what my adviser means by "galactic roll," but I have not been able to find anything online regarding this. My project involves generating an array of az/el ...
2
votes
2answers
187 views

Converting FITS (NuSTAR) coordinates to WCS

I'm trying to convert some pixel coordinates I have into WCS coordinates, ideally into a WCS region for use in some further analysis. So far I've been able to load and parse a NuSTAR FITS file, do ...
3
votes
2answers
297 views

Eclipses with SkyField

I'm trying to compute solar eclipses for a long period of time, see Back-predicting solar eclipses Initially, I wanted at several points on Earth whether an eclipse was visible at some point in time. ...
1
vote
2answers
79 views

Problems with FITS headers

I'm working with some NEOWISE images that seem to have incomplete header tags. I've been advised by the SAO (because I'm using DS9 to view them) that I have "a partial PC matrix defined, yet it does ...
3
votes
1answer
211 views

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

I see this kind of projection of the celestial sphere into 2D frequently, usually with an image of the milky way galaxy or cosmic microwave background. This particular image shows the path of visible ...
2
votes
3answers
894 views

Generate an uniform distribution on the sky

How to generate an uniform distribution of stars on the sky ? What I want is make a simulation of random points following uniform distribution on a part of the sky (making the assuption that we have ...
1
vote
1answer
50 views

How are the days relating to right ascension around a polar star chart decided?

If you look at this link they have days realting to right acension. How did they calculate nov 20th == 0h, dec 6 == 1h? I was trying to calculate this in astropy, but I end up with nov 20th, 8pm == ...
2
votes
1answer
485 views

How do I create a galaxy stellar mass function?

Suppose that I have an array of stellar masses of tens of thousands of galaxies, and that I also already know what the total "survey volume" is (in Mpc^3) within which all of those galaxies are ...
4
votes
3answers
729 views

Python with image in fits format

I'm trying to write a Python program that will do the following: take an image in fits format and a reg file with a list of regions in the sky, and determine which regions in the list are inside the ...
2
votes
1answer
430 views

Orbital elements of solar system using Pyephem

I'm using the astrometric python module Pyephem, and I would like to get the orbital (keplerian) elements for the solar system planets. The only values I found is the heliocentric latitude, ...
0
votes
0answers
178 views

Best format for analyzing and comparing coordinates across multiple tables

First coding project so if I am asking something wrong or asking too much please let me know. ANY help or advice would be greatly appreciated, including how to better word this question if necessary. ...
2
votes
1answer
125 views

Using SkyChoord to read in multiple coordinates.

so I recently wrote a basic code to analyze the distance between two points which are stored in two separate excel files. Now that I have that code working its time to apply the legitimate use and use ...
1
vote
1answer
105 views

Are 3D coordinate data from Sloan DSS-III available & easily accessible to non-pros?

Of course the newly announced SDSS-III data and maps from the Sloan Digital Sky Survey with 1.2 million objects, along with all previous data sets are openly available, and I'm sure there are many ...
3
votes
1answer
2k views

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

Suppose I have a template stellar population spectrum (say, from Bruzual & Charlot 2003) which runs from like 1000 Angstroms to 160,000 Angstroms and which has x-axis wavelength units of Angstroms ...
1
vote
0answers
269 views

Plot an AltAz grid over a square grid of RADec points

first post here. As I'm new, StackExchange won't let create or use the wcsaxes tag. wcsaxes looks like the most appropriate tool for the job, but astropy is closely related. I think the title says ...
2
votes
0answers
325 views

Coordinates reduction python

How can I calculate position (alt, az) of star for observer at some station (longitude, latitude) on specific date and time? I need full coordinates reduction with all elements included in calculation ...
1
vote
1answer
255 views

Create a signal to noise map from heatmap

Recently, I obtained my heatmap from a sky survey. But now, I'm trying to get a signal to noise map from my heatmap. My heatmap looks like : My colour bar indicates the number of stars per pixel (I ...
2
votes
1answer
257 views

Need help with the math in Python program to flag Jovian radio emissions

A few days ago I decided to take on the little project of converting a Qbasic program into Python (as a side project to my Radio Jove project), and I've managed to get it to run, but the math is ...
1
vote
1answer
156 views

How to get error out of astropy constants

How do I get the error value out of an astropy.constants quantity? ...
2
votes
1answer
116 views

Difference in redshift between 2 interacting galaxies

I have a galaxy 'A', say at redshift 1. Let's suppose this galaxy has no peculiar velocity. What would be the redshift of another galaxy 'B', that has a radial velocity of 500 km/s, relative to A? ...