Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python coding for astronomy (Lengthy, but need help) Somewhat quick explanation on the project. I have so far correctly matched spectra of stars between two

Python coding for astronomy (Lengthy, but need help)

Somewhat quick explanation on the project. I have so far correctly matched spectra of stars between two libraries of different quantites.

All the unmatched stars are supposed to be returned listing their coordinates (RA and DEC), where then I would use what is returned to download their png files

and create a webpage of all the unnmatched spectra. Example so far:

(Matching code)

image text in transcribed

Returns)

python sdssDR13spectroquery.py 127.803594774 48.3011272115 python sdssDR13spectroquery.py 127.803594774 48.3011272115 python sdssDR13spectroquery.py 127.803594774 48.3011272115 python sdssDR13spectroquery.py 127.803594774 48.3011272115 python sdssDR13spectroquery.py 127.991699025 48.261116025 python sdssDR13spectroquery.py 127.803594774 48.3011272115 python sdssDR13spectroquery.py 127.991699025 48.261116025 * python sdssDR13spectroquery.py 127.991699025 48.261116025 * python sdssDR13spectroquery.py 127.991699025 48.261116025 * python sdssDR13spectroquery.py 127.840274257 48.2399531789

(Problem)

It is returning duplicates * , and I cannot find why. Also, the list above is in the thousands, so I just put a small example of what is happening.

Please help with this if possible. Panicked.

from astropy.coordinates import SkyCoord from astropy import units as u import fitsio import numpy as np from astropy.io import fits hdulist = fits.open('/d/userst rimble/Desktop/Cats/DR120.fits') ral-hdulist [1] . data [ ' RA' ] decl=hdulist [1] .data [ ' DEC' ] DR12Q=SkyCoord (ra-ra1*u.degree, dec=aec1*u.degree) objs=fitsio. read(' /d/userstrimble/Desktop/Cats/sequels. fits ' ) w= np . where ( ((objs["EBOSS TARGETO"] & 2**16) !=0 ( (objs["EBOSS TARGETO"] & 2*+17) != 0) objs=objs [w] ra2-objs['RA'] dec2=objs [ ' DEC ' ] sequels = SkyCoord (ra-ra2*u.degree, dec=dec2*u.degree) 1*u.arcsec) idxseq, idxDR, d2d, d3d= DR12Q.search-around-sky ( sequels, #sets array at 0 index matched = np. zeros (len(sequels)) #every match is a 1 matched [idxseq]-1 #unmatched are 0? a = np . where (matched=0) for a in ra2: print ("python sdssDR13spectroquery.py" + str (ra2 [a])+""+ str (dec2 [a]) )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions