File:SN 2002cx Spectra.svg
Page contents not supported in other languages.
Tools
Actions
General
In other projects
Appearance
Size of this PNG preview of this SVG file: 748 × 505 pixels. Other resolutions: 320 × 216 pixels | 640 × 432 pixels | 1,024 × 691 pixels | 1,280 × 864 pixels | 2,560 × 1,728 pixels.
Original file (SVG file, nominally 748 × 505 pixels, file size: 232 KB)
This is a file from the Wikimedia Commons. Information from its description page there is shown below. Commons is a freely licensed media file repository. You can help. |
Summary
DescriptionSN 2002cx Spectra.svg |
English: Supernova 2002cx Spectra. It contains four spectra, one taken 2002-05-17 (Blue), one taken 2002-05-20 (Green), one taken 2002-06-02 (yellow) and one taken 2002-06-06 (red). Flux is normalized so that the area under each spectrum is 1000. Spectra are offset from 0 by an integer in order to separate them. The key lists the date the spectrum was taken. Wavelength is in angstroms. Some of the 2002-05-17 spectrum is obscured by the key, but it is relatively featureless there.
Data is from: Li, Weidong; Filippenko, Alexei V.; Chornock, Ryan et al. (04/2003). "SN 2002cx: The Most Peculiar Known Type Ia Supernova". Publications of the Astronomical Society of the Pacific 115 (806): 453-473. Chicago, Illinois: University of Chicago Press. DOI:10.1086/374200. Retrieved on 2009-06-19. |
||
Date | |||
Source | Own work | ||
Author | Falcorian | ||
Other versions | |||
SVG development InfoField | This plot was created with Matplotlib. | ||
Source code InfoField | Python code# coding: utf-8
from numpy import array
import matplotlib.pyplot as plt
import seaborn as sns
# Set plotting style
sns.set_style("ticks")
# Constants
labels = ['May 17', 'May 20', 'June 02', 'June 06']
files = [
"sn2002cx-20020517-fast.flm",
"sn2002cx-20020520-fast.flm",
"sn2002cx-20020602-fast.flm",
"sn2002cx-20020606-fast.flm",
]
def normalize_area(wavelengths, fluxes):
"""Takes a binned spectrum as two arrays and returns the flux normalized to
an area of 1000.
Args:
wavelengths (array): The wavelengths of the center of each bin of the
spectrum.
fluxes (array): The flux value for each bin.
Returns:
array: The flux values normalized to have a total area of 1000.
"""
desired_area = 1000
bin_width = wavelengths[1] - wavelengths[0]
area = sum(fluxes) * bin_width
normed_fluxes = (fluxes / area) * desired_area
return normed_fluxes
# Work on spectra
fig, ax = plt.subplots(figsize=(10, 6))
for i, file in enumerate(files):
offset = len(files) - i
# Open data
with open(file) as f:
cont = f.read()
cont = cont.splitlines()
# Process data
wavelengths = []
fluxes = []
for line in cont:
if line.startswith('#'):
continue
sline = line.split()
wavelengths.append(float(sline[0]))
fluxes.append(float(sline[1]))
# Normalize the area of the flux
fluxes = array(fluxes)
fluxes = normalize_area(wavelengths, fluxes)
fluxes = fluxes + offset
# Plot
plot = plt.plot(wavelengths, fluxes, label=labels[i])
text_y = 4.4 - i
ax.text(6900, text_y, labels[i], fontsize=20, color=plot[0].get_color())
# Remove y ticks
plt.ylim(.5, 5)
plt.yticks([])
sns.despine()
plt.xlabel(r'Wavelength (Å)', fontsize=18)
plt.ylabel('Normalized Flux + Offset', fontsize=18)
plt.title('SN 2002cx Spectra', fontsize=22)
plt.savefig("SN_2002cx_Spectra.svg", bbox_inches="tight")
plt.show()
|
Licensing
I, the copyright holder of this work, hereby publish it under the following licenses: This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International, 3.0 Unported, 2.5 Generic, 2.0 Generic and 1.0 Generic license.
You may select the license of your choice. |
|||
|
Items portrayed in this file
depicts
21 June 2009
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 03:42, 5 April 2018 | 748 × 505 (232 KB) | Falcorian | Update plot to be more readable, more aesthetic. | |
22:52, 21 June 2009 | 720 × 540 (262 KB) | Falcorian | Remove phase, not exactly correct because supernova frame is not exactly our frame. | ||
22:42, 21 June 2009 | 720 × 540 (265 KB) | Falcorian | == Summary == {{Information |Description={{en|1=Supernova 2002cx Spectra. It contains four spectra, one taken 2002-05-17 (Blue), one taken 2002-05-20 (Green), one taken 2002-06-02 (yellow) and one taken 2002-06-06 (red). Data is from: {{cite journal|last= |
File usage
The following 2 pages use this file:
Metadata
This file contains additional information, probably added from the digital camera or scanner used to create or digitize it.
If the file has been modified from its original state, some details may not fully reflect the modified file.
Width | 598pt |
---|---|
Height | 404pt |
Retrieved from "https://wiki.riteme.site/wiki/File:SN_2002cx_Spectra.svg"