Questions tagged [astropy]

Questions related to Astropy, a community Python package for Astronomy

Filter by
Sorted by
Tagged with
0 votes
0 answers
34 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
51 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
54 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
32 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
52 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
80 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
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 ...
4 votes
0 answers
217 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
87 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
122 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
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' ...
7 votes
1 answer
807 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
264 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 ...
0 votes
0 answers
70 views

Effective radius from astropy sersic profile

I would like to integrate the 2d Sérsic profile of the astropy library to check the half light radius, but I have some issues. First, I create a simple profile: ...
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, ...
1 vote
1 answer
70 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
133 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 ...
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 ...
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 ...
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 ...
3 votes
0 answers
73 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
336 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
80 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
208 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
55 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
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 ...
1 vote
1 answer
152 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
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 ...
3 votes
1 answer
262 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
49 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
277 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
90 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
127 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
757 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
138 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 ...
1 vote
1 answer
439 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
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 ...
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. ...
1 vote
1 answer
127 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
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, ...
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, ...
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 ...
0 votes
1 answer
752 views

How to Interpret Lomb Scargle periodogram

lomb scargle periodogram: ...
1 vote
1 answer
113 views

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

I have two images of NGC 6946: ...
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): ...
0 votes
0 answers
75 views

Setting specific CENTER coordinates coordinate in SWARP

The SWARP Documentation specifies that we first set the CENTER_TYPE to MANUAL and then in the CENTER parameter we specify either one of the equatorial coordinates (RA, Dec). This is specified in the ...
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 ...
3 votes
1 answer
949 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 ...
1 vote
2 answers
824 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: ...