# Astronomy/JS9

The JS9 Interface

JS9 is a web-based astronomical image analysis software. It was first introduced in the 2020 season to add an additional hands-on component to the astronomy event. This addition also prompted the possible permission of internet access for teams only to access the JS9 software. The JS9 website specifically made for Science Olympiad can be found at js9.si.edu/nso/nso.html.

## Opening Files

The JS9 software opens FITS files (files with the *.fits extension). Most files that will be used for JS9 questions will use the *_evt2.fits extension, which includes event data. Files can be opened locally or remotely.

### Open Remote

In the File > Open Remote menu, you can use a proxy or CORS server to open a FITS file remotely from a link.

#### Proxy Server

When this is selected, you can open a file from a link that does not support CORS (such as the Unofficial Chandra Archive). This will not display directly in JS9, but JS9 servers will retrieve the information to display the file. This option is the most commonly used, as it allows for a wide variety of links directly from archives.

#### CORS Server

This option will directly retrieve the image from a site that supports CORS (such as dropbox) and display the image directly in JS9.

### Open Example

When the JS9 site specifically developed for Science Olympiad is opened, there are six example links at the top of the site. Selecting one of these links will open one of the example images.

### Finding FITS Files

A great way to learn JS9 is to practice with JS9. FITS files can be found from:

• The Unofficial Chandra Archive
• Contains a vast number of objects, including many of the DSOs.
• To retrieve a file from here:
1. Search for an image.
2. Select the Observation ID (ObsID) to get a list of files. Some of the Observation IDs for DSOs can be found in their chandra.harvard.edu photo album entries.
3. Copy the link to the file ending with *_evt2.fits. This contains the event information that will be used for analysis.
4. Open remotely using a proxy server.

## Viewing the Image

### Zoom

Using the bar at the top, you can click on either of the magnifying glass icons to zoom in or out. Additionally, you can open the "Zoom" menu to get more options on zooming in or out on parts of your image.

### Panning

JS9 Panner Window

In the "View" menu of JS9, select the "Panner" option. A separate window will appear that contains a small version of the image with a box around the current area you are viewing. Drag this box anywhere in this small version of the image to pan around the JS9 image.

### Colormaps

JS9 displays images in false color based on data. In the "Color" menu, you will be given a dropdown of different color schemes to change the colormap of your image. This changes how different intensities of the image appear. Playing with different colormaps can give you an idea of which one works best for you.

#### Contrast and Bias

You can adjust the contrast and bias of an image to highlight different parts of the image of different intensities. To adjust the contrast (or make the range over which the color covers change) click on the image and drag your mouse up and down. To adjust the bias (or the intensity over which the contrast is centered), drag the mouse left and right. This can help you determine areas of high intensity, or a certain intensity.

#### Composite and Overlaid Images

Example RGB overlay using three different images

If you have 2 or 3 images, you can overlay them. This is useful if you have two or three images in different wavelengths of a single object (e.g. created through an energy Event Filter), you can overlay them on top of each other to create a composite image.

1. The first step is to put each image in a red, green, or blue colormap. Only images in these colormaps can be overlaid.
2. Adjust each different image as you see fit. This may require zooming out or panning to make all of them aligned, or adjusting contrast and bias. You can switch between images in the "File" menu.
3. Select "rgb mode" from the "Color" menu to overlay images in the red, green, and blue colormaps on top of each other.

## Analysis

Analysis in JS9 is done through regions in an image. A region will be placed on an image, and all pixels inside the region will be analyzed using different analysis functions.

### Regions

Regions are geometric shapes that can be placed on an image. These regions indicate areas for analysis, or can be used to indicate areas of interest on the image. To insert a region, click on the region shape in the toolbar, or open the "Regions" menu and select the region that you would like to insert.

Clicking inside a region will toggle it into focus. You can then move or resize it, as you would a shape in a drawing program. Click outside the region to toggle it out of focus. Double clicking inside a region will open the configuration menu. You can view and change parameters in this menu, and then click apply to save your changes to the region.

#### Annulus

