Questions tagged [astropy]
Questions related to Astropy, a community Python package for Astronomy
74
questions
3
votes
0
answers
49
views
Co-adding IFU data cubes
I was able to get my hands on some NIRspec IFU data cubes from JWST, and I was trying to combine two adjacent FOVs for getting the complete picture of my system. I used CASA prior to this to remove ...
0
votes
0
answers
27
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
45
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 ...
2
votes
1
answer
89
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
1
answer
165
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
200
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 ...
6
votes
1
answer
238
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
258
views
Visualizing difference in astropy's cylindrical representation
I'm having trouble understanding why these two approaches have different results:
...
1
vote
0
answers
40
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
76
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?
2
votes
0
answers
90
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
115
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 ...
1
vote
1
answer
61
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 ...
4
votes
0
answers
472
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
195
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
270
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
120
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
893
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
544
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
104
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
102
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
102
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
2
answers
228
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 ...
2
votes
0
answers
72
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
504
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
95
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 ...
0
votes
0
answers
130
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?
I need it to be really ...
2
votes
1
answer
299
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
62
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 ...
1
vote
1
answer
178
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 ...
2
votes
1
answer
148
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
121
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
361
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
62
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 ...
1
vote
0
answers
103
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
159
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
3k
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
800
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
173
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
568
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 ...
4
votes
1
answer
154
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
179
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,
...
1
vote
1
answer
918
views
How to Interpret Lomb Scargle periodogram
lomb scargle periodogram:
...
0
votes
0
answers
83
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
178
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 ...
4
votes
1
answer
3k
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):
...
3
votes
1
answer
1k
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 ...
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 ...
1
vote
1
answer
210
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
138
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 ...