Questions tagged [python]

Questions about using the Python programming language to solve astronomical problems. General questions about Python are off-topic but might be asked on Stack Overflow.

Filter by
Sorted by
Tagged with
1
vote
1answer
189 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
0answers
50 views

How to remove redshift from galaxy spectra in Python?

Hello I extracted a spectrum from the central region of the 2D spectrum of the major axis from NGC 4697 (I just took a central row in the 2D data set, see this question for more information: How to ...
0
votes
0answers
39 views

Are there python packages to calculate mean line of sight velocity, linewidth and other distributions from galaxy simulation snapshots?

Does anyone know of any packages/functions in packages that can give mean line of sight velocities (losv) from a simulation snapshot (from the spatial and velocity coordinates or directly from the ...
2
votes
2answers
31 views

During aperture photometry when simulating an undetected star, why must an upper limit and standard deviation need to be calculated?

I am trying to learn aperture photometry using python I noticed the following logic in the image below, where an upper limit was determined by simulating an undetected star and the standard deviation ...
2
votes
1answer
50 views

Calculate the habitable zone of a star based on NASA Exoplanet Archive

I am completely new to this! I am trying to find if an exoplanet in the Exoplanet Archive is the habitable zone of its host star. My intention is to create a new boolean column in a Pandas Dataframe ...
-11
votes
2answers
158 views

Is a Hertz ratio to 65M ☉ proof that Betelgeuse had a core collapse in 1491 from a gravitational wave on January 14, 2020? [closed]

By analysis of gravity waves GW150914 to S200114f when compared to a ratio from the Black Hole merger of 65 M ☉ at 260 Hz with Betelgeuse frequency of 64.698303 Hz the gravitational release on January ...
4
votes
1answer
88 views

How to extract galaxy spectra for different radii in Python for spectra taken by long slit spectrograph?

I am trying to extract the kinematics from the elliptical galaxy NGC 4697 using the Fourier Correlation Quotient (FCQ) algorithm described by Bender (http://adsabs.harvard.edu/full/1990A%26A...229.....
2
votes
0answers
30 views

healpix: creating isometric tiles for flat map of survey

I am currently tasked with creating a visual of a recently completed survey which is in HEALPix1 format. I am also required to use the DSS and Planck skymaps also in HEALPix, and would like to flatten ...
2
votes
0answers
15 views

reference frames-healpix: projection parameters for smooth continuous tiles on a sky map

I am working on a newly completed survey which uses healpix fits files on 1/8th of the sky. I would like to set a flat skymap which covers the entire sky but it seems this will create artifacts and ...
0
votes
0answers
27 views

What is the formula to input date, time and longitude. Where I can get latitude of the civil twilight back?

I am making a watch app, where I need to know where there is currently sun, and where it's not. I need to have some sort of formula/function to insert: date, time and longitude, and get back the ...
1
vote
1answer
53 views

Derive LOSVD from galaxy spectrum, using fourier method

I am trying to implement a programm, that derives the kinematics (specifically the kinematic parameters: mean rotation velocity, velocity, dispersion, hermite coefficients h3 and h4) from an ...
0
votes
0answers
21 views

How to create synthetic galaxy spectrum by broadening stellar spectra with a gaussian

I am trying to create a synthetic galaxy spectrum, by convolving a gaussian-velocity-distribution f(v) with my stellar spectra S. I have already logarithmically rebinned the spectrum and removed the ...
1
vote
0answers
22 views

Filtering local region in SIMBAD

I am completely new to astrophysics and currently writing a paper on Cepheid variables for high school physics. I would like to filter out all Cepheid variables in the local system which I would ...
-2
votes
2answers
113 views

Calculate exact date and time from position of the sun - 88° degrees

I am currently working on an astrology project and need to figure out the exact date and time based on the sun's position of birth - 88° degree (approx. 89 days) before the moment of birth. I am using ...
0
votes
0answers
50 views

impossible to download some packages on python [closed]

i am new to python i will like to install some packages like einsteinpy, astropy, and several others but the error message is always the same, i think i have a problem with the pip version but i dont ...
2
votes
0answers
70 views

Logarithmic rebinning and continuum removal of stellar spectra

I am trying to learn how to derive the line of sight velocity distributions from galaxy spectrum to extract kinematical parameters like rotational velocity and velocity dispersion. Therefore I need to ...
1
vote
1answer
122 views

working with stellar spectra in fits format in python

Hey I am new to working with astronomical data in Python. I wanted to start working with stellar spectra and I am having trouble with the data. To get a first look I just wanted to plot a spectra (...
4
votes
1answer
63 views

Accessing SDSS server SQL server via python

Is there a way to directly access any of the Sloan Digital Sky Survey servers via SQL via Python? Currently I have been able to run SQL queries from the website they provide (for example https://...
2
votes
2answers
220 views

Open source code for the maths behind a heliostat?

Theoretically, using a Raspberry Pi, (at least) one mirror, and two motors, one should be able to build a heliostat, i.e. a device which redirects sunlight to a fixed spot, like a scrub in the shadow ...
3
votes
1answer
59 views

Open source library to calculate image from signals of a distributed set of radio dishes?

The National Radio Astronomy Observatory's Q&A "How To Make Images With a Radio Telescope" says The most straightforward way to make a radio image with your satellite antenna system, ...
21
votes
3answers
5k views

Why won't the Sun set for days at N66.2 which is below the arctic circle?

Correct me if I am wrong, but if we count sunsets by the center of the Sun apparently crossing the horizon then the Sun is supposed to set every day at latitudes under the arctic circle. (Yes if you ...
3
votes
1answer
61 views

Lightkurve nan values after bin light curve

I am using lightkurve 2.0.2 library with Python 3.8.5 and astropy 4.2 for processing exoplanet transits. However when I want to bin light curve to fixed number of points, all values in ...
1
vote
0answers
113 views

Schechter Luminosity Function fitting plot of galaxies

I would like to plot the Schechter Luminosity function of galaxies. Here is my data(I have the Luminosity L[Ha] in erg/s). I would like to plot like this figure from this paper. In this paper, they ...
1
vote
2answers
98 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
1answer
71 views

RA expressed in degrees

Using the Python package Skyfield I thought that I could get the RA expressed in degrees simply by doing ra.degrees, but I get the following message this angle is usually expressed in hours, not ...
0
votes
1answer
154 views

How to Interpret Lomb Scargle periodogram

lomb scargle periodogram: ...
2
votes
0answers
51 views

Using the 'exoplanet' module to fit a radial velocity curve for a binary star system

As part of a project, I am trying to fit a radial velocity curve using the tutorial for the binary star system (EBLM J0608-59) My code is quite similar to the tutorial, but as it is only one body ...
3
votes
0answers
128 views

Issues in dimensions and slicing while plotting contours over a FITS Image in Astronomical Plotting Library in python (APLpy)

I have been trying to plot the contours of a FITS image over itself in APLpy. The image was created in AIPS, and has dimensions (1024,1024,1,1), viz., right ascension (RA--SIN), declination (DEC--SIN),...
2
votes
0answers
49 views

Should I fit a function to this lightcurve?

I am creating a light curve for the duration of a binary system in order to find out the duration of the eclipse. I am unsure as to whether to fit a function to the data (is it appropriate) as by ...
0
votes
0answers
22 views

Completeness detection analysis of magnitudes of galaxies

I have a magnitude from the observation. I would like to find the detection completeness of the magnitude. I want to plot the figure like this in python How to plot the Detection completeness and ...
2
votes
1answer
202 views

"LinAlgError: SVD did not converge in Linear Least Squares" with eleanor.py

I'm doing some tests with eleanor module (i'm a novice). I'm using the example code written on eleanor.py website ...
3
votes
1answer
494 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): ...
1
vote
0answers
49 views

Using lightkurve to identify a planet

I have gotten LightKurve to work and plot a lightcurve to allow for the identification of possible transits. However is there a way I can get it to run and tell me if there is a possible transit in ...
2
votes
2answers
120 views

Technique for folding sparse event data in order to detect an underlying periodicity?

@JamesK's answer to When will the next transit of Earth be visible from Mars? Was the last one really on May 11, 1984? lists dates of 18 transits which I've converted to days since 1500-Jan-01 as <...
6
votes
1answer
352 views

Cannot identify mistake in calculating orbital eccentricity vector; magnitude equals one instead of zero (with python code)

I have a gravitational nbody simulation, for which I would like to determine various orbital parameters. For each body, I have 3-D vectors (x,y,z -space) for position, velocity, and acceleration. I am ...
1
vote
1answer
307 views

How can I calculate the apparent position of stars as seen from a location on Earth at a specific time?

I'd like to be able to generate star maps using Python, similar to what is done at YourSky. I believe this is possible with Astropy and the details provided in this question. I can import stars from ...
2
votes
1answer
91 views

How to recognize exoplanet transit

I am using Python package lightkurve for exoplanets searching by the transit method. When I download light curve of some star and apply periodogram, I find frequency and power of periodic components ...
2
votes
1answer
151 views

How can I calculate the right ascension of an observer on Earth's surface in the TEME frame with python.skyfield?

I would like to calculate the right ascension of a point on earth as specified above with the Skyfield Python library, and I can not figure out how to do this. I know that calculating the geocentric ...
18
votes
2answers
3k views

Why does the Fourier transform of this CMB image have a hole in it?

The BBC's Desert telescope takes aim at ageing our Universe contains the image below of the Cosmic Microwave Background from the Atacama Cosmology Telescope or ACT. It looks like this is plotted with ...
1
vote
1answer
44 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
1answer
58 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 ...
1
vote
2answers
273 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: ...
1
vote
1answer
365 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 ...
7
votes
2answers
356 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.)...
4
votes
1answer
123 views

How can the IAU 2000A vs IAU 2000B nutation comparison be reproduced?

I am attempting to plot how the IAU 2000A nutation model degrades as its terms are omitted. As a spot-check, I decided to compare it to IAU 2000B, which includes only the 77 most important lunisolar ...
5
votes
2answers
400 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. ...
1
vote
0answers
137 views

Wavelength Calibration in Python - Line Identification algorithm

I was asked to develop a data reduction pipeline for a telescope and am facing a problem. I have the standard lamp spectra and need to identify the emission lines in order to find a wavelength ...
3
votes
0answers
107 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 ...
2
votes
1answer
59 views

Are there any good DSO API's for python out there?

I was wondering if there was good DSO database API out there for python so I could fetch things like a distance away from Earth or radius etc. I tried looking however couldn't find the exact thing I ...
0
votes
2answers
4k views

How to create 3D animation of particles position vs time in python?

I am trying to make a 3-D animation of stars' position vs time. I have the information of the stars' x, y and z co-ordinates over time. I was looking at the example of Matplotlib and did understood ...