This region is a target-shape. It is considered by many functions as multiple regions, with each space between the lines as its own region. When you insert an annulus, it defaults in the center of your viewing field with two regions. To change the number of regions, double-click on the annulus to bring up the configuration menu. In the third field after the "Edit:" label (this is also the longest of the three fields), there will be three default values, one of them is 0". To add another region, you will need to add another value behind this, which will mark the radius of the next circle out (make sure to insert a comma between all values and quotation marks after each measurement, indicating arcseconds).

#### Box

This region is rectangular. It defaults as a square, but can be resized as a rectangle. You can manually change the width and height of this region by double-clicking to open the configuration menu and editing the 3rd and 4th boxes after the "Edit" label.

#### Circle

This region is circular. To change the radius of this region, double-click on it to open the configuration menu. Edit the 3rd text field after the "Edit" label.

#### Ellipse

This region is elliptical. It defaults as an ellipse with a horizontal radius about 1.5 times the vertical radius, centered on the viewing field. Ellipses can be stretched, compressed, or dilated to the desired shape. Alternatively, the two radii of the ellipse can be entered manually, by double-clicking on the region to open the configuration menu and entering the desired horizontal radius and vertical radius in the 3rd and 4th text fields after the "Edit" label.

#### Other Regions

The polygon region is a region that defaults to an equilateral triangle centered in the viewing window that can be stretched, compressed, or dilated.

The line region is a linear, one dimensional region. This region analyzes pixels that fall on this line. This line can be adjusted using its endpoints, or selected/moved by clicking on the line.

The point region is a single point region. This analyzes only pixels that fall on that point. This point can be moved or selected by clicking on it.

The text region is not used for analysis, but rather for annotating the image. This may be useful if a test requires you to submit a final image and asks you to indicate a certain point.

### Client-Side Analysis

Client-Side Analysis is analysis that can be run in the web browser, and does not require requests to be made to a JS9 server.

#### Coordinate Grid

Client-Side Analysis Coordinate Grid

This displays a coordinate grid over the image. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Coordinate Grid" under the "Client-Side Analysis" heading.

#### Counts in Regions

This counts the photons in a specified region and gives a text output of the results. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Counts in Regions" under the "Client-Side Analysis" heading. Note that this does the same thing as the "Server-Side Analysis" version.

Radial Profile requires an annulus. This counts the photons and returns a graph of the surface brightness vs. the radius. It will perform this for each radius in the annulus. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Radial Profile" under the "Client-Side Analysis" heading. Note that this does the same thing as the "Server-Side Analysis" version.

#### Gaussian Blur

Gaussian Blur with sigma of 5

This blurs the image pixel values together using a Gaussian function. You will specify a radius (sigma) in the text field and the pixels will blur based on that radius. The lower the sigma that you enter, the less the pixels are blurred. To run this analysis, open the "Analysis" menu in the menu bar, and enter a value in the text field under the "Blur, equivalent sigma" heading, under the "Client-Side Analysis" heading. Then, push enter to blur the image.

### Server-Side Analysis

Server-Side Analysis is analysis that sends requests to a JS9 server, and the JS9 server will analyze the input data and send a result to the web browser.

Displays all the headers in the FITS file. This can be useful for finding documentation of the FITS file, as well as FITS headers to use in the Histogram Plot analysis. To run this analysis, open the "Analysis" menu in the menu bar, and click on "FITS Header(s)" under the "Server-Side Analysis" heading.

#### Counts in Regions

This counts the photons in a specified region and gives a text output of the results. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Counts in Regions" under the "Server-Side Analysis" heading. Note that this does the same thing as the "Client-Side Analysis" version.

Radial Profile requires an annulus. This counts the photons and returns a graph of the surface brightness vs. the radius. It will perform this for each radius in the annulus. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Radial Profile" under the "Server-Side Analysis" heading. Note that this does the same thing as the "Client-Side Analysis" version.

#### Energy Spectrum

Server-Side Analysis Energy Spectrum

This generates an energy spectrum of all regions. It displays a graph with energy (electron volts) on the x-axis and counts (photons) on the y-axis. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Energy Spectrum" under the "Server-Side Analysis" heading.

#### Light Curve

This generates a light curve of all selected regions. It returns a plot display of the time (in seconds) on the x-axis and counts (photons) on the y-axis. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Light Curve" under the "Server-Side Analysis" heading. Note that this is not the same as the NSO version.

