Skip to content
Snippets Groups Projects
Commit e0e9b089 authored by Charlotte Hausman's avatar Charlotte Hausman
Browse files

Calibration capability

parent 5c2d207e
No related branches found
No related tags found
1 merge request!206Calibration capability
Pipeline #1469 waiting for manual action
Showing
with 648 additions and 0 deletions
""" Version information for this package, don't put anything else here. """
___version___ = '4.0.0a1.dev1'
"""
Auditor has one task: inspection of metadata.json and PPR.xml for required properties
"""
import logging
import os.path
from pathlib import Path
from typing import List
from bs4 import BeautifulSoup
import json
from casa_envoy.interfaces import AuditorIF
from workspaces.system.schema import AbstractFile
def get_fields_for(filename: str) -> list:
metadata_list = ["fileSetIds", "workflowName", "systemId", "productLocator", "destinationDirectory"]
ppr_list = ["RootDirectory", "RelativePath", "SdmIdentifier"]
if filename == "PPR.xml":
return ppr_list
if filename == "metadata.json":
return metadata_list
def get_value_for(filename:str, key:str) -> str:
if ".xml" in filename:
with open(filename) as file:
ppr_content = BeautifulSoup(file.read(), "xml")
return ppr_content.find(key).string
if ".json" in filename:
with open(filename) as file:
metadata = json.loads(file.read())
return metadata[key]
class AuditFiles(AuditorIF):
def __init__(self, files: List[str]):
self.files = files
self.logger = logging.getLogger("vela")
def read_file(self, filename: str) -> AbstractFile:
if os.path.isfile(filename):
with open(filename) as file:
if ".json" in filename:
metadata = json.loads(file.read())
return AbstractFile(filename, json.dumps(metadata).encode('ascii'))
else:
if filename == "PPR.xml":
ppr = file.read()
return AbstractFile(filename, ppr.encode('ascii'))
def check_required_fields(self, file: AbstractFile, fields: list) -> bool:
missing = []
if file.filename == "PPR.xml":
ppr_content = BeautifulSoup(file.content.decode(), "xml")
for tag in fields:
content = ppr_content.find(tag).string
if not content:
missing.append(tag)
if file.filename == "metadata.json":
for tag in fields:
metadata = json.loads(file.content.decode())
if tag not in metadata or len(metadata[tag]) == 0:
missing.append(tag)
if len(missing) > 0:
print(f"Missing fields: {missing}")
return False
else:
return True
def audit(self) -> bool:
invalid_files = []
for file in self.files:
f = self.read_file(file)
valid = self.check_required_fields(file=f, fields=get_fields_for(f.filename))
if not valid:
invalid_files.append(f.filename)
if len(invalid_files) != 0:
self.logger.info(f"INVALID FILE FOUND: {invalid_files}")
return False
else:
return True
class AuditDirectories(AuditorIF):
def __init__(self):
self.logger = logging.getLogger("vela")
self.rootDirectory = get_value_for("PPR.xml", "RootDirectory")
self.relative_path = get_value_for("PPR.xml", "RelativePath")
self.sdmId = get_value_for("PPR.xml", "SdmIdentifier")
def audit(self) -> bool:
current = os.getcwd()
needed = self.rootDirectory + "/" + self.relative_path
if needed != current:
self.logger.info("DIRECTORY ERROR: not in correct directory for processing.")
return False
else:
working = Path(current + "/working").is_dir()
products = Path(current + "/products").is_dir()
rawdata = Path(current + "/rawdata").is_dir()
if working and products and rawdata:
self.logger.info("Checking for rawdata...")
data = Path(current + "/rawdata/" + self.sdmId).is_dir()
if data:
self.logger.info("Data is available. Proceeding...")
return True
else:
self.logger.info("FAILURE: data not found in rawdata/")
return False
"""
Interfaces for casa_envoy
"""
from abc import ABC
class CasaLauncherIF(ABC):
"""
Generic CASA Launcher methods.
Should be implemented for any type of CASA processing.
"""
def run(self):
raise NotImplementedError
def setup_environment(self, parameters: dict):
raise NotImplementedError
def check_logs(self):
raise NotImplementedError
class AuditorIF(ABC):
"""
Generic functionality implementation for auditor classes
"""
def audit(self):
raise NotImplementedError
"""
palaver definition: an unnecessarily elaborate or complex procedure
(A.K.A. CASA in a nutshell - fight me)
"""
import argparse
import fileinput
import logging
import re
import subprocess
import glob
import json
from casa_envoy.auditor import AuditDirectories, AuditFiles
from casa_envoy.interfaces import CasaLauncherIF
from workspaces.system.schema import AbstractFile
from pycapo import CapoConfig
import sys
import os
"""
Launch CASA processing jobs via Workspaces
"""
logger = logging.getLogger("casa_envoy")
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler(sys.stdout))
class CalibrationLauncher(CasaLauncherIF):
def __init__(self, ppr: AbstractFile, metadata: AbstractFile):
self.ppr = ppr
self.metadata = metadata
def run(self):
logger.info("RUNNING CASA!")
subprocess.Popen("PYTHONPATH='' xvfb-run -e ${initialdir}/xvfb-run.err.txt -d -s \"-screen 0 800x600x16\" "
"${CASA_HOME}/bin/casa --pipeline --nogui --nologger -c "
"${CASA_HOME}/pipeline/pipeline/runvlapipeline.py ${PPR_FILENAME} || true",
shell=True, executable="/bin/bash")
def setup_environment(self, parameters: dict):
os.putenv("SCIPIPE_ROOTDIR", parameters["rootDirectory"])
os.putenv("CASA_HOME", parameters["homeForReprocessing"])
os.putenv("PPR_FILENAME", str(self.ppr.filename))
def check_logs(self):
logger.info("CHECKING CASA LOGS!")
casa_logs = glob.glob('casa-*.log')
for file in casa_logs:
if re.match("^.*SEVERE\sflagmanager.*$", open(file).read()):
logger.info("CASA ERROR!")
else:
logger.info("CASA Success!")
def _get_settings():
use_casa = CapoConfig().getboolean("edu.nrao.archive.workspaces.ProcessingSettings.useCasa")
root_dir = CapoConfig().settings("edu.nrao.archive.workspaces.ProcessingSettings").rootDirectory
casa_home = CapoConfig().settings("edu.nrao.archive.workflow.config.CasaVersions").homeForReprocessing
return {"useCasa": use_casa,"homeForReprocessing": casa_home, "rootDirectory": root_dir}
def parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(
description="Workspaces CASA processing launcher",
formatter_class=argparse.RawTextHelpFormatter
)
parser.add_argument(
"--standard-cal",
nargs=2,
action="store",
required=False,
help="run the standard calibration CASA pipeline"
)
return parser
def check_calibratable(metadata_filename):
with open(str(metadata_filename)) as json_meta:
metadata = json.loads(json_meta.read())
spl = metadata['productLocator']
if "execblock" in spl:
return True
else:
logger.info("SPL ERROR: This product locator is not calibratable!")
return False
def run_audit(ppr: str, metadata: str):
dir_audit = AuditDirectories().audit()
if dir_audit:
logger.info("Directory audit successful!")
else:
logger.info("FAILURE: directory structure audit was unsuccessful!")
audit = AuditFiles([ppr, metadata]).audit()
if audit:
logger.info("File audit successful!")
else:
logger.info("FAILURE: file audit was unsuccessful!")
def main():
args = parser().parse_args()
metadata = args.standard_cal[0]
ppr = args.standard_cal[1]
run_audit(ppr, metadata)
if check_calibratable(metadata):
settings = _get_settings()
if args.standard_cal:
if settings.get("useCasa"):
launcher = CalibrationLauncher(metadata, ppr)
launcher.setup_environment(settings)
launcher.run()
launcher.check_logs()
else:
logger.info("RUNNING VELA!")
subprocess.Popen(["vela", "--standard-cal", metadata, ppr])
else:
logger.info("TYPE ERROR: Provided SPL is not type execution block!")
#!/usr/bin/python
# -*- coding: utf-8 -*-
from pathlib import Path
from setuptools import setup, find_packages
VERSION = open("casa_envoy/_version.py").readlines()[-1].split()[-1].strip("\"'")
README = Path("README.md").read_text()
requires = [
"pycapo",
"bs4",
"lxml"
]
setup(
name="ssa-" + Path().absolute().name,
version=VERSION,
description="Workspaces CASA functionality bridge",
long_description=README,
author="NRAO SSA Team",
author_email="dms-ssa@nrao.edu",
url="TBD",
license="GPL",
install_requires=requires,
keywords=[],
packages=find_packages(),
classifiers=["Programming Language :: Python :: 3.8"],
entry_points={"console_scripts": ["casa_envoy = casa_envoy.palaver:main"]},
)
class TestAuditFiles:
def test_read_file(self):
pass
def test_check_required_fields(self):
pass
def test_audit(self):
pass
class TestAuditDirectories:
def test_audit(self):
pass
class TestCalibrationLauncher:
def test_run(self):
pass
def test_setup_environment(self):
pass
def check_logs(self):
pass
#Vela Testing System
Vela: The brightest radio pulsar visible in the sky.
The Vela system is meant for testing Workspaces workflows locally without submitting to CASA on the cluster.
Essentially, it's Fake CASA.
This system is intended to be extensible for testing all forms of CASA interactions that Workspaces will
expect to perform.
```
usage:
vela [--standard-cal, --standard-image] {metadata.json} {PPR.xml}
```
#!/usr/bin/python
# -*- coding: utf-8 -*-
from pathlib import Path
from setuptools import setup, find_packages
VERSION = open("vela/_version.py").readlines()[-1].split()[-1].strip("\"'")
README = Path("README.md").read_text()
requires = [
"pycapo",
"bs4",
"lxml"
]
setup(
name="ssa-" + Path().absolute().name,
version=VERSION,
description="Workspaces CASA functionality bridge",
long_description=README,
author="NRAO SSA Team",
author_email="dms-ssa@nrao.edu",
url="TBD",
license="GPL",
install_requires=requires,
keywords=[],
packages=find_packages(),
classifiers=["Programming Language :: Python :: 3.8"],
entry_points={"console_scripts": ["vela = vela.quasar:main"]},
)
class TestVelaLog:
def test_forge_logs(self):
pass
class TestVelaProduct:
def test_forge_cal_products(self):
pass
def test_read_metadata():
pass
def test_forged_content():
pass
class TestCalibrationEmulator:
def test_run(self):
pass
def test_setup_environment(self):
pass
def test_check_logs(self):
pass
""" Version information for this package, don't put anything else here. """
___version___ = '4.0.0a1.dev1'
"""
file names for CASA products and fake content for the file forger
This is seperated out to make the forger readable
"""
# def product_file_dict() -> dict:
# products = {"stdcal": [".ms.calapply.txt",
# ".ms.flagversions.tgz",
# "casa_commands.log",
# "casa_piperestorescript.py",
# "casa_pipescript.py",
# "flux.csv",
# "pipeline_aquareport.xml",
# "unknown.hifv_cal.auxproducts.tgz",
# "unknown.hifv_cal.pipeline_manifest.xml",
# "unknown.hifv_cal.pprequest.xml",
# "unknown.session_1.caltables.tgz"],
# "stdimage": []}
#
# return products
def file_content():
return """
From arXiv:0810.5359
Probing the Nature of the Vela X Cocoon
Stephanie M. LaMassa1, Patrick O. Slane2, & Okkie C. de Jager3,4 ABSTRACT
Vela X is a pulsar wind nebula (PWN) associated with the active pulsar B0833-45 and contained within the Vela supernova remnant (SNR). A collimated X-ray filament (“cocoon”) extends south-southwest from the pulsar to the center of Vela X. VLA observations uncovered radio emission coincident with the eastern edge of the cocoon and H.E.S.S. has detected TeV γ-ray emission from this region as well. Using XMM-Newton archival data, covering the southern portion of this feature, we analyze the X-ray properties of the cocoon. The X-ray data are best fit by an absorbed nonequilibrium plasma model with a powerlaw component. Our analysis of the thermal emission shows enhanced abundances of O, Ne, and Mg within the cocoon, indicating the presence of ejecta-rich material from the propagation of the SNR reverse shock, consistent with Vela X being a disrupted PWN. We investigate the physical processes that excite the electrons in the PWN to emit in the radio, X-ray and γ-ray bands. The radio and non-thermal X- ray emission can be explained by synchrotron emission. We model the γ-ray emission by Inverse Compton scattering of electrons off of cosmic microwave background (CMB) photons. We use a 3-component broken power law to model the synchrotron emission, finding an intrinsic break in the electron spectrum at ∼ 5 × 106 keV and a cooling break at ∼ 5.5 ×1010 keV. This cooling break along with a magnetic field strength of 5 ×10−6 G indicate that the synchrotron break occurs at ∼1 keV.
Subject headings: ISM: individual (Vela X) — pulsars: general — pulsars: indi- vidual(PSR B0833-45) — supernova remnants
1The Johns Hopkins University 2Harvard-Smithsonian Center for Astrophysics 3Unit for Space Physics, North-West University
4South African Department of Science & Technology and National Research Foundation Research Chair: Astrophysics & Space Science
arXiv:0810.5359v1 [astro-ph] 29 Oct 2008
–2–
1. Introduction
The Vela supernova remnant (SNR), at a distance of ∼ 290 pc (Dodson et al. 2003) is the closest SNR to contain an active pulsar, (PSR) B0833-45. The Vela pulsar has a period
̇
(P) of 89 ms and a period derivative (P) of 1.25 x 10 −13s s−1, implying an age of 11,000
̇
diameter and contains regions of nonthermal emission in the radio, X-ray and γ-ray bands, including Vela X, a pulsar wind nebula (PWN) spanning a region of 2◦ × 3◦ south-southwest of the pulsar. The center of Vela X is offset by about 40’ from the pulsar and emits in the radio, X-ray, and γ-ray bands (Frail et al. 1997; Aharonian et al. 2006).
ROSAT observations of the Vela SNR (Figure 1) reveal a collimated X-ray filament seen predominantly at higher energies extending from the pulsar to the center of Vela X, about
̈ ̈
45’ in length. Markwardt and Ogelman (hereafter MO) interpreted the ROSAT feature as
̈
an X-ray jet along which the pulsar loses energy (MO 1995). The “jet head”, or interaction
̈
between the jet and SNR shell, was later observed with ASCA by MO, and they found
the spectrum of this region to be best fit by a two component model, a lower temperature
thermal plasma model and a higher energy component, that could be fit by either a higher
̈ temperature plasma model or power-law emission (MO 1997).
An alternate explanation for the X-ray filament was proposed by Gvaramadze (1999)
who suggested that this feature represents a projection effect of a Rayleigh-Taylor instability,
which is caused by the impact of the SN ejecta with the wind-driven shell from the progen-
itor. Subsequent Chandra observations revealed an X-ray jet situated along the northwest-
southeast pulsar spin axis, coinciding with the pulsar proper motion and not overlapping the
̈
MO “jet” (Pavlov et al. 2001).
Though this collimated X-ray feature (hereafter “cocoon”) is no longer considered a
“jet,” it warrants further investigation. VLA observations reveal a bright radio filament
coincident with the eastern edge of this filament (Frail et al. 1997). H.E.S.S. observed TeV
γ-rays emanating from the ROSAT cocoon; Aharonian et al. 2006 use Inverse Compton
scattering to fit this H.E.S.S. spectral energy distribution (SED). Horns et al. 2006 attribute
the γ-ray emission from the cocoon to hadronic processes, which hinges on a thermal plasma ̈
Here we report on the analysis of XMM-Newton archival data from the interaction region of this filament with the SNR shell. In §2 we summarize the observations and data reduction techniques applied to the associated spectra. In §3 we describe our modeling of the X-ray spectrum, where we investigate the thermal and nonthermal emission observed from the cocoon. We investigate the broadband spectrum from this region in §4, using the results
36 −1 ◦ years and a spin-down luminosity (E) of 7×10 erg s . The remnant spans about 8 in
density of 0.6 cm−3, consistent with the previous findings of MO 1995 .
–3–
of our X-ray analysis along with spectral information from the radio and very high energy γ-ray bands. We consider these results in the context of a model in which the reverse shock from the Vela SNR has interacted with the PWN (Blondin, Chevalier, & Frierson 2001). We discuss our conclusions in §5.
2. Observations and Data Reduction
The “Vela jet head” was observed by XMM-Newton on May 2, 2005 for 22 ks with the MOS1 and MOS2 detectors and for 20 ks with the PN detector in Prime Full Window mode with the medium filter (PI Gallant, ObsID 0094630101). Data reduction was performed with the XMM Science Analysis System (SAS) to filter the data and remove flares. The good science time remaining after this processing is as follows: 22 ks for MOS1, 21.6 ks for MOS2, and 17.6 ks for PN.
The XMM field of view covers just the southernmost portion of the cocoon detected by ROSAT. The field of view for the PN detector is shown in Figure 2, with the source and background regions we analyzed overlaid. Spectra were extracted from roughly the same source and background regions among all 3 detectors, using the xmmselect gui. The response files were generated with the rmfgen and arfgen SAS tools.
We extracted background spectra from a region within the the SNR and the 2◦ x 3◦ radio PWN, but outside the cocoon (Figure 2). For comparison, we extracted a second set of background spectra from a region along the northwestern shell of the SNR using archival data from observations performed on 9 November 2001 (PI Turner, ObsID 0112690101). The latter region is centered at RA = 08:48:33 and Dec = -42:23:45, with a radius of 1.8′.
We applied the SAS tool evigweight to all spectra to correct for vignetting. To account for the unvignetted internal background, for both the source and background regions we subtracted similarly processed spectra taken from available blank sky fields 1, each weighted by a factor determined by the ratio of high-energy counts between the Vela and blank-sky spectra (see Arnaud et al. 2002).
The source region was also separated into upper and lower sections, as seen in Figure 2. Spectra were extracted separately from these areas to search for possible spectral changes with increasing distance from the pulsar.
1Blank sky files were taking in Prime Full Frame mode using the medium filter (M1.M.FF.EVLIRP.FIT, M2.M.FF.EVLIRP.FIT, and PN.M.FF.EVLIRA.FIT).
–4–
3. Spectral Analysis
We modeled the spectra in XSPEC and found that a two-component model was required
̈
to fit the entire source region, consistent with the findings of MO in 1997. Using an adjacent
background region, the data for the full region were best fit by an absorbed (NH ∼ 1.6 × 1020) nonequilibrium plasma model with a powerlaw component to accommodate the hard emis-
̈ sion, as shown in Figure 3. A very high temperature thermal component proposed by MO
(1997) can reproduce the observed hard emission in the XMM band, but given the observed emission from Vela X at energies in excess of 100 keV (Mangano et al. 2005), it appears clear that this component is nonthermal. The results of the plasma model with a powerlaw component are presented in the first column of Table 1. The modeling shows enhanced abundances of oxygen, neon, and magnesium, higher than abundances seen in the SNR as a whole, but consistent with abundances represented in ejecta fragments, most notably Vela Region D (Miceli et al. 2005). The temperature of ∼0.5 keV is also higher than that for most of the remnant, which ranges between 0.12 and 0.18 keV (Lu & Aschenbach 2000), but is consistent with temperatures of shocked ejecta fragments (Aschenbach et al. 1995). The hard component is best fit by a photon index of Γ of 2.30 ± 0.04, consistent with synchrotron emission from energetic particles injected by the pulsar.
We compare these results using a background region from within the northwestern rim of the SNR shell (Miceli et al. 2005). By subtracting this background region, the source spectra retains contribution from the PWN, but contributions from the background and SNR are removed. The best-fit parameters from this fit are shown in the second column of Table 1. The abundances are still elevated after subtracting out SNR emission, suggesting that high abundances are intrinsic to this portion of the cocoon.
Spectra were also extracted separately from the upper and lower regions of the portion
of the cocoon covered in this pointing, as shown in Figure 2, to investigate whether the
steepness of the power law spectrum changes with distance from the pulsar. The northern
portion covers the region about 22.6’ to 31.8’(∼2.0 pc) from the pulsar and the southern
portion extends from about 31.8’ to 42.1’ (∼3.7 pc) from the pulsar. To facilitate fitting the 20 10
spectra, NH was set to our best fit value of 1.6×10 and τ was set to 4.8×10 . A variation in the spectral index was found, with Γupper = 2.13 ± 0.03 and Γlower = 1.90 ± 0.02. Setting
̈
NH to the the value in the literature (2.26×1020, MO 1997) shows a similar trend, with
Γupper = 2.22±0.02 and Γlower = 1.99±0.01. The Γ values above indicate that the power-law spectrum does change with distance from the pulsar, but in the opposite manner expected, flattening at larger radii rather than steepening. Further observations along the length of the cocoon are needed to fully test whether this trend exists along the full filament or if this is a local phenomenon related to turbulent disruption of the PWN where crushing of the
–5–
cocoon against the PWN could cause adiabatic heating that hardens the spectrum.
4. Modeling
We have modeled the radio and X-ray emission as synchrotron radiation from energetic electrons within the cocoon, and the γ-ray emission as Inverse Compton emission from the scattering of the cosmic microwave background radiation off of the same electron popula- tion. The domain between the radio and X-ray energies is currently unexplored so we have interpolated between these two bandpasses. In order to reproduce the spectral index derived from the X-ray described above, the measured spectral indices in the radio band (with αR ranging from ∼ 0 to 0.38, where Sν ∝ ν−αR), and also the observed spectral shape of the TeV emission, we require an electron spectrum with multiple slopes. Treating the electron spectrum as a power law with a single break can adequately describe the X-ray and γ-ray spectra, but either under-predicts the radio emission by a significant factor, or requires a particle spectrum that leads to αr ∼ 0.7, much steeper than the measured values. To fit the entire spectrum, we thus consider a three-component power law:
d N  A 1 E − σ 1 : E ≤ E 1
= A2E−σ2 : E1 < E ≤ E2
dE  A3E−σ3 : E > E2
A1, A2, and A3 are the normalization factors and σ1, σ2, and σ3 are the indices of the electron distribution within each energy range. The photon spectra produced by the synchrotron and IC emission in νFν format are:
VE 4πD2
νFν (synch) =
νFν(IC) =
νPtot(ν, E),
pc
VE 2dnγ(ǫγ)
4πD2 pc
E , dt
where VE ∼ 1055 cm3 is the electron emission volume assuming a cylindrical volume with a radius of 10′.44 and length of 19′.5; here we have assumed a distance Dpc = 290 pc (Mangano et al. 2005). Ptot(ν,E) and dnγ(ǫγ)/dt are synchrotron and IC emissivities (Lazendic et al. 2004).
The VLA, H.E.S.S., and non-thermal components of the XMM spectra were plotted along with the flux model cited above. The VLA (Frail et al. 1997) and H.E.S.S. data
–6–
points were scaled to coincide with the XMM region size. The magnetic field strength, normalization, spectral index values, and break energy values were varied until we obtained a model that adequately described the data points, as shown in Figure 4; A2 and A3 were calculated by fixing A1 and requiring the flux to match at the endpoints of the broken power-law segments. The best-fit parameters from this fit are shown in Table 2.
A power law spectrum with multiple breaks has been used to describe the emission from a number of PWNe, most notably the Crab Nebula. The first break in the spectrum of the Vela X cocoon, at 5 × 106 keV, most likely corresponds to an intrinsic break. Several factors can contribute to this break; for the Crab nebula in particular, it has been posited that this break results from two distinct electron populations or from an elevated value of the magnetization parameter (Volpi et al. 2008). It has been suggested by de Jager (2007) that the radio-emitting and X-ray-emitting electrons from the entire PWN form distinct populations. We note that our constraints on both the maximum energy and the overall normalization of this low-energy component are somewhat weak, and do not rule out this possibility for the southern cocoon region.
The second break in the spectrum at 5.5×1010 keV is most likely a cooling break related
to the synchrotron lifetime of the electrons injected from the pulsar. For our analysis of
this segment of the Vela PWN, the magnetic field (5×10−6 G) and cutoff energy (5.5×1010
keV) corresponds to a critical frequency of 2.4×1017 Hz, or ∼1 keV, indicating that the
synchrotron break occurs in the X-ray band. This magnetic field strength and synchrotron
break are consistent with the values derived by de Jager, Slane & LaMassa (2008) which used
INTEGRAL, BeppoSAX, and H.E.S.S. observations of the full Vela X region to constrain a
model of a postshock injection spectrum. In this case, the electron spectra are produced by
solving the time dependent transport equation with synchrotron losses. Integration of the
non-thermal electron spectrum from this region of the cocoon gives an energy of ∼ 7.7 × ̇
5. Discussion and Conclusions
If the ambient medium into which a SNR expands is inhomogeneous, simulations show that the SNR will expand asymmetrically, resulting in a reverse shock that subsequently crushes the PWN asymmetrically (Blondin Chevalier & Frierson 2001). The Vela radio neb- ula extends southward of the pulsar, possibly suggesting that the northern portion has been disturbed by such an interaction with the SNR reverse shock. In such a scenario, simulations show that ejecta-rich material can be turbulently mixed into the PWN from the reverse shock
1045 erg, which is about 0.3% of the energy input from the pulsar (E ≈ E ×τc ∼ 2.31 × 1048 erg, where τc is the characteristic age of the pulsar).
–7–
interaction (Blondin Chevalier & Frierson 2001). This is consistent with our observation of enhanced abundances of O, Ne, and Mg in the cocoon, similar to the observed abundances of ejecta fragments in Vela (e.g. Vela Region D, Miceli et al. 2005), providing support for the disrupted PWN interpretation.
Our modeling of the non-thermal emission from this segment of the cocoon indicates that a leptonic model adequately describes the data, with the radio and X-ray emission resulting from synchrotron radiation and the γ-ray emission arising from inverse-Compton scattering. We need a 3-component broken power law model to adequately fit the data, unless we ignore the radio flux and spectral index values for Vela X. The high energy break, at 5.5×1010 keV, and derived magnetic field of 5×10−6 G, correspond to a break in the synchrotron spectrum at ∼1 keV and are consistent with the findings of de Jager, Slane & LaMassa (2008) which obtained obtain the same field strength and synchrotron break using a different approach. The single break model to the X-ray and γ-ray data, which could be applicable if a separate electron population produces the radio emission, results in a comparable magnetic field strength (4.6×10−6 G) and cooling break energy (5.5×1010 keV).
Horns et al. (2006) propose a hadronic model for the γ-ray emission from the Vela X cocoon, wherein the emission is the result of the decay of neutral pions produced in proton- proton collisions in the cocoon. This model requires a number density of n > 0.6 cm−3 for the target material. However, the density of thermal emission from our observations is only ∼0.09 cm−3, which is too low to accommodate the hadronic scenario. Moreover, we have considered an electron/ion number density ratio consistent with cosmic abundances; the presence of ejecta will increase this ratio, further reducing the derived gas density. Our observation only covers the southernmost portion of the cocoon, so perhaps a higher density is present along the northern parts. More X-ray observations of Vela X are needed to determine whether or not the γ-ray emission from hadronic processes are feasible for other regions of the PWN.
PO Slane acknowledges support from NASA contract NAS8-03060.
REFERENCES
Aharonian, F., et al. 2006, A&A, 448L, 43A
Arnaud, M. et al. 2001, A&A, 365L, 80
Aschenbach, B., Egger, R., & Trumper J. 1995, Nature, 373, 587
–8–
Blondin, J. M., Chevlier, R. A., & Frierson, D. M. 2001, ApJ, 563, 806 de Jager, O. C. 2007, ApJ, 658, 1177
de Jager, O. C., Slane, P. O., & LaMassa, S. 2008, in press
Dodson, R. et al. 2003, ApJ, 596, 1137
Frail, D. A. et al. 1997, ApJ, 475, 224 Gvaramadze, Vasilii 1999, A&A, 352, 712
Horns, D. et al. 2006, A&A, 451, L51
Lazendic, J. S et al. 2004, ApJ, 602, 271
Lu, F. J., & Aschenbach, B. 2000, A&A, 362, 1083 Mangano, V. et al. 2005, A&A, 436, 917
̈
Markwardt, C. B. & Ogelman, H. B. 1995, Nature, 375, 40M
̈
Markwardt, C. B. & Ogelman, H. B. 1997, ApJ, 480, L13
Micel, M., Bocchino, F., Maggio, A., & Reale, F. 2005 A&A, 442, 513 Pavlov, G. G. et al. 2001, ApJ, 554, L189
Volpi, D., Del Zanna, L., Amato, E., & Bucciantini, N. arXiv:0804.1323v1
"""
"""
Forger has two tasks: faking CASA logs and faking CASA products
"""
import logging
import os
import json
import pendulum.date
import vela.content.forger_content as content
class VelaLog:
def __init__(self, metadata: str):
self.logger = logging.getLogger("vela")
self.metadata = metadata
def forge_logs(self, parameters: dict):
# forging three files. 2 for pipeline completion, 1 log file
# vela-pipeline.sh.out.txt
# vela-pipeline.sh.err.txt
# vela-<date_as_string>-<timestring>.log
path = parameters["destinationDirectory"] + "/working"
os.chdir(path)
# make log files
pipe_out = open("vela-pipeline.sh.out.txt", "x")
pipe_out.write(forged_content())
pipe_out.close()
pipe_err = open("vela-pipeline.sh.err.txt", "x")
pipe_err.write(forged_content())
pipe_err.close()
datestring = pendulum.now().format('YYYYMMDD')
timestring = pendulum.now().utcnow().format("hhmmss")
log = open(f"vela-{datestring}-{timestring}.txt", "w")
log.write(forged_content())
log.close()
self.logger.info("Logs forging complete.")
class VelaProduct:
def __init__(self, metadata: str):
self.logger = logging.getLogger("vela")
self.metadata = metadata
def forge_cal_products(self, parameters: dict):
# forge products so there is something to test delivery with
path = parameters["destinationDirectory"] + "/products"
os.chdir(path)
sdm_id = parameters["fileSetIds"]
filename = sdm_id + ".ms.calapply.txt"
calapply = open(filename, "x")
calapply.write("I am a calibration file.")
calapply.close()
self.logger.info("Forging products complete.")
def read_metadata(filename: str) -> dict:
with open(filename) as file:
return json.loads(file.read())
def forged_content() -> str:
return content.file_content()
# write fake logs and products
def forge(metadata: str):
parameters = read_metadata(metadata)
fake_logs = VelaLog(metadata)
fake_logs.forge_logs(parameters)
fake_products = VelaProduct(metadata)
fake_products.forge_cal_products(parameters)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment