Questions tagged [astropy]

Questions related to Astropy, a community Python package for Astronomy

Filter by
Sorted by
Tagged with
8 votes
3 answers
12k views

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

I want to make a projection of millisecond pulsars on the galactic plane, much like this one from Sala et al. 2004: I have tried several methods, and have not gotten anywhere. This is my current ...
Maria's user avatar
  • 185
7 votes
2 answers
461 views

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

The question How can I make the fringing pattern visible in my flat (twilight) images for filter i? includes: I have a bunch of twilight flats that have been preprocessed (dark, bias, overscan etc.)...
uhoh's user avatar
  • 31.3k
7 votes
1 answer
808 views

How do I calculate the moment of the solstice?

I'm trying to calculate the moment of the upcoming summer solstice using astropy, and I can't seem to get an answer that matches the accepted values that I see online. I thought that the moment of the ...
Roy Smart's user avatar
  • 1,084
6 votes
2 answers
4k views

How can I calculate the uncertainties in magnitude like the CDS does?

When you check an entry of the Gaia DR2 stellar catalogue in Vizier, for example this one, you can see that there is a value for the G magnitude (in our case 18.0733 mag) and a value for the ...
Swike's user avatar
  • 3,856
6 votes
2 answers
1k views

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

I am using astropy and I would like to calculate orbital period of an exoplanet by its star's light curve. I follow tutorial in astropy docs and I use data from Kepler in Nasa Exoplanet Archive. ...
Michal's user avatar
  • 313
5 votes
1 answer
759 views

Astropy units issue

hope you're all doing well. I'm not very familiarized with AstroPy and I'm having a problem computing the conversion between angular momentum units. If I define the ...
nuwe's user avatar
  • 605
5 votes
1 answer
483 views

Right ascension - Gaia vs Simbad

What is the difference between Right ascension in Simbad and Gaia Archive, please? How to convert the values? For instance, HD 37468: 05h 38m 42.0s vs 84.68652242854718 deg. Should not be these values ...
Elena Greg's user avatar
4 votes
1 answer
132 views

Plotting The Kepler Field Full View

I have downloaded the calibrated ffi(full field image) for the Kepler field, aside from the primary HDU which contains the metadata, they contain 84 channels, each in the form of an image HDU, ...
user38489's user avatar
4 votes
0 answers
226 views

Calculation of average FWHM by PSF fitting of all the detected stars in the fits image

I need to calculate the FWHM of all the stars detected via the DaoStarFinder package/any other package by performing PSF fitting in Python. Here is the code for my detection. ...
Abhinna Sundar's user avatar
3 votes
2 answers
241 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 ...
uhoh's user avatar
  • 31.3k
3 votes
3 answers
2k views

Calculating the position of stars at a given point in time

Is there any particular methods that help us calculate the position of a star at a certain point in time? This question is what I am trying to achieve, but for me, I do not want to use the data ...
Prashanth Kumar B's user avatar
3 votes
1 answer
73 views

Astropy time: is it possible to use negative dates?

The goal is to find precessed coordinates for BCE dates. from astropy.time import Time equinox = Time('-0500-01-01') is just not working, though '0500-01-01' ...
J Kelly's user avatar
  • 133
3 votes
1 answer
269 views

Can you get motion data using astropy.coordinates.get_body()?

I am trying to use get_body() to get position and motion data for solar system objects. I’ve tried the following: ...
user avatar
3 votes
1 answer
2k views

How to plot celestial equator in galactic coordinates? Why does my plot appear "backwards"? [duplicate]

I'm trying to plot celestial equator in galactic coordinates. Here is my code (based on this answer): ...
Michael Belvedersky's user avatar
3 votes
1 answer
958 views

How do I plot orbit planets and satellites?

I need to find the way to plot orbit planets and satellites in a coherent way. Let's say I want to generate a chart of the Moon's orbit around the Earth, or the jovian satellites around Jupiter. The ...
Unix's user avatar
  • 155
3 votes
1 answer
345 views

Covariance matrix not calculated when fitting gaussians?

So I am using Astropy's basic models.Gaussian1D model and a fitter = fitting.LevMarLSQfitter() to fit 3 Gaussian pulses with some added random noise. The fit is good, but when I type fitter.fit_info, ...
MinYoung Kim's user avatar
3 votes
3 answers
912 views

Differences between alt/az in Stellarium and Astropy

I've just started to learn Astropy. It's a nifty tool. Using some tutorials, I wrote and then made modifications to a little script that finds the Alt/Az of an object at a certain place and time. I ...
Alphecca's user avatar
  • 696
