Skip to main content

Questions tagged [astropy]

Questions related to Astropy, a community Python package for Astronomy

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

how to set a image normalization similar to the default scale for SAOImageDS9 zscale

I want to draw this picture using mmatplotlib, and I want to set the normalization to be Exactly Same as zscale (as in the below image) for example, I can use simple_norm or general ImageNormalize but ...
1 vote
0 answers
40 views

Tiling the sky with astropy-healpix

I have a bunch of files containing sources with galactic l and b values. What I want is to redistribute the sources such that each new file contain sources that fall within 15 degrees of a central l,b ...
1 vote
1 answer
53 views

Convert GPS Week and GPS Time of Week to J2000?

I'm new to this, and am trying to convert GPS Time to J2000 time using python and Astropy. Here's what I've come up with: ...
2 votes
0 answers
57 views

Gaia coordinates in J2000 as done by the CDS

So I'm interested in knowing how the CDS calculates the J2000 equatorial coordinates from the Gaia DR3 equatorial coordinates (that are given in epoch 2016.0). For example, for the star HD 308819 = ...
5 votes
1 answer
193 views

Position of Hamal (alpha Arietis) between 1582 and 1588

Between 1582 and 1588, Tycho Brahe observed $\alpha$ Arietis from Uraniborg (55°54′28″N 12°41′48″E) on at least 27 separate occasions and made a record of the right ascension of the star (see Opera ...
2 votes
2 answers
205 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 ...
6 votes
1 answer
189 views

How to Determine Absolute Magnitude of a Galaxy using HST FITS Image

I'm attempting my first serious research project but due to... various circumstances, I am going to mostly be solving problems like this on my own with minimal outside help. As for the actual problem, ...
5 votes
1 answer
253 views

Visualizing difference in astropy's cylindrical representation

I'm having trouble understanding why these two approaches have different results: ...
1 vote
0 answers
34 views

How to get from SED to mag [AB]?

NGC 5406 has the following mag in SIMBAD g (AB) 13.104, r (AB) 12.215, i (AB) 11.803 I wrote a little python snippet to fetch the spectrum of NGC 5406 and compute the mags, but I've hit a wall. I'm ...
0 votes
0 answers
52 views

Crop a FITS file in shape of another

I have a FITS file, let us say file A. I have another FITS file, file B. File B has a smaller footprint than file A. I want to crop file A in shape of file B. How do I go about doing that?
1 vote
1 answer
59 views

Transforming radio sources in a T-RECS catalogue from one field to another

I have sources that I extracted from The Tiered Radio Extragalactic Continuum Simulation (T-RECS) catalogue for a deep field. I use these sources to generate a sky model at different fields within a ...
2 votes
0 answers
82 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 ...
0 votes
0 answers
38 views

How to compute object counts in narrowband imaging?

How do we go about computing the object counts from an emission nebula in H alpha? Do need to search the object in Vizier, get the reported FLux for the object in a catalog?.. Do I use synphot-astropy ...
0 votes
0 answers
108 views

Calculating the Flux density through different photometric filters

For a project I wrote the following python script for calculating the flux density. My question is: If the user enters for example magV = 22 and the user selects the B filter instead of the V filter ...
0 votes
0 answers
174 views

Compute rotation angle of fits image

I have a fits image and the header has the keys PC1_1, PC1_2, PC2_1, PC2_2. I want to compute the angle by which my image is rotated so that North will be up. I use the formula below: angle = np....
6 votes
2 answers
5k 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 ...
4 votes
0 answers
393 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. ...
1 vote
0 answers
159 views

Photometry in SExtractor vs Python

I wanted to find stars in the dwarf Spheroidal (dSph) galaxy. I performed photometry using SExtractor and in Python using DaoStarFinder and other astropy packages. However, while extracting the ...
2 votes
0 answers
229 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 ...
3 votes
1 answer
110 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' ...
8 votes
1 answer
866 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 ...
1 vote
0 answers
467 views

Convert RA from hours to h:m:s

I'm working on a small mount controller software in Python. From the ASCOM standard, right ascension is reported in unit of hours. How do I convert from hours to hours:min:sec? Here is my attempt in ...
2 votes
0 answers
77 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, ...
1 vote
1 answer
95 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: ...
1 vote
1 answer
97 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 ...
2 votes
0 answers
67 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 ...
5 votes
1 answer
499 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 ...
4 votes
0 answers
82 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 ...
3 votes
1 answer
374 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, ...
1 vote
0 answers
114 views

easy curve modeling package for transits that fits the data not just the parameters?

Does anyone have any recommendations for easy-to-use exoplanet transit light curve model fitting packages like batman, but that fits the data, not just the model parameters? Thank you so much. I need ...
2 votes
1 answer
274 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 ...
1 vote
0 answers
60 views

How to plot matplotlib plots as tables in python(hdf5 tables)

I have extracted the data from a fits file and plotted a spectra.i need to do the same for multiple fits files .how can I store the resultant spectra's as a hdf5 table or fits table? And which ...
2 votes
1 answer
140 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 ...
1 vote
1 answer
170 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 ...
1 vote
1 answer
119 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 ...
3 votes
1 answer
339 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: ...
1 vote
0 answers
60 views

Convert Earth-centered coordinates to rotating libration point (RLP) coordinates?

I'd like to plot the path of an object near L2 (like the Webb space telescope) in a rotating libration point coordinate system. That makes it is easy to distinguish halo orbits from more general ...
2 votes
1 answer
296 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 ...
1 vote
0 answers
99 views

Find Periodicity in Lightcurve Using Lombscargle Periodogram(Astropy)

How to find the Nyquist factor for unevenly sampled data like here.https://github.com/jakevdp/PracticalLombScargle/blob/master/figures/LINEAR_Example.ipynb ? I have time binned for 5 mins. I mean for ...
1 vote
1 answer
148 views

How to handle empty tables returned by astroquery Nist.query() in Python?

I'm writing a code to extract wavelengths of certain species of atoms/ions in a given wavelength range using the Nist.query() command of the Python package ...
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 ...
5 votes
1 answer
790 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 ...
1 vote
1 answer
167 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 ...
2 votes
1 answer
539 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 ...
3 votes
0 answers
403 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 ...
1 vote
1 answer
204 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. ...
1 vote
1 answer
137 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 ...
4 votes
1 answer
149 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, ...
1 vote
2 answers
170 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, ...
3 votes
2 answers
251 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 ...