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 attempted to match spectra of stars between

Python coding for astronomy (Lengthy, but need help)

Somewhat quick explanation on the project. I have so far attempted to match 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

Here is a link that serves as a guide for the code I have been using. I changed some notation, such as catalog is DR12Q, and c is sequels. Most of the reference material is on the bottom of the webpage under the "Search around sky" method. Essentially, if it's possible, could I get help with successfully returning only unmatched coordinates? Because numerious attempts have revealed some matched values in DR12Q, but only off by .3 arcseconds. Please any help would be greatly appreciated.

http://docs.astropy.org/en/stable/coordinates/matchsep.html

from ast ropy.coordinates import SkyCoord from astropy import units as u import fitsio import numpy as np from astropy.io import fits hdulist = fits . open ('/d/userstrimble/Desktop/Cats/DR120. fits') ral=hdulist [lj, dataRA" ] decl=hdulist [lj, data [ "DEC' ] DRI 2Q=SkyCoord (ra-ral*u.arc sec, dec-dec1*u.arc sec) obj s=fitsio. read(' /d/userst rimble/Desktop/Cats/sequels. fits' ) w= np.whe re ( ((objs["EBOSS TARGET0"] & 2**16) !=0) | ((objs["EBOSS TARGET0"] & 2**17) != objs-objs[w] ra2-objsRA" ] dec 2-objsDEC' ] sequels = SkyCoord (ra-ra2tu.arc sec, dec-dec2tu.arcsec) idxseq, idxDR, d2d, d3d = DR12Q.search around sky(sequels, 1*u.arc sec) #sets array at 0 index matched np.ze ros (ien ( sequels)) #every match is a 1 matched[idxseq]-1 #unmatched are 0? a = np.where (matched--0) #To remove any duplicated coordinates removeDuplicates-h for a in ra2: 1T str(razlaj) not in removeDuplicates.keys(): removeDuplicates [ st r ( ra2 [ a] ) ] =[ st r ( dec 2 [ a] ) ] print ("python sdssDR13spect roquery.py" +str(ra2[a])+ ""+ str(dec2 [a]))"| csh" elif str(dec2[a]) not in removeDuplicates[str(ra2[a])] removeDuplicatesIstr (ra2[a])].append (str(dec2[a])) print ("python sdssDR13spect roquery.py" +str(ra2[a])+ ""+ str(dec2 [a]))"| csh" from ast ropy.coordinates import SkyCoord from astropy import units as u import fitsio import numpy as np from astropy.io import fits hdulist = fits . open ('/d/userstrimble/Desktop/Cats/DR120. fits') ral=hdulist [lj, dataRA" ] decl=hdulist [lj, data [ "DEC' ] DRI 2Q=SkyCoord (ra-ral*u.arc sec, dec-dec1*u.arc sec) obj s=fitsio. read(' /d/userst rimble/Desktop/Cats/sequels. fits' ) w= np.whe re ( ((objs["EBOSS TARGET0"] & 2**16) !=0) | ((objs["EBOSS TARGET0"] & 2**17) != objs-objs[w] ra2-objsRA" ] dec 2-objsDEC' ] sequels = SkyCoord (ra-ra2tu.arc sec, dec-dec2tu.arcsec) idxseq, idxDR, d2d, d3d = DR12Q.search around sky(sequels, 1*u.arc sec) #sets array at 0 index matched np.ze ros (ien ( sequels)) #every match is a 1 matched[idxseq]-1 #unmatched are 0? a = np.where (matched--0) #To remove any duplicated coordinates removeDuplicates-h for a in ra2: 1T str(razlaj) not in removeDuplicates.keys(): removeDuplicates [ st r ( ra2 [ a] ) ] =[ st r ( dec 2 [ a] ) ] print ("python sdssDR13spect roquery.py" +str(ra2[a])+ ""+ str(dec2 [a]))"| csh" elif str(dec2[a]) not in removeDuplicates[str(ra2[a])] removeDuplicatesIstr (ra2[a])].append (str(dec2[a])) print ("python sdssDR13spect roquery.py" +str(ra2[a])+ ""+ str(dec2 [a]))"| csh

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: 3

blur-text-image

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

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

How does EVA differ from residual income?

Answered: 1 week ago