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.
188
questions
0
votes
0
answers
26
views
How to calculate.list all DSO's < mag10 visible from my given location/time (Python)
I've got a EVScope and a working knowledge of Python and either the EVScope app doens't give me enough content/variety of objects to observe or deskktop software focusses too heavily on nebula/stars ...
1
vote
0
answers
26
views
CASA: Parsing RA and Dec output of imfit using au.imfitparseCLB
Currently working on a project in CASA where I want to make a position, velocity and intensity table for some images I've been analyzing, and applying imfit to get Gaussian fits. Specifically, these ...
1
vote
0
answers
14
views
Efficient sky searches with HEALPix-alchemy
I am trying to implement a cone search for a catalog with the HEALPix-alchemy package. I have the following models set up, based on the examples here: https://arxiv.org/pdf/2112.06947
...
2
votes
0
answers
74
views
Using prospector for jwst data
I am working with JWST data. I want to estimate the redshift of the sources I have identified with SEXtractor with the help of prospector. Can somebody guide me in this?
3
votes
1
answer
81
views
Pyephem equivalent when living on Mars?
The python pyephem library is great... if you are on Earth. Has anyone built one if you were living on Mars? A search on this turns up the ephemeris of Mars many times, but not something that could ...
2
votes
0
answers
33
views
How to convert .exp files from NRAO VLA Archive to .fits format
I recently downloaded some observational data files from the NRAO VLA Archive, and they have the extension .exp. These are old observations. I need to convert these files to .fits format for further ...
2
votes
2
answers
114
views
python question-discrepancy between number of stars found
Ok, I get that this is a long question but it's ok if you don't know just thought I'd give this a try anyway. I get that it's a long shot. Basically I'm trying to replicate a methodology used in the ...
3
votes
1
answer
63
views
"inconsistent TLE object name (LINE IGNORED)" error while using JPL Horizons API in python
I have troubles with usage of JPL Horizons API to generate ephemeris of more than one satellites. I'm not using and don't want to use any external libraries to do this.
Currently I have this piece of ...
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 ...
1
vote
1
answer
61
views
Calculating field rotation between two times
I have the formulae to calculate the rate of field rotation at any given time, and using a python script with Skyfield I can generate a a value incrementing every 10th of a second based on the live ...
2
votes
1
answer
67
views
Inconsistency between Horizons data retrieved via Astroquery and Horizons web interface
I am attempting to obtain the x, y, z coordinates of the Sun-asteroid vector using Horizons.
The code I wrote is:
...
0
votes
0
answers
65
views
4
votes
1
answer
115
views
How to speed up REBOUND python simulations on a Jupyter notebook?
I'm running Python based computational astrophysics simulations on a Jupyter notebook, with the help of a library called REBOUND (also using REBOUNDx), to create a simulation containing the solar ...
4
votes
2
answers
79
views
Efficient method for generating combined spectra from N-body simulation data using Python (convolution)
(I asked this same question also in StackOverflow, due to being both astronomy/coding problem, here link : https://stackoverflow.com/questions/78166419/efficient-method-for-generating-combined-spectra-...
5
votes
2
answers
661
views
How to calculate the true distance of the sun and the earth using skyfield?
I'm trying to calculate the true distance between the sun and the Earth using skyfield.
To estimate the distance at a time instance I use the barycentric coordinates of the sun and earth using the ...
8
votes
1
answer
281
views
Attempting to plot solar terminator using Python and Skyfield library
Problem
I would like to plot the small circle defining the visible portion of Earth for an observer at position $P$ away from the Earth, on a 2D map. In the case of the Sun, this would be the solar ...
2
votes
1
answer
121
views
Implementing polar coordinates correctly in solar system model?
I am working on a 2d solar system model using Python, but I'm unsure if my implementation of planet data is correct. I have the planet data stored in polar form (distance, velocity and angle), and I ...
4
votes
2
answers
153
views
Resolving variance between Skyfield-generated sun vectors and test data when both use same ephemeris
I have two functions that get TEME and GCRS Earth-Sun position vectors using Skyfield:
earth_sun_vectors.py
...
1
vote
0
answers
65
views
Python Lightkurve Module -- How to combine different TESS sectors into one graph
I'm building a pipeline to look at several thousand eclipsing binary systems for my master's thesis, and I've run into an issue I am having a hard time fixing. I'm using the Python module Lightkurve.
...
1
vote
1
answer
90
views
Plotting scatter graphs with fits binary file?
Basically I'm trying to create code in python which will allow me to open a Fit's binary file, read it and create a scatter diagram with it. Hopefully plotting LogG vs Teff. But it seems like ...
2
votes
1
answer
84
views
Equation for calculating boolean answer to "is this Earth satellite in eclipse"
I have found plenty of math for determining duration of satellite eclipse, but I am having trouble finding an equation that produces a simple boolean answer to the question "Is this Earth ...
1
vote
0
answers
360
views
Three Body Problem using Python
I need help with an assignment. I'm doing a little project for a subject on my university and as the title says, its to find a solution to the three body problem restricted to a circular motion.
The ...
0
votes
0
answers
37
views
How to plot different curves in the same polar cordinates in matplotlib?
I tried to plot the paths of particle of different sizes in the same polar coordinate using the code given below using matplotlib. somewhat like this:
Instead I got this plot:
while the path for ...
2
votes
1
answer
62
views
Help with simulating long-term orbital dynamics of exoplanetary systems using Rebound
I am a junior in high school working on an independent research project and I need help because I've reached the limits of my knowledge. My goal is to simulate the long-term orbital dynamics of ...
2
votes
0
answers
34
views
Sloan Digital Sky Survey - Obtaining Spectral and Photometric Datasets
I am working on a soft computing (fuzzy logic), genetic algorithm, explainable AI (XAI) classification system for astronomical objects from the Sloan Digital Sky Survey. The dataset I am currently ...
0
votes
0
answers
44
views
Looking for feedback for my python GUI: visualise exoplanet transit and simulate atmospheric temperature
This isn't necessarily an astronomy question (although there may be plenty of astronomy errors in my GUI), and I apologise in advance if this kind of thing is not allowed here and the question is to ...
1
vote
0
answers
25
views
Obtaining Transit Spectrum for Celestial Bodies Using JWST NIRSPEC
I've recently been tasked with obtaining transit spectrum data for some fascinating celestial bodies, including Ceres, Enceladus, Ganymede, Io, and Titan. The goal is to compare their transit spectra ...
2
votes
0
answers
91
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
99
views
PYTHON calculation of conversion coefficients for UBVRI filters to standard photometric system
First of all hello, I am new to this forum and I apologize in advance if I am wrong.
I am doing open cluster observations and as a result of these observations I am trying to find the conversion ...
2
votes
0
answers
44
views
Colossus sigma function not reading the changes in the code
am currently using the colossus package on Python, which helps calculating functions that are relevant in Cosmology.
I am interested in calculating a Matter power spectrum, and use it as a base to ...
2
votes
1
answer
230
views
What is the mathematics needed for understanding DE440 and translating it into xyz coordinates?
I would like to write my own code to process NASA's DE440/DE441 ephemerides, but I do not know the mathematics needed to do this.
I understand packages such as pyephem have implemented variations of ...
3
votes
2
answers
116
views
How to construct optimal Wiener Filter?
I am trying to construct a Wiener Filter, to filter the ratio of the peak from the cross-correlation function, between a galaxy spectra and a template spectra, with the peak of the auto-correlation ...
0
votes
1
answer
290
views
Plot several FITS files in one graph
At the moment, I get three separate graphs. Ideally I would like to overlay all graphs, so that I only have one plot with multiple FIT files.
I have a folder on my desktop with the HARPS-N data, the ...
1
vote
0
answers
38
views
Computing Algol's apparent magnitude from TESS observation data
A helpful developer downloaded a light curve of Algol from STScI's MAST service of the TESS archive for me.
Its content looks like this:
...
1
vote
0
answers
196
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 ...
1
vote
3
answers
151
views
Getting (variable) apparent magnitude of Algol
I've heard that in ancient Egypt they had a calendar to determine the lucky and less lucky days, which alternated approximately every 2.8 days. According to researchers, this may have been related to ...
0
votes
1
answer
125
views
2D Galaxy Spectrum taken by long-slit-spectrograph
I have the 2D data (shape(1125,2058) taken by a long slit spectrograph, which looks as follows:
The y-axis corresponds to the distance from the center, where the center is at the most bright green ...
5
votes
1
answer
295
views
How can I get a list of the closest x stars and their distances from the Gaia ESA Archive using Python?
I've been trying to find this out for a while now, but I'm making zero progress. I really struggle to find good documentation for the query language, and even in the astroquery library I can't find ...
4
votes
1
answer
138
views
Different results for the same JPL Horizons query
On JPL Horizons website, I'm using the following query to get vector state for Earth:
...
2
votes
1
answer
647
views
How to slice WCS in a FITS file?
I have three WCS axes in a FITS image. I want to slice the axes and use only the first one. Note that though there are three axes, the WCS is superimposable. So there is no worry about a shift in WCS ...
2
votes
1
answer
174
views
Python Program for Synodic months
I am trying to make an astronomical program for celestial bodies in our solar system (and beyond!).
However I want it to show how many Synodic months since New moon. Example: Since last 2022 there ...
0
votes
0
answers
52
views
How do I code the formula for the minimum mass of a stellar fragment from Whitworth & Stamatellos, 2006?
I was researching the formation of brown dwarfs, and I stumbled into the paper "The minimum mass for star formation, and the origin of binary brown dwarfs", and I am attempting to code a ...
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 ...
4
votes
1
answer
441
views
Determining period of an exoplanet using radial velocity data
I've spent an incredibly large amount of time trying to wrap my head around how the period is computed using just solely the raw data for the radial velocity. I've tried my hand with some nonlinear ...
6
votes
0
answers
131
views
Kepler ellipse orbit fit issues
I am helping my high schooler with a research paper that uses PyAstronomy to fit the orbit of stars around Sag A. It isn't working because the angles (parameters Omega, omega, and i) seem to have a ...
4
votes
0
answers
96
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
94
views
How do I create well a weighted black hole mass function?
I'm running a set of simulations to study the evolution of Super Massive black holes.
In principle, I have the black hole masses and other property called merger tree weight in Mpc-3 unit which is ...
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 ...
1
vote
1
answer
133
views
python skyfield hipparcos sun mean longitude (L)
I calculate the ra and decl or the stars as below.
Can I add the sun's mean longitude L (=M+w) to:
...
2
votes
0
answers
41
views
What sort of exploratory procedures should be carried out on astronomical data? [closed]
Upon downloading an astronomical dataset such as SDSS DR12 from VizieR, what kind of exploratory techniques should be performed? I start with the basics, like this tutorial, and how much missing data ...