Questions tagged [astropy]

Questions related to Astropy, a community Python package for Astronomy

Filter by
Sorted by
Tagged with
0 votes
0 answers
35 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?
SlightDecoy's user avatar
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
0 votes
0 answers
33 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 ...
Adrian's user avatar
  • 106
0 votes
0 answers
55 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 ...
Adrian's user avatar
  • 106
0 votes
0 answers
86 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....
Sketos's user avatar
  • 31
1 vote
1 answer
53 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 ...
Supremum'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
1 vote
0 answers
93 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 ...
Abhinna Sundar's user avatar
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
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
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
1 vote
0 answers
270 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 ...
Adrian's user avatar
  • 106
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: ...
Antonio's user avatar
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
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
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
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
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
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
1 vote
0 answers
84 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 ...
strange_octopi'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
1 vote
0 answers
56 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 ...
Walker's user avatar
  • 11
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
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
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
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
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 ...
nealmcb's user avatar
  • 412
1 vote
0 answers
92 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 ...
unicorn's user avatar
  • 21
1 vote
1 answer
129 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 ...
ShaunakP's user avatar
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
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
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
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
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
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
0 votes
1 answer
757 views

How to Interpret Lomb Scargle periodogram

lomb scargle periodogram: ...
rilesdg3's user avatar
0 votes
0 answers
76 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 ...
Hiba Jamal'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
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
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
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
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
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
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
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
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
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
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