#### Histogram Plot

This generates a plot of a user-specified column of all regions. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Histogram Plot" under the "Server-Side Analysis" heading. Enter the name of the column that you wish to be on the y-axis (columns can be found in the FITS Header(s) analysis). Click "run" to generate the plot.

#### Event Filter

This generates an image for events that satisfy a certain criterion. The criterion will be defined as a FITS Header with the criterion following it. For example, pi=500:1500 will filter data so that an image is displayed with only data that has data in the pi column between 500 and 1500. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Event Filter" under the "Server-Side Analysis" heading. Enter the criterion that you wish to filter for. Click "run" to generate the plot. Note that this will generate a separate image that can be switched to through the "File" menu.

### NSO Analysis

NSO Analysis contains analysis functions that were specifically made for Science Olympiad. The following analysis functions can be found in the analysis menu of JS9 under the "NSO Analysis Heading." Note that this will only work if you are in the Science Olympiad specific JS9.

#### Light Curve

NSO Analysis Light Curve

This generates a light curve of a selected region, with time on the x-axis and counts/second on the y-axis. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Light Curve" under the "NSO Analysis" heading. Note that this is not the same as the Server-Side Analysis version.

#### Power Spectrum

NSO Analysis Power Spectrum

This generates a spectrum of a selected region, with frequency on the x-axis and power on the y-axis. This analysis function can be very useful for determining periodicity. If the power spectrum has an obvious peak and little noise (unlike the shown period spectrum), it is likely that the period of the object is $\frac{1}{frequency}$ in seconds. This is because Hertz is defined as $\frac{1}{seconds}$, so flipping it would give you seconds. However, you will want to verify this period (likely using the period folding technique described below). To run this analysis, open the "Analysis" menu in the menu bar, and click on "Power Spectrum" under the "NSO Analysis" heading.

#### Period Folding

This is a method of testing a potential period of a light curve of a region. It is done by taking the a certain period of a light curve and "folding" it over the rest of the light curve. If the period is correct, the light curve will constructively interfere and the form of the light curve will be apparent. If the period is incorrect, the light curve will destructively interfere. This analysis requires you to enter a possible period, and it will generate a light curve of that period with the number of stacks you specify (the number of times the period is "folded"). To run this analysis, open the "Analysis" menu in the menu bar, and click on "Period Folding" under the "NSO Analysis" heading. Then, enter the possible period, and modify the number of stacks, if you so desire.

#### Flux in Regions

This generates a window that gives you the flux in regions (in photons/arcsec$^2$/sec). It also returns the telescope, raw counts, the raw area, the regions, and the exposure. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Flux in Regions" under the "NSO Analysis" heading.

### ImExam Plugins

Analysis done with the ImExam Plugin uses a rectangular box as a region, no matter what shape region is actually chosen. It has various analysis functions that specialize in comparing pixels in a region to one another, and has lots of visualization analysis functions.

#### 3dPlot

JS9 3dPlot

Generates a 3D Plot of the data in a region. To run this analysis, open the "Analysis" menu in the menu bar, and click on "3dPlot" under the "ImExam Plugins" heading.

#### Encircled Energy

This generates a plot of the energy from the center of the region to the edge. The distance from the center of the region is given on the x-axis, and the relative amount of energy at that radius is given on the y-axis. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Encircled Energy" under the "ImExam Plugins" heading.

#### Histogram

This generates a plot of the pixels in a region that are in the same 250th percentile of their value. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Histogram" under the "ImExam Plugins" heading.

This generates a scatterplot of pixel values at their respective radii. A Gaussian fit is overlaid on the scatterplot. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Radial Proj" under the "ImExam Plugins" heading.

#### Region Stats

This returns the statistics of the region, including (but not limited to) the total counts, the x and y position, and width and height of the region. To run this analysis, open the "Analysis" menu in the menu bar, and click on "Region Stats" under the "ImExam Plugins" heading.

#### X & Y Projection

This returns the sum, average, or median (depending on which is selected) of the values of the vertical (X) or horizontal (Y) pixels along the width (X) or height (Y) of a region. To run this analysis, open the "Analysis" menu in the menu bar, and click on "X Projection" or "Y Projection" under the "ImExam Plugins" heading.