File:SN 2002cx Spectra log.svg
Page contents not supported in other languages.
Appearance

Size of this PNG preview of this SVG file: 749 × 505 pixels. Other resolutions: 320 × 216 pixels | 640 × 432 pixels | 1,024 × 690 pixels | 1,280 × 863 pixels | 2,560 × 1,726 pixels.
Original file (SVG file, nominally 749 × 505 pixels, file size: 234 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 log.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, and then ploted as log(flux). 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.
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, log
import matplotlib.pyplot as plt
import seaborn as sns
# Set plotting style
sns.set_style("ticks")
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) * 3
# 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 = log(normalize_area(wavelengths, fluxes))
fluxes = fluxes + offset
# Plot
plot = plt.plot(wavelengths, fluxes, label=labels[i])
text_y = 10.8 - (2.9 * i)
ax.text(6900, text_y, labels[i], fontsize=20, color=plot[0].get_color())
# Remove y ticks
plt.yticks([])
sns.despine()
plt.xlabel(r'Wavelength (Å)', fontsize=18)
plt.ylabel('Normalized Log(Flux) + Offset', fontsize=18)
plt.title('SN 2002cx Spectra', fontsize=22)
plt.savefig("SN_2002cx_Spectra_log.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. |
|||
|
Captions
Add a one-line explanation of what this file represents
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:58, 5 April 2018 | ![]() | 749 × 505 (234 KB) | Falcorian | Update plot to be more readable, more aesthetic. |
03:14, 22 June 2009 | ![]() | 720 × 540 (258 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). Flux is normalized so that the are |
File usage
No pages on the English Wikipedia use this file (pages on other projects are not listed).
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 | 599pt |
---|---|
Height | 404pt |
Retrieved from "https://en.wikipedia.org/wiki/File:SN_2002cx_Spectra_log.svg"