How To Discover A Comet: A Complete Guide

In previous article I have given the overview of Sungrazer’s Project. Here I will go through steps involving fetching and processing raw files and as well as discovering and reporting a potential comet.

An Overview of Sungrazer Project by Dr. Karl Battams

Sungrazer Project: How to discover a Comet?

As mentioned in the above article we will be focusing data from SOHO C2 and C3. Here is the workflow:

Get the SOHO schedule

Visit: https://soho.nascom.nasa.gov/operations/schedule/schedule.html

Paste the whole text on excel sheet

Should look like this

Split data into different cells (by “space”)

  1. Select the cell or column that contains the text you want to split.
  2. Select Data > Text to Columns.
  3. In the Convert Text to Columns Wizard, select Delimited > Next.
  4. Select the Delimiters Space” for your data.
  5. Select Next.
  6. Select Finish.

Convert data and time from UT (GMT) to your time zone

  1. Enter value “05:30:00” (assuming you’re at GMT+5:30) in one of the cells
  2. Add the value in BOTs and EOTs
Apply this in all ‘Time’ cells. Date must be updated (manually) accordingly

Note: For 24rd of June, 2021, files will be uploaded in three batches. First from 4:35 to 8:30, second from 12:20 to 15:30 and third batch from 21:50 to 23:00 (all time in GMT). Images are uploaded in interval of 12 minutes.

Fetch C2 and C3 raw files

Following the schedule, fetch the files from following links:

  1. C2 Files
  2. C3 Files
Latest C3 raw images

Note: In the C2 file link – “210623” refers to 23rd of June, 2021. You can change this for the desired date from the present month. To access files older than the present month – you have to visit – https://sohowww.nascom.nasa.gov/data/data.html

For discovering comets, latest images are preferred. Older images might have some previously undetected comets (as of now), but probability is thin – at least with the python scripts I have mentioned further in this article.

Download only 1024×1024 fits images. Save C2 and C3 images in separate locations.

Image Processing

  1. For C2 images: “Unsharp Masking” algorithm is preferred
  2. For C3 images: “Running Difference” algorithm is preferred

Unsharp Masking (Python Script)

import matplotlib.pyplot as plt
import glob
import numpy as np
from sunpy.map import Map
from scipy.signal import medfilt2d
from skimage import io
flist=glob.glob(r'C:\Users\...\Downloads\*fts')  #path of raw data (keep '*fts' as it is)
outdir = r'C:\Users\...\Desktop\Comet\Data\C2'     #path of output directory
nf=len(flist)
d = Map(flist, sequence=True)
data = d.as_array().copy().astype('float64')
for i in range(nf):
    data[:,:,i] /= d[i].exposure_time.value
dpi = 80        
width = 1024    # image size (assuming 1024x1024 images)
height = 1024   # image size (assuming 1024x1024 images)
kern = 25       # size of smoothing kernel;can try different values
imgmin = -3.    # MAX value;can try different values here
imgmax = 3.     # MIN value;can try different values here
figsize = width / float(dpi), height / float(dpi)
for i in range(0,nf-1):
    print("Processing file %i of %i" % (i,nf))
    unsharp = data[:,:,i] - medfilt2d(data[:,:,i], kernel_size=kern)# Unsharp masking
    fig = plt.figure(figsize=figsize)
    ax = fig.add_axes([0, 0, 1, 1])
    ax.axis('off')
    ax.imshow(np.fliplr(unsharp), vmin=imgmin,vmax=imgmax,cmap='gray', interpolation='nearest')
    ax.annotate(d[i].date.strftime('%Y/%m/%d %H:%M'), xy=(10,10), xytext=(320, 1010),color='cyan', size=30, ha='right')
    outname=outdir+'/'+d[i].date.strftime('%Y%m%d_%H%M_C2.png')
    ax.set(xlim=[0, width], ylim=[height, 0], aspect=1)
    fig.savefig(outname, dpi=dpi, transparent=True)
print("Done Processing LASCO C2.")

Running Difference (Python Script)

import matplotlib.pyplot as plt
import glob
import numpy as np
from sunpy.map import Map
flist=glob.glob(r'C:\Users\...\Downloads\*fts')  #path of raw data (keep '*fts' as is)
outdir = r'C:\Users\...\Desktop\Comet\Data\C3'   #path of output directory
nf=len(flist)
d = Map(flist, sequence='true') 
data = d.as_array().copy().astype('float64')
for i in range(nf):
    data[:,:,i] /= d[i].exposure_time.value
