Skip to main content

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
0 answers
55 views

Apparent RA-Dec value with geocentric observer didnt match between Skyfield and Horizons

When I trying to match between Skyfield and Horizons JPL data (with observer in geocentric), I found that the both value have differences. Here's configurations I have: ...
0 votes
0 answers
25 views

What elements (features) of a light curve do I need to classify it?

I am looking to create a machine learning model that classifies types of light curves. But what features do I use? In other words what numbers or parameters fully describe a light curve and ...
0 votes
0 answers
9 views

is there a way to access the list of points of a specific star's light curve in the ogle variable star database?

I am looking to do a machine learning project where I classify the type of variable star for the light curve. In doing this, I need to find a list of points of the graph of the variable star on ogle. ...
-1 votes
1 answer
94 views

How to graphically draw stars using python and AAVSO data

I have a file containing information about stars that looks like this for each star: 010001 |R And *|002401.95 +383437.3 |M and i need to figure out a way to converted so i can graphically show ...
3 votes
1 answer
105 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 ...
1 vote
1 answer
107 views

Code a scatter plot on a region of the sky with a circle

I am trying to do a scatter plot of a few data points on a region of the sky and then add a circle to the plot. Note, that I don't want a plot of the full sky, just of the region around the data ...
0 votes
0 answers
28 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 ...
4 votes
2 answers
89 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-...
1 vote
0 answers
37 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
18 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
175 views

Simulating Light Curve with the Timmer & Koenig method in Python

How can I simulate the light curve using the Timmer & Koenig method in Python with error bars in each counts generated by that method. I have used Astro ML but it doesn't show the error in the ...
0 votes
0 answers
143 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 ...
4 votes
0 answers
99 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 ...
2 votes
0 answers
92 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
87 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
53 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 ...
3 votes
1 answer
67 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 ...
2 votes
2 answers
116 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 ...
1 vote
0 answers
49 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
69 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: ...
1 vote
1 answer
156 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
0 answers
70 views

calculating Sun's J band mag via integrating the Planck’s law

...
4 votes
0 answers
142 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 ...
5 votes
2 answers
716 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
347 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 ...
4 votes
2 answers
172 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 ...
2 votes
1 answer
130 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 ...
1 vote
0 answers
126 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. ...
2 votes
1 answer
92 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
1 answer
104 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 ...
1 vote
0 answers
423 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
46 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
73 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
38 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
45 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
27 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
101 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
114 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
1 answer
1k 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 ...
2 votes
0 answers
50 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
267 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
152 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
373 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
45 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
236 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
159 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 ...
5 votes
2 answers
1k views

Comoving distance between two points [(RA1, Dec1, z1) and (RA2, Dec2, z2)]

I have Redshift (z), RA and Dec positions for two points in a galaxy catalogue (say P1 = [<...
0 votes
1 answer
161 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
371 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 ...
6 votes
3 answers
1k 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 ...