en un clic
astropy-astronomy
// "Astronomical computations via Astropy. Use when: user asks about celestial coordinates, FITS files, or cosmological calculations. NOT for: telescope control or real-time observation planning."
// "Astronomical computations via Astropy. Use when: user asks about celestial coordinates, FITS files, or cosmological calculations. NOT for: telescope control or real-time observation planning."
# Academic Literature Search — 学术文献检索与引用管理
Search arXiv for preprints in physics, math, CS, quantitative biology, quantitative finance, statistics, electrical engineering, economics. Use when: (1) finding preprints by topic, (2) searching by author, (3) browsing arXiv categories, (4) getting paper metadata/abstracts. NOT for: published journal articles (use crossref-search), biomedical (use pubmed-search).
Screen papers for systematic reviews using ASReview active learning. Use when: user has a large set of papers to screen for inclusion/exclusion, wants to prioritize relevant papers, or needs to reduce manual screening workload. NOT for: searching papers (use literature-search) or meta-analysis (use meta-analysis).
Analyzes astronomical observations and cosmological models including telescope data processing, celestial mechanics calculations, stellar evolution, galaxy classification, and cosmological parameter estimation; trigger when users discuss stars, galaxies, exoplanets, dark matter, or the universe's large-scale structure.
Performs bioinformatics analyses including pathway enrichment, gene ontology analysis, protein-protein interaction networks, multi-omics integration, and biological sequence database querying; trigger when users discuss gene sets, biological pathways, functional annotation, or omics data integration.
"Bioinformatics operations via Biopython. Use when: user asks about DNA/protein sequences, BLAST, or PDB structures. NOT for: clinical genomics or variant calling pipelines."
| name | astropy-astronomy |
| description | Astronomical computations via Astropy. Use when: user asks about celestial coordinates, FITS files, or cosmological calculations. NOT for: telescope control or real-time observation planning. |
| metadata | {"openclaw":{"emoji":"🔭","requires":{"bins":["python3"]},"install":[{"id":"uv-astropy","kind":"uv","package":"astropy"}]}} |
Astronomical computations using Astropy.
from astropy.coordinates import SkyCoord, EarthLocation, AltAz
from astropy.time import Time
import astropy.units as u
coord = SkyCoord(ra=10.684*u.deg, dec=41.269*u.deg, frame='icrs') # M31
coord_str = SkyCoord('00h42m44.3s', '+41d16m09s', frame='icrs')
# ICRS to Galactic
galactic = coord.galactic
print(f"l={galactic.l:.4f}, b={galactic.b:.4f}")
# Angular separation
c1 = SkyCoord(ra=10.684*u.deg, dec=41.269*u.deg)
c2 = SkyCoord(ra=11.0*u.deg, dec=41.5*u.deg)
sep = c1.separation(c2)
# AltAz (horizontal) coordinates
location = EarthLocation(lat=34.05*u.deg, lon=-118.25*u.deg, height=100*u.m)
time = Time('2026-03-15 03:00:00', scale='utc')
altaz = coord.transform_to(AltAz(obstime=time, location=location))
print(f"Alt={altaz.alt:.2f}, Az={altaz.az:.2f}")
import astropy.units as u
d = 10 * u.pc
print(d.to(u.lyr)) # parsecs to light-years
wav = 21 * u.cm
freq = wav.to(u.GHz, equivalencies=u.spectral())
wavelength = (13.6 * u.eV).to(u.nm, equivalencies=u.spectral())
from astropy.io import fits
with fits.open('image.fits') as hdul:
hdul.info()
header = hdul[0].header
data = hdul[0].data
hdu = fits.PrimaryHDU(data_array)
hdu.header['OBJECT'] = 'M31'
hdu.writeto('output.fits', overwrite=True)
from astropy.cosmology import Planck18 as cosmo
z = 1.0
d_L = cosmo.luminosity_distance(z) # luminosity distance
d_A = cosmo.angular_diameter_distance(z) # angular diameter distance
age = cosmo.age(z) # age of universe at z
lookback = cosmo.lookback_time(z) # lookback time
H_z = cosmo.H(z) # Hubble parameter at z
from astropy.time import Time
import astropy.units as u
t = Time('2026-03-15 12:00:00', scale='utc')
print(t.jd, t.mjd, t.unix) # JD, MJD, Unix
print(t.tai, t.tdb) # TAI, TDB scales
now = Time.now()
python3 -c "
from astropy.coordinates import SkyCoord; import astropy.units as u
c = SkyCoord(ra=83.633*u.deg, dec=22.014*u.deg)
print(f'Galactic: l={c.galactic.l:.3f}, b={c.galactic.b:.3f}')
"
astropy.units.utc, tai, tdb).Planck18 as default cosmology unless otherwise specified.SkyCoord for all coordinate work rather than manual trig.