rdiff = np.diff(data, axis=2) # Running diff with ALL IMAGE
rdiff = np.diff(data[:,:,::2], axis=2) # Running diff using EVERY 2ND IMAGE
rdiff = np.diff(data[:,:,::3], axis=2) # Running diff using EVERY 3RD IMAGE
# IMPORTANT
# pick only ONE of the three 'rdiff' lines above. Comment out the two you
# don't want.
dpi = 80
width = 1024    # image size (assuming 1024x1024 images)
height = 1024   # image size (assuming 1024x1024 images)
imgmin = -5.    # MAX value;can try different values here
imgmax = 5.     # MIN value;can try different values here
figsize = width / float(dpi), height / float(dpi)
for i in range(1,nf-1):
    fig = plt.figure(figsize=figsize)
    ax = fig.add_axes([0, 0, 1, 1])
    ax.axis('off')
    ax.imshow(np.fliplr(rdiff[:,:,i]), vmin=imgmin,vmax=imgmax,cmap='gray', interpolation='nearest')
    ax.annotate(d[i].date.strftime('%Y/%m/%d %H:%M'), xy=(10,10), xytext=(320, 1010),color='cyan', size=30, ha='right')
    outname=outdir + '/' + d[i].date.strftime('%Y%m%d_%H%M_C3.png')
    ax.set(xlim=[0, width], ylim=[height, 0], aspect=1)
    fig.savefig(outname, dpi=dpi, transparent=True)
print("Done Processing LASCO C3.")

Note: These two are only example scripts, not the most efficient scripts out there. But certainly will help to get you started.

Finding Potential Comet

After you have run the scripts, resulting images will come up as the one here:

A real C2 image (processed using Unsharp Masking).

Yes, the images are grayscale and ugly with all kinds of random flares… but they’re great for seeing comets.

There are few artifacts in the images that may appear as a potential comet to you. These are:

  1. Stars and Planets
  2. Cosmic Rays

Stars and Planets

A small white pixel moving in successive frames from left to right is a star. Planets are much brighter and have diffraction spikes. Planets and may move from right to left or from left to right. Stars always move horizontally and always at same relative speed as one another (Planets also move horizontally but at different speeds). Usually 14-15 stars are present in any single frame from C2 and 100s in any single C3 frame (as it has wide field of view). Below is an animation of multiple frames from 15th of March, 2021. You can see many stars moving from left to right (a bright one is at bottom left portion of the frame). gif may take some time to load.

Cosmic Rays

In the above gif, you can see many sudden streaks of light. It appears randomly in a frame and than disappears in the next. Cosmic rays are noise and streaks created in the images by energetic particles striking the cameras in the telescopes.

Appearance of a potential comet

  1. A small faint speck moving slowly between images.
  2. Have constant speed and direction.
  3. Never move horizontally like Stars and Planets.
  4. Move in a near-perfect straight line with same size, shape and brightness.

Below is the animation of C3 images taken on 6th of February, 2007. Comet ‘SOHO1264’ is visible moving from bottom left corner to the center of the frame. This comet is relatively brighter one. Most of the discovered comets are much fainter. gif may take some time to load.

Reporting Potential Comet

Once you are certain that the object that is appearing in your processed images is a comet, note down the pixel location of the comet in successive frames. Each frame is denoted by its date and time. You will need to note down the X-Y pixel location of the comet. X-0 and Y-0 being top-left corner pixel of the image, and X-1024 and Y-1024 (assuming 1024×1024 image size) being the bottom-right corner pixel of the image. For a comet report to be confirmed, comet should appear in at least 5 frames.

Pixel locations can be obtained by using any image processing software. Link to where you have to submit your report and other important links are given below:

  1. The Sungrazer Project Website
  2. Get Started
  3. Guide
  4. Tutorial
  5. Report a Comet

PS: Feel free to reach out with any related questions. I will be happy to help/guide you!

~AK

Published by Anand Krishna

Amateur astronomer and astrophotographer. Interested in astrophoto processing, astrostatistics, comet hunting, visual and radio astronomy.

2 thoughts on “How To Discover A Comet: A Complete Guide

Leave a Reply to Astrophysics and Python Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s