3 votes
0 answers
74 views

Keyerror: 0 while using astropy SkyCoord

I am facing a problem while using SkyCoord from astropy library. The scenario is as below, I have read the data from a fits file into a pandas dataframe. I have applied several quality cuts to the ...
CTZenScientist's user avatar
3 votes
0 answers
370 views

How do I plot field of view of an earth-based observatory in Galactic Coordinates?

I would like to plot in Galactic Coordinate the sky field-of-view of an earth-based observatory (e.g. MAGIC). Something like this from Liu et 2016. I already know how plot source positions on a 2D ...
Tutan's user avatar
  • 73
3 votes
0 answers
35 views

Telluric Interference data

I am looking to create a function to correct for telluric interference and to do so I need to find data on Ozone interference. It has been suggested to me that Astropy may have a function that does a ...
lost_in_space's user avatar
2 votes
1 answer
278 views

L2 point ephemeris (celestial mechanics)

I'm a master student and I am trying to get the L2 ephemeris for some calculations in my master's project. It was kinda hard to find a file with the L2 ephemeris, but once I found it, I tried the next ...
Luis García Iglesias's user avatar
2 votes
1 answer
166 views

SDSS - getting separate u, g, r, i, z frames from SWARP tool and astropy

I am following this paper to extract the u,g,r,i,z image frames from the SDSS image fits files. I have the fits files downloaded (using the bulk data download option from SDSS) and tried to run the ...
Hiba Jamal's user avatar
2 votes
2 answers
2k 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 ...
curious_cosmo's user avatar
2 votes
1 answer
183 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? ...
cbienpourtoi's user avatar
2 votes
1 answer
212 views

How to use Astropy to edit a keyword (not value) in batches of FITS file headers to be used in AstroimageJ (AIJ)? (summer undergrad research project)

I would be so grateful if someone could help me. I am stuck for over a week now trying to find some way to use Astropy to write some small code to edit one keyword in batches of FITS file headers so ...
strange_octopi's user avatar
2 votes
1 answer
123 views

Pulling spectral data from Hubble Telescope automatically

Libraries currently I am using: Astropy, Numpy, Matplotlib I am looking to create a python script that pulls spectral data (wavelength vs flux chart) from the Hubble Telescope, specifically for Be ...
Smit Patel's user avatar
2 votes
1 answer
226 views

How to query a region on the sky when given only ecliptic coordinates?

I am new at using the Python packages astropy/astroquery and what I want to achieve is to use it to find stars that lay on the TESS continuous view zone (CVZ). I ...
Stefano's user avatar
  • 189
2 votes
1 answer
1k views

Making sense of the lomb-scargle periodogram

I am trying to use the periodogram to tell when a signal is periodic or not by following the tutorial for the astropy Lomb-scargle periodogram here. http://docs.astropy.org/en/stable/stats/...
wrahman's user avatar
  • 23
2 votes
0 answers
56 views

How can I compute reasonable errors on my Gaussian fits to the observed strong optical lines of interest?

