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
3
votes
1answer
111 views

How to interpret skewness and kurtosis plots of galaxy snapshots?

What I did:- I am analysing some simulation snapshots of the Milky Way and it is modelled as a dark matter halo – bulge – disc system. I produced some skewness (using ...
3
votes
1answer
51 views

Skyfield missing some rise and set dates

To compute the Andromeda Galaxy Risings and Settings I essentially use this code (in a more colplex code, but this serves the purpose): ...
1
vote
1answer
40 views

How to compute rising / setting times for stars and deep sky objects with Skyfield?

I'm trying to compute rising and settings times for various objects with the Skyfield library. While the task is quite easy and well documented for planets (using the ...
1
vote
0answers
55 views

How to quickly loop through many small fits files for data analysis?

I need to extract information from a few columns in ~20k different fits files with python. Each file is relatively small, ~0.2MB. I have been doing this so far with a loop and ...
1
vote
1answer
28 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 ...
1
vote
1answer
68 views

How to access the raw time-series dataset of GOES X-Ray Flux?

I would like to access the time-series dataset of X-Ray Flux obtained by GOES. I expect that the flux units to be Watts / square-meter; this is because of the figure below (obtained from this Nature ...
0
votes
0answers
20 views

Why can I not get pymultinest running and what's the best way to generate CMD with coding?

I recently downloaded the isochrones environment for Python, and I installed pymultinest for sure, but when I import it in Jupyter Notebook it always says 'ERROR:root:Internal Python error in the ...
5
votes
1answer
618 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 ...
2
votes
0answers
51 views

How to calculate orbital velocity of binary star?

I am trying to simulate the Alpha Centauri AB System. I built the simulation, it works flawlessly when trying to simulate our solar system, and I am now trying to simulate the AB System. I found all ...
2
votes
1answer
58 views

Query Gaia by star name

I am attempting to query Gaia programmatically in python to get certain properties for specific stars. I can write a query which obtains some properties, but only for all stars, not a set of stars or ...
1
vote
0answers
19 views

How to calculate S/N in galaxy absorption spectra?

I want to calculate the S/N of an galaxy absorption spectrum. I therefore chose a part of the spectrum which contains very little to none absorption features and should be only made up of noise and ...
3
votes
0answers
21 views

How to find x-values of fourier-transformed correlation functions in velocity space?

I am trying to extract the kinematic parameters (rotation velocity, velocity dispersion, ...) of an elliptical galaxy by extracting the kinematical broadening function using the FCQ-Algortihm first ...
1
vote
1answer
208 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
53 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
41 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
44 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
57 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
180 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
103 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
31 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
18 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
30 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
58 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
22 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
23 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
129 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 ...
2
votes
0answers
96 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
294 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
87 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
306 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
62 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
70 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
177 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
100 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
78 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
187 views

How to Interpret Lomb Scargle periodogram

lomb scargle periodogram: ...
2
votes
0answers
62 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
170 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
51 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
24 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
299 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
599 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
51 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
396 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
401 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
104 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
161 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 ...