A Simple Method of Producing Images of SDSS Spectra in a Free Spreadsheet Program
DDraft version September 30, 2020
Typeset using L A TEX default style in AASTeX62
A Simple Method of Producing Images of SDSS Spectra in a Free Spreadsheet Program
Julia Falcone Department of Physics and Astronomy, Georgia State University, Atlanta, GA 30303, USA ABSTRACTUsing Google Sheets, I develop a method to easily reproduce thousands of images of SDSS spectra so that they maybe studied in only a fraction of the time it would otherwise take. This method may be helpful in projects requiring largesamples of SDSS objects with spectra, and is described in a step-by-step manner so that it is accessible to everyone. MOTIVATIONAs of the fourth generation of the Sloan Digital Sky Survey (SDSS-IV), Data Release 15 (DR15) (Blanton et al. 2017;Aguado et al. 2018), over 2 million galaxies have been observed with single-fiber spectra which visualize flux levelsover a wide range of wavelengths . These spectra are invaluable in projects involving the observation of propertieslike broad-line emission or characteristics of specific galaxy morphologies. However, when projects require one to lookthrough thousands of spectra to obtain a sufficient sample size, the process of clicking thousands of different linksto arrive at the images of desired spectra can be extremely time-consuming. There have certainly been attempts toautomate morphological classifications (e.g. Sreejith et al. 2017; de Diego et al. 2020), but others have shown thathuman observation of spectra may yield more accurate results, especially when classifications rely on noticing subtlespectral characteristics that are difficult for automated systems to spot (Greene et al. 2020). In this research note, Idetail a method to easily and quickly reproduce images of SDSS spectra in Google Sheets , which allows for thousandsof spectra to be observed by the human eye in only a fraction of the time it would normally take, by centralizing allof the necessary data in one place instead of over a multitude of webpages. This method was developed when myresearch group was tasked with looking through more than 15,000 spectra to identify E+A galaxies (Liu et al. 2020,in preparation; Dressler & Gunn 1983) in numerous large fields. This technique reduced the time to complete theassignment by at least a factor of 10. METHODOLOGYI have written a Github post explaining the steps in this section steps in greater detail for anyone who might findit useful. As mentioned, the application I find best suited for this method is Google Sheets, which allows for theextraction of images from websites with the correct use of its library of functions. The only necessary information foreach galaxy is its spectral ID (hereafter called the SpecID), RA, and declination, all of which can be obtained whensending a data query through the SDSS SkyServer Search Form and checking the applicable boxes. The RA and decwill only be necessary in the event of troubleshooting (Section 4).Use Figure 1 as a reference where the first, second, and third columns contain each galaxy’s RA, dec, and SpecIDrespectively. Then, if the fourth column is to display an image of the galaxy’s spectrum, that column’s cell for a givenrow should contain the following text: =IMAGE(CONCATENATE("http://skyserver.sdss.org/dr15/en/get/SpecById.ashx?id=",[SpecID]),1) in which [SpecID] should point to the cell containing that galaxy’s SpecID. This command uses CONCATENATE tocombine the SpecID with an otherwise static URL to produce a link of the spectrum’s image. The
IMAGE functiongrabs the image of the spectrum from that URL and inserts it into the cell as shown in Figure 1. The second parameterin the
IMAGE function (in this example, ) relates to the different options in displaying the image which is detailed inthe function’s description .This produces the image of the spectrum in the desired cell, and can then be applied to all other rows. sdss.org/dr15/scope google.com/sheets/about juliafalcone.github.io/googlesheets-supplement skyserver.sdss.org/dr16/en/tools/search/form/searchform.aspx support.google.com/docs/answer/3093333 a r X i v : . [ a s t r o - ph . I M ] S e p TROUBLESHOOTINGSince this method makes use of the functions available in Google Sheets, it is not applicable to other similarapplications such as Excel. Even in Google Sheets, this method produces null results approximately 15 percent of thetime, as the SpecID does not always correspond with the galaxy with which it is listed. In such cases, the correctSpecID can be obtained using one of the following solutions:
Problem : After inputting the command above, I receive an error message.
Solution : First, make sure that the [SpecID] text is deleted and replaced with the correct cell containing theSpecID. Additionally, depending on how the command is copied and pasted, there may be inconsistencies in how thequotation marks are represented. Make sure that all quotation marks are of the Unicode number U+022( " ) and notthe left and right double quotation marks U+201C/U+201D ( ”). Problem : After inputting the command above, the cell reads No image exists for this region.”
Solution : When this happens, it means the SpecID which was received from the SkyServer query is incorrect. Toremedy this problem, one can either obtain it manually by searching through SDSS using the RA and dec, or one cancopy the following command into the cell containing that galaxy’s SpecID: =MIDB(INDEX(IMPORTHTML(CONCATENATE("http://skyserver.sdss.org/dr15/en/tools/explore/Summary.aspx?ra=",[ra],"&dec=",[dec]), "table",28),1),14,19)
Here, [ra] and [dec] are the cells containing the galaxy’s RA and dec, respectively. This command makes useof several other functions, which have the following purposes:
CONCATENATE once again creates a URL from insertedvalues of the galaxy’s RA and dec;
IMPORTHTML imports the data from this URL into the sheet in the form of a table(which I have specified with the parameter "table" ). The SpecID is typically on row 28 of this table, so I chooseto isolate that row;
INDEX further helps to isolate the SpecID; and lastly
MIDB is used to pinpoint the exact locationof the desired characters. The SpecID is the 14th character in the row and runs 19 digits long, hence the final twonumbers. Although this command stretches over two lines in this note, it should read as one continuous line in theprogram, so it will be necessary to delete any line breaks once the command is pasted into the program.
Problem : I typed in the command from the solution above to obtain the SpecID, but the cell for the spectrum isnow completely blank.
Solution : Change to in the command above, so it reads as such: =MIDB(INDEX(IMPORTHTML(CONCATENATE("http://skyserver.sdss.org/dr15/en/tools/explore/Summary.aspx?ra=",[ra],"&dec=",[dec]), "table",29),1),14,19) The problem is caused by flags on some galaxies warning of possibly unreliable photometry. The inclusion of thistext causes the placement of all other measurements below it to shift by a line. ACKNOWLEDGEMENTSI thank Charles Liu for his valuable discussions and input. This work was supported by the Alfred P. SloanFoundation via the SDSS-IV Faculty and Student Team (FaST) initiative, ARC Agreement SSP483, and by NSFgrant AST-1460860 to the CUNY College of Staten Island.REFERENCES
Aguado, D. S., Ahumada, R., Almeida, A., et al. 2018, TheFifteenth Data Release of the Sloan Digital Sky Surveys:First Release of MaNGA Derived Quantities, DataVisualization Tools and Stellar Library.https://arxiv.org/abs/1812.02759Blanton, M. R., Bershady, M. A., Abolfathi, B., et al. 2017,AJ, 154, 28, doi: 10.3847/1538-3881/aa7567 Bundy, K., Bershady, M. A., Law, D. R., et al. 2014, TheAstrophysical Journal, 798, 7,doi: 10.1088/0004-637x/798/1/7de Diego, J. A., Nadolny, J., Bongiovanni, ´A., et al. 2020,A&A, 638, A134, doi: 10.1051/0004-6361/202037697Dressler, A., & Gunn, J. E. 1983, ApJ, 270, 7,doi: 10.1086/161093
Greene, O. A., Anderson, M. R., Marinelli, M.,Holley-Bockelmann, K., & Liu, C. 2020, ApJ, submitted Sreejith, S., Pereverzyev Jr, S., Kelvin, L. S., et al. 2017,Monthly Notices of the Royal Astronomical Society, 474,5232, doi: 10.1093/mnras/stx2976