I'm fitting Gaussians to optical lines spanning from H-beta to Sulfur using Astropy's Gaussian (https://docs.astropy.org/en/latest/api/astropy.modeling.functional_models.Gaussian1D.html) model with a ...
Astroturf's user avatar
  • 1,111
2 votes
0 answers
126 views

Why I get slightly (but not acceptable) difference for my Local Sidereal time?

I am trying to convert my UTC into LST by using formula for my astrophysics simulation. The problem is that I get something like difference of 1~2 min when I use known formula and python library ...
Kyle's user avatar
  • 127
2 votes
0 answers
59 views

Computing the sky coordinates using astropy

I need your help with an error I have been receiving while trying to obtain the sky coordinates using astropy module in python. The code looks like the following, ...
CTZenScientist's user avatar
2 votes
0 answers
45 views

How to use astropy to join data tables based on sky coordinates?

I have 2 astronomical tables, from a fits file and a csv file, that look something like this ...
NeStack's user avatar
  • 313
2 votes
0 answers
356 views

How to "slice" a fits table in astropy?

I have imported my fits table, hdul0, into python. I'm using astropy.table. I opened it with hdul0 = fits.open('filename'). hdul0data = Table(hdul0[1].data) I ...
Joey's user avatar
  • 21
1 vote
1 answer
447 views

How to get error out of astropy constants

How do I get the error value out of an astropy.constants quantity? ...
equant's user avatar
  • 113
1 vote
1 answer
109 views

How is CASA different from SAO DS9?

I was told that CASA is used extensively in Radio Astronomy. However, softwares like SAO DS9 and also python (Astropy) are also used for radio astronomy data analysis. So, what makes CASA different as ...
Dhruv Nayak's user avatar
1 vote
1 answer
440 views

What objects can I search for using astropy.coordinates?

The spectacular Python package astropy allows the user to search for a celestial object using astropy.coordinates, querying ...
Jim421616's user avatar
  • 2,404
1 vote
2 answers
155 views

How should I interpret this result obtained using lomb scargle?

I used lomb scargle for periodic analysis. The time interval used is constant at 500 seconds. #My data (x=time, y=intensity values) is : x= ( 00:28, 00:37, 00:45, 00:53, 01:02, 01:10, 01:19, 01:27, ...
Yongho Lee's user avatar
1 vote
2 answers
826 views

Convert dates to julian day number in astropy?

I'm using astropy and I need to convert dates like this: 2012.06.22_17:56:15_TAI into julian day number. I tried: ...
Vanessa's user avatar
  • 21
1 vote
1 answer
979 views

Converting an RGB image to fits (astropy)

I am trying to save a NumPy RGB array (a 3d array with dimension 512x512x3), to a .fits file using astropy.io. Saving this array to a .png file works fine, but when ...
user3042966's user avatar
1 vote
1 answer
153 views

Determining when the sun shines on different sides of a building using astropy

I recently installed motorized solar blinds on various windows in our house to reduce solar gain during the summer months. I have integrated the blinds with my hubitat home automation system, and am ...
cayblood's user avatar
  • 115
1 vote
2 answers
676 views

Retrieving input effective radius from Sérsic profile

I'm playing around with Sérsic profiles, and would like to retrieve the effective (half-light) radius that I put in by integration of the profile. I'm not managing to, so perhaps someone can help me ...
user1991's user avatar
  • 834
1 vote
1 answer
84 views

Which catalogue has identified objects from Gaia DR3?

I am trying to match objects from a Gaia DR3 dataset having 1 million rows with simbad. I find it difficult to find object type for all the rows as queries using astroquery becomes insanely slow after ...
VADeR's user avatar
  • 41
1 vote
1 answer
135 views

How do I get cross-verification data for Gaia DR3?

I've collected data having 1 million rows of Gaia DR3. I am trying to make a dataset suitable for Machine Learning. I need a target variable which is the stellar object type. My issue is I can't seem ...
VADeR's user avatar
  • 41
1 vote
1 answer
181 views

Specutils Gaussian1D fitter and estimators

I am running the "simple example" from specutils to do some line-fitting. The demo code is here: https://specutils.readthedocs.io/en/stable/fitting.html This runs and does what it says. ...
PeterD's user avatar
  • 31
1 vote
1 answer
1k views

Calculate depth and duration of exoplanet's transit using Python, astropy or lightkurve

I am creating a program for the analysis of exoplanets in Python using Astropy and Lightkurve libraries. I have light curve of specified star and I would like to calculate depth and duration of planet ...
Michal's user avatar
  • 313
1 vote
1 answer
72 views

Having trouble using astroquery's Vizier.query_region?

I'm having some trouble getting a Vizier search using astropy to work. I'm looking for all sources nearby MWC 614 from the Gaia EDR3 database: ...
tgs123's user avatar
  • 65
1 vote
1 answer
139 views

Incorrect best period fit over phase-folded data

I am using the astropy Lomb-Scargle periodogram here, https://docs.astropy.org/en/stable/timeseries/lombscargle.html to get the best period fit using its model() method for simulated data given in ...
Mukul Kumar's user avatar
1 vote
1 answer
129 views

trouble installing drizzlepac

I'm trying to install drizzlepac to follow this tutorial on aligning hst images: https://spacetelescope.github.io/notebooks/notebooks/DrizzlePac/align_to_catalogs/align_to_catalogs.html However, I get ...
tzirtzi's user avatar
  • 13
1 vote
1 answer
114 views

Creating a 2D matrix from 2 FITS images of unequal dimensions for Radio/FIR correlation

I have two images of NGC 6946: ...
user30981's user avatar
  • 199
1 vote
1 answer
792 views

What does the BinTableHDU store?

I'm just getting started with very primitive analysis of FITS data, and I have a 'raw' FITS file which I don't know how to get different wavebands of data from (if this is even possible). ...
Chronum's user avatar
  • 113