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
4
votes
1answer
36 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
101 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 ...
2
votes
1answer
35 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
52 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
48 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
90 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
63 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
102 views

How to Interpret Lomb Scargle periodogram

lomb scargle periodogram: ...
1
vote
0answers
26 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 below tutorial for the binary star system (EBLM J0608-59): https://docs.exoplanet.codes/en/stable/tutorials/rv/ I have the ...
3
votes
0answers
114 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
47 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
18 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
115 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 ...
2
votes
1answer
299 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
40 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
110 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
297 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
178 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 ...
1
vote
1answer
61 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
107 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 ...
0
votes
0answers
24 views

I am reading .fil File using UCBerkeleySETI / blimpy, but I am getting error?

I am working on pulsar search and I am reading the filterbank file using blimpy technique in python, but I am getting error. My question is that blimpy is a universal file reader, like ...
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
0answers
27 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. ...
0
votes
1answer
43 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
190 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
283 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
348 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
114 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 ...
4
votes
2answers
287 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
103 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
72 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
54 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
3k 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 ...
0
votes
0answers
25 views

How to select galaxy emitters from color-color diagram? (Those candidates which are above a line in a plot)

I am trying to select the OII emitters from the colour-colour diagram of galaxies data. I don't know how to select those candidates which are above the line. Here is my colour-colour diagram. . What I ...
3
votes
1answer
75 views

Galactic Equator zenith transit

I need to find the two times of zenith passage of the Galactic Equator for a given Earth Lat/Lon on any day between 3500 BC and 1500 AD. Since the Galactic Equator is a line and not a point, I try to ...
2
votes
0answers
39 views

Detect sources near image edge with python photutils

As my question suggests, I 'm trying to use a python library photutils in order to detect sources from MUSE cube. MUSE (Multi Unit Spectroscopic Explorer) is an ...
1
vote
1answer
129 views

Python controllable amateur astrophotography cameras?

I would like to read further about any successes that amateur astrophotographers (or professionals) have had with USB CCD cameras that are controlled by Python scripts. I'd like to script the setting ...
1
vote
0answers
128 views

Python interface for DMK 23U274 USB camera for astrophotography

I have access to a monochrome USB camera (DMK 23U274, The Imaging Source) and I'd like to record focal plane images from a small telescope with a python script that would control it by setting ...
2
votes
1answer
90 views

Neutrino Modelling in Friedmann Equation

I'm trying to model neutrinos in the Friedmann Equation. I've covered the case of the Benchmark Model where we have matter, radiation, curvature, and the cosmological constant, Lambda. I know my ...
-1
votes
1answer
106 views

Cannot plot Kepler FITS files with topcat in Windows

This is a continuation of my earlier question here. I was able to find Kepler data. Now I wanted to plot the data using Topcat. But when I tried to plot the data, I received error. Below is the error ...
2
votes
0answers
48 views

PHOEBE 2.2 Documentation, components and semi-major axis definitions

I'm looking at PHOEBE 2.2 Documentation, specifically at a tutorial about constraints What are Constraints? Constraints live in their own context of the Bundle, and many are created by default - ...
1
vote
1answer
134 views

How to compute Ascension / Descension cycle of the Moon

I am struggling to find out an information about how to determine ascending/descending cycle of the Moon. I can find from this source and a bunch of others, that Moon begins to descend when reaches ...
2
votes
0answers
108 views

How are small objects automatically identified and their locations determined in digital images?

I have a large quantity of old digital images of low energy electron diffraction (LEED) patterns that I must process to identify and locate small, sometimes elongated gaussian-like blobs of a few ...
4
votes
1answer
603 views

Plotting Astronomical Data Using Python

I have been trying to create a graph which shows the distances between the stars and the earth, yet I could not obtain the desired graph as seen below (click to zoom in): My graph: As @uhoh ...
2
votes
2answers
258 views

Finding Quintuple Planetary Alignments with SkyField

I am working on a python script that will use the SkyField and SciPy libraries to find quintuple planetary conjunctions and their corresponding constellation location. Specifically I am looking for ...
1
vote
1answer
104 views

Could someone please explain to me how I can extract velocity component values from Stellarium, for a given planet?

For a project that I am currently working on, I would like to know how one could extract velocity component values ($v_x$, $v_y$ and $v_z$) for a planet from the Stellarium software. The current ...
3
votes
1answer
103 views

Propagate Earth trajectory for 1 Myr

What is the most accurate way of propagation of Earth trajectory relatively to the Sun? I need to calculate the Earth-Sun distance. Is there any library on Python? I've used before JPL Horizons, ...
1
vote
1answer
111 views

SPICE Alt Az example

Original question below, but my question is now about how can I supply lat/lon coordinates for other locations other than the one in the example below? It is possible to use NASA's SPICE toolkit to ...
2
votes
1answer
149 views

How to do logarithmic wavelength binning (in Python) in order to find redshift?

In Tonry and Davis (1979), p.1513, they formulated a cross-correlation method for extracting velocity redshifts: Theory of Correlation Analysis a) Introduction Let $g(n)$ be the spectrum of a galaxy ...