generated from erosita/uds
submit
This commit is contained in:
BIN
Spectra/figures/Rplots.pdf
Normal file
BIN
Spectra/figures/Rplots.pdf
Normal file
Binary file not shown.
@@ -4,12 +4,11 @@
|
||||
# then split file to four parts as lecr1/2/3/4
|
||||
#
|
||||
|
||||
key="lecr"
|
||||
#key="pow"
|
||||
keymo="model2"
|
||||
|
||||
library(sfsmisc)
|
||||
|
||||
|
||||
up=1.0
|
||||
up=2.0
|
||||
#xgrid <- c(30,50,70,100);
|
||||
Emin=25.0
|
||||
Emax=180.0
|
||||
@@ -27,13 +26,24 @@ ylim <- c(0.2,2)
|
||||
|
||||
cl="black"
|
||||
a <- read.table('../cutoffpl_gc06_eeuf.dat', col.names=c("x","dx","y","dy","total","cutoffpl","pow"))
|
||||
plot(a$x, a$y, pch=3, bg="white", col="white", ylim=ylim, xlim=xlim,main="GC (cutoffpl+powerlaw)",ylab=expression("keV"^"2"~"(Phot. keV"^"-1"~"cm"^"-2"~"s"^"-1"*")"),type="p",xaxt = 'n',xlab="",log="xy")
|
||||
plot(a$x, a$y, pch=3, bg="white", col="white", ylim=ylim, xlim=xlim, ylab=expression("keV"^"2"~"(Phot. keV"^"-1"~"cm"^"-2"~"s"^"-1"*")"),type="p",xaxt = 'n',xlab="",log="xy")
|
||||
|
||||
#axis(side=2, at=c(1e-6,1e-5, 1e-4, 1e-3, 1e-2), labels=expression('-6','-5','-4','-3','-2'))
|
||||
|
||||
#abline(v=xgrid, col="lightgray", lty="dotted")
|
||||
grid()
|
||||
|
||||
###################################################################################
|
||||
##
|
||||
## Plot model components
|
||||
##
|
||||
###################################################################################
|
||||
|
||||
lines(a$x,a$cutoffpl,pch=1,bg=cl,col="blue")
|
||||
lines(a$x,a$pow,pch=1,bg=cl,col="red")
|
||||
lines(a$x,a$total,pch=1,bg=cl,col="black")
|
||||
|
||||
|
||||
#
|
||||
# Plot upper limits
|
||||
#
|
||||
@@ -54,26 +64,17 @@ pdy=a$dy[(a$y/a$dy)>=up]
|
||||
segments(px,py-pdy,px,py+pdy,col=cl)
|
||||
segments(px-pdx,py,px+pdx,py,col=cl)
|
||||
|
||||
#legend( 35.0,1e-2,c("FPMA","FPMB"), lty=c(1,1), lwd=c(2.5,2.5),col=c("black","red"),cex=1.7)
|
||||
|
||||
###################################################################################
|
||||
##
|
||||
## Plot model components
|
||||
##
|
||||
###################################################################################
|
||||
|
||||
lines(a$x,a$cutoffpl,pch=1,bg=cl,col="blue")
|
||||
lines(a$x,a$pow,pch=1,bg=cl,col="red")
|
||||
lines(a$x,a$total,pch=1,bg=cl,col="black")
|
||||
text(100, 1.5, "GB",cex=2.5)
|
||||
|
||||
###################################################################################
|
||||
|
||||
par(mar=c(4.5, leftx, 0.1, 1))
|
||||
ylim <- c(-2.5,2.5)
|
||||
ylim <- c(-3.1,3.1)
|
||||
|
||||
cl="black"
|
||||
a <- read.table("../cutoffpl_gc06_delchi.dat", col.names=c("x","dx","y","dy"))
|
||||
plot(a$x, a$y, pch=3, ylim=ylim, xlim=xlim, ylab=expression(Delta~chi), xlab="",type="p",log="x",xaxt = 'n')
|
||||
grid()
|
||||
segments(a$x,a$y-a$dy,a$x,a$y+a$dy,col=cl)
|
||||
segments(a$x-a$dx,a$y,a$x+a$dx,a$y,col=cl)
|
||||
|
||||
@@ -83,11 +84,15 @@ segments(a$x-a$dx,a$y,a$x+a$dx,a$y,col=cl)
|
||||
#dev.off()
|
||||
|
||||
#abline(v=xgrid, col="lightgray", lty="dotted")
|
||||
grid()
|
||||
abline(h=0, col = "black",lty=2)
|
||||
|
||||
mtext(side = 1, text = "Energy, keV", line = 4, cex=1.6)
|
||||
|
||||
axis(1, mgp=c(3, 1.5, 0))
|
||||
#axis(1, mgp=c(3, 1.5, 0))
|
||||
### Log axis using sfsmisc ###
|
||||
atx=c(8,30,50,80,100,150)
|
||||
eaxis(1, at = atx, labels = pretty10exp(atx, sub10=c(1,100), drop.1=TRUE), las=0)
|
||||
abline(v=atx, col="lightgray", lty="dotted")
|
||||
###
|
||||
|
||||
dev.off()
|
||||
|
@@ -4,12 +4,10 @@
|
||||
# then split file to four parts as lecr1/2/3/4
|
||||
#
|
||||
|
||||
key="lecr"
|
||||
#key="pow"
|
||||
keymo="model2"
|
||||
library(sfsmisc)
|
||||
|
||||
|
||||
up=1.0
|
||||
up=2.0
|
||||
#xgrid <- c(30,50,70,100);
|
||||
Emin=25.0
|
||||
Emax=180.0
|
||||
@@ -23,17 +21,28 @@ par(mar=c(0.1, leftx, 1, 1))
|
||||
par(cex.lab=1.6)
|
||||
par(cex.axis=1.6)
|
||||
xlim <- c(Emin,Emax)
|
||||
ylim <- c(0.1,1.5)
|
||||
ylim <- c(0.05,1.0)
|
||||
|
||||
cl="black"
|
||||
a <- read.table('../cutoffpl_lon+20_eeuf.dat', col.names=c("x","dx","y","dy","total","cutoffpl","pow"))
|
||||
plot(a$x, a$y, pch=3, bg="white", col="white", ylim=ylim, xlim=xlim,main="LON+20 (cutoffpl+powerlaw)",ylab=expression("keV"^"2"~"(Phot. keV"^"-1"~"cm"^"-2"~"s"^"-1"*")"),type="p",xaxt = 'n',xlab="",log="xy")
|
||||
plot(a$x, a$y, pch=3, bg="white", col="white", ylim=ylim, xlim=xlim,ylab=expression("keV"^"2"~"(Phot. keV"^"-1"~"cm"^"-2"~"s"^"-1"*")"),type="p",xaxt = 'n',xlab="",log="xy")
|
||||
|
||||
#axis(side=2, at=c(1e-6,1e-5, 1e-4, 1e-3, 1e-2), labels=expression('-6','-5','-4','-3','-2'))
|
||||
|
||||
#abline(v=xgrid, col="lightgray", lty="dotted")
|
||||
grid()
|
||||
|
||||
###################################################################################
|
||||
##
|
||||
## Plot model components
|
||||
##
|
||||
###################################################################################
|
||||
|
||||
lines(a$x,a$cutoffpl,pch=1,bg=cl,col="blue")
|
||||
lines(a$x,a$pow,pch=1,bg=cl,col="red")
|
||||
lines(a$x,a$total,pch=1,bg=cl,col="black")
|
||||
|
||||
|
||||
#
|
||||
# Plot upper limits
|
||||
#
|
||||
@@ -55,25 +64,18 @@ segments(px,py-pdy,px,py+pdy,col=cl)
|
||||
segments(px-pdx,py,px+pdx,py,col=cl)
|
||||
|
||||
#legend( 35.0,1e-2,c("FPMA","FPMB"), lty=c(1,1), lwd=c(2.5,2.5),col=c("black","red"),cex=1.7)
|
||||
text(100, 0.75, "L+20",cex=2.5)
|
||||
|
||||
###################################################################################
|
||||
##
|
||||
## Plot model components
|
||||
##
|
||||
###################################################################################
|
||||
|
||||
lines(a$x,a$cutoffpl,pch=1,bg=cl,col="blue")
|
||||
lines(a$x,a$pow,pch=1,bg=cl,col="red")
|
||||
lines(a$x,a$total,pch=1,bg=cl,col="black")
|
||||
|
||||
###################################################################################
|
||||
|
||||
par(mar=c(4.5, leftx, 0.1, 1))
|
||||
ylim <- c(-2.5,2.5)
|
||||
ylim <- c(-3.1,3.1)
|
||||
|
||||
cl="black"
|
||||
a <- read.table("../cutoffpl_lon+20_delchi.dat", col.names=c("x","dx","y","dy"))
|
||||
plot(a$x, a$y, pch=3, ylim=ylim, xlim=xlim, ylab=expression(Delta~chi), xlab="",type="p",log="x",xaxt = 'n')
|
||||
grid()
|
||||
segments(a$x,a$y-a$dy,a$x,a$y+a$dy,col=cl)
|
||||
segments(a$x-a$dx,a$y,a$x+a$dx,a$y,col=cl)
|
||||
|
||||
@@ -83,11 +85,15 @@ segments(a$x-a$dx,a$y,a$x+a$dx,a$y,col=cl)
|
||||
#dev.off()
|
||||
|
||||
#abline(v=xgrid, col="lightgray", lty="dotted")
|
||||
grid()
|
||||
abline(h=0, col = "black",lty=2)
|
||||
|
||||
mtext(side = 1, text = "Energy, keV", line = 4, cex=1.6)
|
||||
|
||||
axis(1, mgp=c(3, 1.5, 0))
|
||||
#axis(1, mgp=c(3, 1.5, 0))
|
||||
### Log axis using sfsmisc ###
|
||||
atx=c(8,30,50,80,100,150)
|
||||
eaxis(1, at = atx, labels = pretty10exp(atx, sub10=c(1,100), drop.1=TRUE), las=0)
|
||||
abline(v=atx, col="lightgray", lty="dotted")
|
||||
###
|
||||
|
||||
dev.off()
|
||||
|
@@ -4,12 +4,11 @@
|
||||
# then split file to four parts as lecr1/2/3/4
|
||||
#
|
||||
|
||||
key="lecr"
|
||||
#key="pow"
|
||||
keymo="model2"
|
||||
|
||||
library(sfsmisc)
|
||||
|
||||
|
||||
up=1.0
|
||||
up=2.0
|
||||
#xgrid <- c(30,50,70,100);
|
||||
Emin=25.0
|
||||
Emax=180.0
|
||||
@@ -23,16 +22,25 @@ par(mar=c(0.1, leftx, 1, 1))
|
||||
par(cex.lab=1.6)
|
||||
par(cex.axis=1.6)
|
||||
xlim <- c(Emin,Emax)
|
||||
ylim <- c(0.1,1)
|
||||
ylim <- c(0.05,1)
|
||||
|
||||
cl="black"
|
||||
a <- read.table('../cutoffpl_lon-20_eeuf.dat', col.names=c("x","dx","y","dy","total","cutoffpl","pow"))
|
||||
plot(a$x, a$y, pch=3, bg="white", col="white", ylim=ylim, xlim=xlim,main="LON-20 (cutoffpl+powerlaw)",ylab=expression("keV"^"2"~"(Phot. keV"^"-1"~"cm"^"-2"~"s"^"-1"*")"),type="p",xaxt = 'n',xlab="",log="xy")
|
||||
plot(a$x, a$y, pch=3, bg="white", col="white", ylim=ylim, xlim=xlim, ylab=expression("keV"^"2"~"(Phot. keV"^"-1"~"cm"^"-2"~"s"^"-1"*")"),type="p",xaxt = 'n',xlab="",log="xy")
|
||||
|
||||
#axis(side=2, at=c(1e-6,1e-5, 1e-4, 1e-3, 1e-2), labels=expression('-6','-5','-4','-3','-2'))
|
||||
|
||||
#abline(v=xgrid, col="lightgray", lty="dotted")
|
||||
grid()
|
||||
###################################################################################
|
||||
##
|
||||
## Plot model components
|
||||
##
|
||||
###################################################################################
|
||||
|
||||
lines(a$x,a$cutoffpl,pch=1,bg=cl,col="blue")
|
||||
lines(a$x,a$pow,pch=1,bg=cl,col="red")
|
||||
lines(a$x,a$total,pch=1,bg=cl,col="black")
|
||||
|
||||
#
|
||||
# Plot upper limits
|
||||
@@ -55,25 +63,18 @@ segments(px,py-pdy,px,py+pdy,col=cl)
|
||||
segments(px-pdx,py,px+pdx,py,col=cl)
|
||||
|
||||
#legend( 35.0,1e-2,c("FPMA","FPMB"), lty=c(1,1), lwd=c(2.5,2.5),col=c("black","red"),cex=1.7)
|
||||
text(100, 0.75, "L-20",cex=2.5)
|
||||
|
||||
###################################################################################
|
||||
##
|
||||
## Plot model components
|
||||
##
|
||||
###################################################################################
|
||||
|
||||
lines(a$x,a$cutoffpl,pch=1,bg=cl,col="blue")
|
||||
lines(a$x,a$pow,pch=1,bg=cl,col="red")
|
||||
lines(a$x,a$total,pch=1,bg=cl,col="black")
|
||||
|
||||
###################################################################################
|
||||
|
||||
par(mar=c(4.5, leftx, 0.1, 1))
|
||||
ylim <- c(-2.5,2.5)
|
||||
ylim <- c(-3.1, 3.1)
|
||||
|
||||
cl="black"
|
||||
a <- read.table("../cutoffpl_lon-20_delchi.dat", col.names=c("x","dx","y","dy"))
|
||||
plot(a$x, a$y, pch=3, ylim=ylim, xlim=xlim, ylab=expression(Delta~chi), xlab="",type="p",log="x",xaxt = 'n')
|
||||
grid()
|
||||
segments(a$x,a$y-a$dy,a$x,a$y+a$dy,col=cl)
|
||||
segments(a$x-a$dx,a$y,a$x+a$dx,a$y,col=cl)
|
||||
|
||||
@@ -83,11 +84,16 @@ segments(a$x-a$dx,a$y,a$x+a$dx,a$y,col=cl)
|
||||
#dev.off()
|
||||
|
||||
#abline(v=xgrid, col="lightgray", lty="dotted")
|
||||
grid()
|
||||
|
||||
abline(h=0, col = "black",lty=2)
|
||||
|
||||
mtext(side = 1, text = "Energy, keV", line = 4, cex=1.6)
|
||||
|
||||
axis(1, mgp=c(3, 1.5, 0))
|
||||
#axis(1, mgp=c(3, 1.5, 0))
|
||||
### Log axis using sfsmisc ###
|
||||
atx=c(8,30,50,80,100,150)
|
||||
eaxis(1, at = atx, labels = pretty10exp(atx, sub10=c(1,100), drop.1=TRUE), las=0)
|
||||
abline(v=atx, col="lightgray", lty="dotted")
|
||||
###
|
||||
|
||||
dev.off()
|
||||
|
24
Spectra/figures/flux.py
Executable file
24
Spectra/figures/flux.py
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__author__ = "Roman Krivonos"
|
||||
__copyright__ = "Space Research Institute (IKI)"
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from astropy.io import fits
|
||||
import matplotlib.pyplot as plt
|
||||
import math, sys, os
|
||||
import pickle
|
||||
|
||||
|
||||
|
||||
val=float(sys.argv[1])
|
||||
flux = np.power(10, val)/1e-10
|
||||
|
||||
val=float(sys.argv[2])
|
||||
flux_lo = np.power(10, val)/1e-10
|
||||
|
||||
val=float(sys.argv[3])
|
||||
flux_hi = np.power(10, val)/1e-10
|
||||
|
||||
print("{:.1f} -{:.1f} {:.1f}".format(flux,(flux-flux_lo),(flux_hi-flux)))
|
@@ -1,16 +1,18 @@
|
||||
#
|
||||
# 2 data sets
|
||||
# in Xspec make ipl->wdata
|
||||
# then split file to four parts as lecr1/2/3/4
|
||||
# then split file
|
||||
#
|
||||
|
||||
key="lecr"
|
||||
#key="pow"
|
||||
keymo="model2"
|
||||
|
||||
|
||||
library(sfsmisc)
|
||||
|
||||
|
||||
|
||||
|
||||
up=-10.0
|
||||
#xgrid <- c(30,50,70,100);
|
||||
|
||||
Emin=25.0
|
||||
Emax=180.0
|
||||
postscript('galplane.eps', horizontal = FALSE, onefile = FALSE, paper = "special",width = 9.0, height = 6.0)
|
||||
@@ -20,50 +22,52 @@ par(lwd=2)
|
||||
#layout(matrix(c(1,2), 2, 1, byrow = TRUE), heights = c(1.5,1), TRUE)
|
||||
|
||||
leftx=4.5
|
||||
par(mar=c(5., leftx, 0.1, 0.1))
|
||||
par(mar=c(4., leftx, 0.1, 0.1))
|
||||
par(cex.lab=1.6)
|
||||
par(cex.axis=1.6)
|
||||
xlim <- c(Emin,Emax)
|
||||
|
||||
cl="black"
|
||||
|
||||
sc=1000.0
|
||||
|
||||
ylim <- c(-0.005,0.09)
|
||||
ylim <- c(-0.005,0.09)*sc
|
||||
|
||||
a <- read.table("../galplane_bkg.dat", col.names=c("x","dx","y","dy"))
|
||||
b <- read.table("../galplane_gc06.dat", col.names=c("x","dx","y","dy"))
|
||||
c <- read.table("../galplane+20.dat", col.names=c("x","dx","y","dy"))
|
||||
d <- read.table("../galplane-20.dat", col.names=c("x","dx","y","dy"))
|
||||
a <- read.table("../galplane_1.dat", col.names=c("x","dx","y","dy"))
|
||||
b <- read.table("../galplane_3.dat", col.names=c("x","dx","y","dy"))
|
||||
c <- read.table("../galplane_2.dat", col.names=c("x","dx","y","dy"))
|
||||
d <- read.table("../galplane_4.dat", col.names=c("x","dx","y","dy"))
|
||||
|
||||
|
||||
plot(a$x, a$y, pch=3, ylim=ylim, xlim=xlim, ylab=expression("Crab keV"^"-1"~"FOV"^"-1"), xlab="",type="p",log="x",xaxt = 'n')
|
||||
plot(a$x, a$y*sc, pch=3, ylim=ylim, xlim=xlim, ylab=expression("mCrab keV"^"-1"~"FOV"^"-1"), xaxt="no",log="x",xlab="",type="p")
|
||||
|
||||
### Log axis using sfsmisc ###
|
||||
atx=c(8,30,50,80,100,150)
|
||||
eaxis(1, at = atx, labels = pretty10exp(atx, sub10=c(1,100), drop.1=TRUE), las=0)
|
||||
abline(v=atx, col="lightgray", lty="dotted")
|
||||
###
|
||||
|
||||
grid()
|
||||
|
||||
cl="red"
|
||||
segments(b$x,b$y-b$dy,b$x,b$y+b$dy,col=cl)
|
||||
segments(b$x-b$dx,b$y,b$x+b$dx,b$y,col=cl)
|
||||
segments(a$x,(a$y-a$dy)*sc,a$x,(a$y+a$dy)*sc,col=cl)
|
||||
segments(a$x-a$dx,(a$y)*sc,a$x+a$dx,a$y*sc,col=cl)
|
||||
|
||||
cl="black"
|
||||
segments(d$x,(d$y-d$dy)*sc,d$x,(d$y+d$dy)*sc,col=cl)
|
||||
segments(d$x-d$dx,(d$y)*sc,d$x+d$dx,d$y*sc,col=cl)
|
||||
|
||||
cl="blue"
|
||||
bias=1.01
|
||||
segments(c$x*bias,c$y-c$dy,c$x*bias,c$y+c$dy,col=cl)
|
||||
segments((c$x-c$dx)*bias,c$y,(c$x+c$dx)*bias,c$y,col=cl)
|
||||
segments(c$x*bias,(c$y-c$dy)*sc,c$x*bias,(c$y+c$dy)*sc,col=cl)
|
||||
segments((c$x-c$dx)*bias,c$y*sc,(c$x+c$dx)*bias,c$y*sc,col=cl)
|
||||
|
||||
cl="green"
|
||||
segments(d$x,d$y-d$dy,d$x,d$y+d$dy,col=cl)
|
||||
segments(d$x-d$dx,d$y,d$x+d$dx,d$y,col=cl)
|
||||
segments(b$x,(b$y-b$dy)*sc,b$x,(b$y+b$dy)*sc,col=cl)
|
||||
segments(b$x-b$dx,b$y*sc,b$x+b$dx,b$y*sc,col=cl)
|
||||
|
||||
# background
|
||||
cl="black"
|
||||
segments(a$x,a$y-a$dy,a$x,a$y+a$dy,col=cl)
|
||||
segments(a$x-a$dx,a$y,a$x+a$dx,a$y,col=cl)
|
||||
mtext(side = 1, text = "Energy, keV", line = 3, cex=1.6)
|
||||
|
||||
|
||||
mtext(side = 1, text = "Energy, keV", line = 4, cex=1.6)
|
||||
|
||||
legend( 85.0,0.08,c("GC","LON+20","LON-20","3C 273/Coma"), lty=c(1,1,1,1), lwd=c(2.5,2.5,2.5,2.5),col=c("red","blue","green","black"),cex=1.7)
|
||||
|
||||
|
||||
axis(1, mgp=c(3, 1.5, 0))
|
||||
legend( 85.0,0.09*sc,c("GB","L+20","L-20","3C 273/Coma"), lty=c(1,1,1,1), lwd=c(2.5,2.5,2.5,2.5),col=c("red","blue","green","black"),cex=1.7)
|
||||
|
||||
dev.off()
|
||||
|
32
Spectra/figures/test.r
Normal file
32
Spectra/figures/test.r
Normal file
@@ -0,0 +1,32 @@
|
||||
minor.ticks.axis <- function(ax,n,t.ratio=0.5,mn,mx,...){
|
||||
|
||||
lims <- par("usr")
|
||||
if(ax %in%c(1,3)) lims <- lims[1:2] else lims[3:4]
|
||||
|
||||
major.ticks <- pretty(lims,n=5)
|
||||
if(missing(mn)) mn <- min(major.ticks)
|
||||
if(missing(mx)) mx <- max(major.ticks)
|
||||
|
||||
major.ticks <- major.ticks[major.ticks >= mn & major.ticks <= mx]
|
||||
|
||||
labels <- sapply(major.ticks,function(i)
|
||||
as.expression(bquote(10^ .(i)))
|
||||
)
|
||||
axis(ax,at=major.ticks,labels=labels,...)
|
||||
|
||||
n <- n+2
|
||||
minors <- log10(pretty(10^major.ticks[1:2],n))-major.ticks[1]
|
||||
minors <- minors[-c(1,n)]
|
||||
|
||||
minor.ticks = c(outer(minors,major.ticks,`+`))
|
||||
minor.ticks <- minor.ticks[minor.ticks > mn & minor.ticks < mx]
|
||||
|
||||
|
||||
axis(ax,at=minor.ticks,tcl=par("tcl")*t.ratio,labels=FALSE)
|
||||
}
|
||||
|
||||
|
||||
x <- 10^(0:8)
|
||||
y <- 1:9
|
||||
plot(log10(x),y,xaxt="n",xlab="x",xlim=c(0,9))
|
||||
minor.ticks.axis(1,9,mn=0,mx=8)
|
Reference in New Issue
Block a user