Commit 031ff30e authored by xin's avatar xin
Browse files

init

parents
File added
This diff is collapsed.
from .SpecDisperser import *
from .disperse_c import disperse, interp
\ No newline at end of file
#!/usr/bin/env python
# encoding: utf-8
"""
Cython
"""
from . import disperse
from . import interp
#from .disperse import *
#from .interp import *
from __future__ import division
import numpy as np
cimport numpy as np
DTYPE = np.double
ITYPE = np.int64
ctypedef np.double_t DTYPE_t
ctypedef np.uint_t UINT_t
ctypedef np.int_t INT_t
ctypedef np.int64_t LINT_t
ctypedef np.int32_t FINT_t
ctypedef np.float32_t FTYPE_t
import cython
cdef extern from "math.h":
double sqrt(double x)
double exp(double x)
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.embedsignature(True)
def disperse_grism_object(np.ndarray[FTYPE_t, ndim=2] flam,
np.ndarray[LINT_t, ndim=1] idxl,
np.ndarray[DTYPE_t, ndim=1] yfrac,
np.ndarray[DTYPE_t, ndim=1] ysens,
np.ndarray[DTYPE_t, ndim=1] full,
np.ndarray[LINT_t, ndim=1] x0,
np.ndarray[LINT_t, ndim=1] shd,
np.ndarray[LINT_t, ndim=1] shg):
"""Compute a dispersed 2D spectrum
Parameters
----------
flam : direct image matrix, 2 dim [y,x]
idxl: grating disperse light to pixel, pixel index, 1 dim, length = ysens, yfrac
yfrac:
ysense: sensitivity use pixel describe
full: output result ,1 dim, y_beam * x_beam
x0: the center of gal in image thumbnail
shd: shape of direct image
shg: shape of grating image
"""
cdef int i,j,k1,k2
cdef unsigned int nk,nl,k,shx,shy
cdef double fl_ij
nk = len(idxl)
nl = len(full)
for i in range(0-x0[1], x0[1]):
if (x0[1]+i < 0) | (x0[1]+i >= shd[1]):
continue
for j in range(0-x0[0], x0[0]):
if (x0[0]+j < 0) | (x0[0]+j >= shd[0]):
continue
fl_ij = flam[x0[0]+j, x0[1]+i] #/1.e-17
if (fl_ij == 0):
continue
for k in range(nk):
k1 = idxl[k]+j*shg[1]+i
if (k1 >= 0) & (k1 < nl):
full[k1] += ysens[k]*fl_ij*yfrac[k]
k2 = idxl[k]+(j-1)*shg[1]+i
if (k2 >= 0) & (k2 < nl):
full[k2] += ysens[k]*fl_ij*(1-yfrac[k])
return True
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.embedsignature(True)
def compute_segmentation_limits(np.ndarray[FTYPE_t, ndim=2] segm, int seg_id, np.ndarray[FTYPE_t, ndim=2] flam, np.ndarray[LINT_t, ndim=1] shd):
"""Find pixel limits of a segmentation region
Parameters
----------
segm: ndarray (np.float32)
segmentation array
seg_id: int
ID to test
flam: ndarray (float)
Flux array to compute weighted centroid within segmentation region
shd: [int, int]
Shape of segm
"""
cdef int i, j, imin, imax, jmin, jmax, area
cdef double inumer, jnumer, denom, wht_ij
area = 0
imin = shd[0]
imax = 0
jmin = shd[1]
jmax = 0
inumer = 0.
jnumer = 0.
denom = 0.
for i in range(shd[0]):
for j in range(shd[1]):
if segm[i,j] != seg_id:
continue
area += 1
wht_ij = flam[i,j]
inumer += i*wht_ij
jnumer += j*wht_ij
denom += wht_ij
if i < imin:
imin = i
if i > imax:
imax = i
if j < jmin:
jmin = j
if j > jmax:
jmax = j
### No matched pixels
if denom == 0:
denom = -99
return imin, imax, inumer/denom, jmin, jmax, jnumer/denom, area, denom
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.embedsignature(True)
def seg_flux(np.ndarray[FTYPE_t, ndim=2] flam, np.ndarray[LINT_t, ndim=1] idxl, np.ndarray[DTYPE_t, ndim=1] yfrac, np.ndarray[DTYPE_t, ndim=1] ysens, np.ndarray[DTYPE_t, ndim=1] full, np.ndarray[LINT_t, ndim=1] x0, np.ndarray[LINT_t, ndim=1] shd, np.ndarray[LINT_t, ndim=1] shg):
pass
"""
Pythonic utilities ported to C [Cython] for speedup.
"""
import numpy as np
cimport numpy as np
DTYPE = np.double
ctypedef np.double_t DTYPE_t
ctypedef np.int_t ITYPE_t
ctypedef np.uint_t UINT_t
import cython
cdef extern from "math.h":
double fabs(double)
cdef extern from"stdio.h":
extern int printf(const char *format, ...)
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.cdivision(True)
@cython.embedsignature(True)
def interp_c(np.ndarray[DTYPE_t, ndim=1] x, np.ndarray[DTYPE_t, ndim=1] xp, np.ndarray[DTYPE_t, ndim=1] fp, double extrapolate=0., short int assume_sorted=1):
"""
interp_c(x, xp, fp, extrapolate=0., assume_sorted=0)
Fast interpolation: [`xp`, `fp`] interpolated at `x`.
Extrapolated values are set to `extrapolate`.
The default `assume_sorted`=1 assumes that the `x` array is sorted and single-
valued, providing a significant gain in speed. (xp is always assumed to be sorted)
"""
cdef unsigned long i, j, N, Np
cdef DTYPE_t x1,x2,y1,y2,out
cdef DTYPE_t fout, xval, xmin
N, Np = len(x), len(xp)
cdef np.ndarray[DTYPE_t, ndim=1] f = np.zeros(N)
i=0
j=0
### Handle left extrapolation
xmin = xp[0]
if assume_sorted == 1:
while x[j] < xmin:
f[j] = extrapolate
j+=1
if j>=N:
break
while j < N:
xval = x[j]
if assume_sorted == 0:
if x[j] < xmin:
f[j] = extrapolate
j+=1
continue
else:
i=0
while (xp[i] <= xval) & (i < Np-1): i+=1;
if i == (Np-1):
if x[j] != xp[i]:
f[j] = extrapolate
else:
f[j] = fp[i]
j+=1
continue
#### x[i] is now greater than xval because the
#### expression (x[i]<xval) is false, assuming
#### that xval < max(x).
# x1 = xp[i];
# x2 = xp[i+1];
# y1 = fp[i];
# y2 = fp[i+1];
x1 = xp[i-1];
x2 = xp[i];
y1 = fp[i-1];
y2 = fp[i];
out = ((y2-y1)/(x2-x1))*(xval-x1)+y1;
f[j] = out
j+=1
return f
@cython.boundscheck(False)
def interp_conserve_c(np.ndarray[DTYPE_t, ndim=1] x, np.ndarray[DTYPE_t, ndim=1] tlam, np.ndarray[DTYPE_t, ndim=1] tf, double left=0, double right=0, double integrate=0):
"""
interp_conserve_c(x, xp, fp, left=0, right=0, integrate=0)
Interpolate `xp`,`yp` array to the output x array, conserving flux.
`xp` can be irregularly spaced.
"""
cdef np.ndarray[DTYPE_t, ndim=1] templmid
cdef np.ndarray[DTYPE_t, ndim=1] tempfmid
cdef np.ndarray[DTYPE_t, ndim=1] outy
cdef unsigned long i,k,istart,ntlam,NTEMPL
cdef DTYPE_t h, numsum
# templmid = (x[1:]+x[:-1])/2. #2.+x[:-1]
# templmid = np.append(templmid, np.array([x[0], x[-1]]))
# templmid = templmid[np.argsort(templmid)]
NTEMPL = len(x)
ntlam = len(tlam)
templmid = midpoint_c(x, NTEMPL)
#tempfmid = np.interp(templmid, tlam, tf, left=left, right=right)
tempfmid = interp_c(templmid, tlam, tf, extrapolate=0.)
outy = np.zeros(NTEMPL, dtype=DTYPE)
###### Rebin template grid to master wavelength grid, conserving template flux
i=0
k=0
while templmid[k] < tlam[0]:
outy[k] = left
k+=1
if k >NTEMPL-1:
break
if(k>0) & (templmid[k-1] < tlam[0]) & (templmid[k] > tlam[0]):
m = 1;
numsum=0.;
while (tlam[m] < templmid[k]):
h = tlam[m]-tlam[m-1];
numsum+=h*(tf[m]+tf[m-1]);
m+=1;
if m >= ntlam:
break;
#print 'test #%d, %d' %(m, ntlam)
if m == 1:
h = templmid[k]-tlam[0];
numsum+=h*(tempfmid[k]+tf[0]);
else:
##### Last point
if m < ntlam:
if (templmid[k] == tlam[m]):
h = tlam[m]-tlam[m-1];
numsum+=h*(tf[m]+tf[m-1]);
else:
m-=1;
h = templmid[k]-tlam[m];
numsum+=h*(tempfmid[k]+tf[m]);
outy[k-1] = numsum*0.5;#/(templmid[k+1]-templmid[k]);
if integrate == 0.:
outy[k-1] /= (templmid[k]-templmid[k-1]);
for k in range(k, NTEMPL):
if templmid[k] > tlam[ntlam-1]:
break
numsum=0.;
#### Go to where tlam is greater than the first midpoint
while (tlam[i] < templmid[k]) & (i < ntlam): i+=1;
istart=i;
####### First point
if tlam[i] < templmid[k+1]:
h = tlam[i]-templmid[k];
numsum+=h*(tf[i]+tempfmid[k]);
i+=1;
if i==0: i+=1;
####### Template points between master grid points
while (tlam[i] < templmid[k+1]) & (i < ntlam):
h = tlam[i]-tlam[i-1];
numsum+=h*(tf[i]+tf[i-1]);
i+=1;
#### If no template points between master grid points, then just use interpolated midpoints
if i == istart:
h = templmid[k+1]-templmid[k];
numsum=h*(tempfmid[k+1]+tempfmid[k]);
else:
##### Last point
if (templmid[k+1] == tlam[i]) & (i < ntlam):
h = tlam[i]-tlam[i-1];
numsum+=h*(tf[i]+tf[i-1]);
else:
i-=1;
h = templmid[k+1]-tlam[i];
numsum+=h*(tempfmid[k+1]+tf[i]);
outy[k] = numsum*0.5;#/(templmid[k+1]-templmid[k]);
if integrate == 0.:
outy[k] /= (templmid[k+1]-templmid[k]);
return outy
def midpoint(x):
mp = (x[1:]+x[:-1])/2.
mp = np.append(mp, np.array([x[0],x[-1]]))
mp = mp[np.argsort(mp)]
return mp
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.cdivision(True)
@cython.embedsignature(True)
def midpoint_c(np.ndarray[DTYPE_t, ndim=1] x, long N):
cdef long i
cdef DTYPE_t xi,xi1
# N = len(x)
cdef np.ndarray[DTYPE_t, ndim=1] midpoint = np.zeros(N+1, dtype=DTYPE)
midpoint[0] = x[0]
midpoint[N] = x[N-1]
xi1 = x[0]
for i in range(1, N):
xi = x[i]
midpoint[i] = 0.5*xi+0.5*xi1
xi1 = xi
midpoint[0] = 2*x[0]-midpoint[1]
midpoint[N] = 2*x[N-1]-midpoint[N-1]
return midpoint
'''
Author: zx
Date: 2021-04-08 13:49:35
LastEditTime: 2022-05-17 09:36:01
LastEditors: xin zhangxinbjfu@gmail.com
Description: In User Settings Edit
FilePath: /undefined/Users/zhangxin/Work/SlitlessSim/sls_lit_demo/simDemo.py
'''
class Config(object):
def __init__(self, dataDir = '/data/'):
self.conFiles = {'GU': dataDir + 'conf/CSST_GU2.conf', 'GV': dataDir + 'conf/CSST_GV2.conf', 'GI': dataDir + 'conf/CSST_GI2.conf'}
self.thrFisle = {'GU': dataDir + 'conf/GU.Throughput', 'GV': dataDir + 'conf/GV.Throughput', 'GI': dataDir + 'conf/GI.Throughput'}
self.senFisle = {'GU': dataDir + 'conf/CSST_GU.sensitivity', 'GV': dataDir + 'conf/CSST_GV.sensitivity', 'GI': dataDir + 'conf/CSST_GI.sensitivity'}
self.orderIDs = {'A': '1st', 'B': '0st', 'C': '2st', 'D': '-1st', 'E': '-2st'}
self.bandRanges = {'GU':[2550, 4000], 'GV': [4000,6200], 'GI': [6200, 10000]}
'''
Author: zx
Date: 2021-04-08 13:49:35
LastEditTime: 2022-05-20 08:47:49
LastEditors: xin zhangxinbjfu@gmail.com
Description: In User Settings Edit
FilePath: /undefined/Users/zhangxin/Work/SlitlessSim/sls_lit_demo/simDemo.py
'''
import galsim
import SpecDisperser
# from numpy import *
import numpy as np
from scipy import interpolate
import astropy.constants as acon
from astropy.table import Table
import math
from astropy.io import fits
import random
from astropy.table import Table
import matplotlib.pyplot as plt
import mpi4py.MPI as MPI
import os,sys
from . import Config
class SpecGenerator(object):
def __init__(self,sedFn = 'a.txt', grating = 'GI', beam = 'A', aper = 2.0, xcenter = 5000,ycenter = 5000, p_size = 0.074, psf = None, skybg = 0.3, dark = 0.02, readout = 5, t = 150, expNum = 1, config = None):
self.sedFile = sedFn
self.grating = grating
self.beam = beam
self.aper = aper
self.xcenter = xcenter
self.ycenter = ycenter
self.p_size = p_size
self.psf = psf
self.skybg = skybg
self.dark = dark
self.readout = readout
self.t = t
self.expNum = expNum
self.config = config
'''
@description:
@param {*} fn: file name, include 2 column, wavelength(A) and flux(erg/s/cm2/A)
@param {*} s: band start , unit A
@param {*} e; end, unit A
@param {*} deltL: sample interval for SED
@return {*} sed, unit photo/s/m2/A
'''
def generateSEDfromFiles(self, fn, s, e, deltL):
"""
s: lambda start, unit A
e: lambda end, unit A
return:
SEDs is array, 2-dim, (gal_num+1)*(wavelength size), last row is wavelength
"""
lamb = np.arange(s, e + deltL, deltL)
spec_orig = np.loadtxt(fn)
speci = interpolate.interp1d(spec_orig[:, 0], spec_orig[:, 1])
y = speci(lamb)
# erg/s/cm2/A --> photo/s/m2/A
flux = y * lamb / (acon.h.value * acon.c.value) * 1e-13
SED = Table(np.array([lamb, flux]).T,names=('WAVELENGTH', 'FLUX'))
return SED
def generateSpec1dforGal(self, s_n = 1.0, re = 1, pa = 90,q_ell = 0.6,limitfluxratio=0.9):
specConfile = self.config.conFiles[self.grating]
throughput_f = self.config.senFisle[self.grating] + '.' + self.config.orderIDs[self.beam] + '.fits'
sed = self.generateSEDfromFiles(self.sedFile,2000,10000,0.5)
# print(skybg)
# print(specConfile)
# print(throughput_f)
# plt.figure()
# plt.plot(sed['WAVELENGTH'], sed['FLUX'])
gal = galsim.Sersic(s_n, half_light_radius=re)
gal_pa = pa * galsim.degrees
gal_ell = gal.shear(q=q_ell, beta=gal_pa)
conv_gal = galsim.Convolve([gal_ell,self.psf])
stamp = conv_gal.drawImage(wcs=galsim.PixelScale(self.p_size))*self.t*self.expNum*math.pi*(self.aper/2)*(self.aper/2)
origin_star = [self.ycenter - (stamp.center.y - stamp.ymin),
self.xcenter - (stamp.center.x - stamp.xmin)]
sdp = SpecDisperser.SpecDisperser(orig_img=stamp, xcenter=self.xcenter,
ycenter=self.ycenter, origin=origin_star,
tar_spec=sed,
conf=specConfile,
isAlongY=0)
spec_orders = sdp.compute_spec_orders()
thp = Table.read(throughput_f)
thp_i = interpolate.interp1d(thp['WAVELENGTH'], thp['SENSITIVITY'])
Aimg_orig = spec_orders[self.beam][0]
Aimg = Aimg_orig
Aimg = Aimg + (self.skybg + self.dark)*self.t*self.expNum
Aimg = np.random.poisson(Aimg)
for i in np.arange(self.expNum):
Aimg = self.addReadoutNois(img = Aimg, readout = self.readout)
Aimg = Aimg - (self.skybg + self.dark)*self.t*self.expNum
wave_pix = spec_orders[self.beam][5]
wave_pos = spec_orders[self.beam][3]
wave_pos_y=spec_orders[self.beam][4]
sh = Aimg.shape
spec_pix = np.zeros(sh[1])
err2_pix = np.zeros(sh[1])
# print(spec_orders[beamOrder][4])
# print(sh)
# plt.figure()
# plt.imshow(Aimg)
y_cent_pos = int(np.round(np.mean(wave_pos_y)))
tFlux = np.sum(spec_orders[self.beam][0])
# print(tFlux)
fluxRatio = 0
for i in range(int(sh[0]/2)):
pFlux = np.sum(spec_orders[self.beam][0][y_cent_pos-i:y_cent_pos+i+1])
fluxRatio = pFlux/tFlux
if fluxRatio>limitfluxratio:
break
y_range = i
# print(y_range, fluxRatio)
y_len_pix = 2 * y_range + 1
for i in range(sh[1]):
spec_pix[i] = sum(Aimg[y_cent_pos-y_range:y_cent_pos+y_range+1, i])
err2_pix[i] = sum(Aimg_orig[y_cent_pos-y_range:y_cent_pos+y_range+1, i]) + (self.skybg + self.dark)*self.t * y_len_pix * self.expNum + self.readout*self.readout * y_len_pix * self.expNum
bRange = self.config.bandRanges[self.grating]
wave_flux = np.zeros(wave_pix.shape[0])
err_flux = np.zeros(wave_pix.shape[0])
for i in np.arange(1, wave_pix.shape[0] - 1):
w = wave_pix[i]
if (bRange[0] <= w <= bRange[1]):
thp_w = thp_i(w)
deltW = (w - wave_pix[i - 1]) / 2 + (wave_pix[i + 1] - w) / 2
f = spec_pix[wave_pos[0] - 1 + i]
f = f / t / thp_w / deltW /self.expNum
err = err2_pix[wave_pos[0] - 1 + i]
# err = err/ t / deltW
err = np.sqrt(err)/ self.t / deltW/ thp_w /self.expNum
# err = err / thp_w
else:
f = 0
err = 0
wave_flux[i] = f
err_flux[i] = err
idx = (wave_pix >= bRange[0]-100)
idx1 = (wave_pix[idx] <= bRange[1]+100)
specTab = Table(np.array([wave_pix[idx][idx1], wave_flux[idx][idx1], err_flux[idx][idx1]]).T,names=('WAVELENGTH', 'FLUX','ERR'))
# spec_orig = np.loadtxt(sedFile)
# plt.figure()
# plt.plot(spec_orig[:,0], spec_orig[:,1])
plt.figure()
plt.errorbar(wave_pix[idx][idx1], wave_flux[idx][idx1],err_flux[idx][idx1])
plt.legend([self.sedFile])
# plt.plot(wave_pix[idx][idx1], wave_flux[idx][idx1])
plt.show()
return specTab, Aimg, stamp.array
def generateSpec1dforStar(self,limitfluxratio = 0.8):
specConfile = self.config.conFiles[self.grating]
throughput_f = self.config.senFisle[self.grating] + '.' + self.config.orderIDs[self.beam] + '.fits'
sed = self.generateSEDfromFiles(self.sedFile,2000,10000,0.5)
stamp = self.psf.drawImage(wcs=galsim.PixelScale(self.p_size))*self.t*self.expNum*math.pi*(self.aper/2)*(self.aper/2)
origin_star = [self.ycenter - (stamp.center.y - stamp.ymin),
self.xcenter - (stamp.center.x - stamp.xmin)]
sdp = SpecDisperser.SpecDisperser(orig_img=stamp, xcenter=self.xcenter,
ycenter=self.ycenter, origin=origin_star,
tar_spec=sed,
conf=specConfile,
isAlongY=0)
spec_orders = sdp.compute_spec_orders()
thp = Table.read(throughput_f)
thp_i = interpolate.interp1d(thp['WAVELENGTH'], thp['SENSITIVITY'])
Aimg_orig = spec_orders[self.beam][0]
Aimg = Aimg_orig
Aimg = Aimg + (self.skybg + self.dark)*self.t*self.expNum
Aimg = np.random.poisson(Aimg)
for i in np.arange(self.expNum):
Aimg = self.addReadoutNois(img = Aimg, readout = self.readout)
Aimg = Aimg - (self.skybg + self.dark)*self.t*self.expNum
wave_pix = spec_orders[self.beam][5]
wave_pos = spec_orders[self.beam][3]
wave_pos_y=spec_orders[self.beam][4]
sh = Aimg.shape
spec_pix = np.zeros(sh[1])
err2_pix = np.zeros(sh[1])
# print(spec_orders[beamOrder][4])
# print(sh)
# plt.figure()
# plt.imshow(Aimg)
y_cent_pos = int(np.round(np.mean(wave_pos_y)))
tFlux = np.sum(spec_orders[self.beam][0])
# print(tFlux)
fluxRatio = 0
for i in range(int(sh[0]/2)):
pFlux = np.sum(spec_orders[self.beam][0][y_cent_pos-i:y_cent_pos+i+1])
fluxRatio = pFlux/tFlux
if fluxRatio>limitfluxratio:
break
y_range = i
# print(y_range, fluxRatio)
y_len_pix = 2 * y_range + 1
for i in range(sh[1]):
spec_pix[i] = sum(Aimg[y_cent_pos-y_range:y_cent_pos+y_range+1, i])
err2_pix[i] = sum(Aimg_orig[y_cent_pos-y_range:y_cent_pos+y_range+1, i]) + (self.skybg + self.dark)*self.t * y_len_pix * self.expNum + self.readout*self.readout * y_len_pix * self.expNum
bRange = self.config.bandRanges[self.grating]
wave_flux = np.zeros(wave_pix.shape[0])
err_flux = np.zeros(wave_pix.shape[0])
for i in np.arange(1, wave_pix.shape[0] - 1):
w = wave_pix[i]
if (bRange[0] <= w <= bRange[1]):
thp_w = thp_i(w)
deltW = (w - wave_pix[i - 1]) / 2 + (wave_pix[i + 1] - w) / 2
f = spec_pix[wave_pos[0] - 1 + i]
f = f / self.t / thp_w / deltW /self.expNum
err = err2_pix[wave_pos[0] - 1 + i]
# err = err/ t / deltW
err = np.sqrt(err)/ self.t / deltW/ thp_w /self.expNum
# err = err / thp_w
else:
f = 0
err = 0
wave_flux[i] = f
err_flux[i] = err
idx = (wave_pix >= bRange[0]-100)
idx1 = (wave_pix[idx] <= bRange[1]+100)
specTab = Table(np.array([wave_pix[idx][idx1], wave_flux[idx][idx1], err_flux[idx][idx1]]).T,names=('WAVELENGTH', 'FLUX','ERR'))
# spec_orig = np.loadtxt(sedFile)
# plt.figure()
# plt.plot(spec_orig[:,0], spec_orig[:,1])
# plt.figure()
# plt.errorbar(wave_pix[idx][idx1], wave_flux[idx][idx1],err_flux[idx][idx1])
# plt.legend([self.sedFile])
# # plt.plot(wave_pix[idx][idx1], wave_flux[idx][idx1])
# plt.show()
return specTab, Aimg, stamp.array, fluxRatio
def addReadoutNois(self, img = None, readout = 5):
for i in range(img.shape[0]):
for j in range(img.shape[1]):
img[i,j] += round(random.gauss(mu = 0, sigma = readout))
return img
'''
Author: xin zhangxinbjfu@gmail.com
Date: 2021-04-08 13:49:35
LastEditors: xin zhangxinbjfu@gmail.com
LastEditTime: 2022-05-18 08:31:10
FilePath: /undefined/Users/zhangxin/Work/SlitlessSim/sls_lit_demo/SpecGen/__init__.py
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
'''
File added
INSTRUMETN CSSTSLS
GRATING GI
WAVELENGTH 6200 10000
# First order (BEAM A) *******************
BEAMA -1124 -577
MMAG_EXTRACT_A 30
MMAG_MARK_A 30
#
# Trace description
#
DYDX_ORDER_A 1
DYDX_A_0 0.0 0.0 0.0 0.0 0.0 0.0
DYDX_A_1 -0.0008726648475212713 0.0 0.0 0.0 0.0 0.0
#
# X and Y Offsets
#
XOFF_A 0.0
YOFF_A 0.0
#
# Dispersion solution
#
DISP_ORDER_A 1
DLDP_A_0 -33.01210344165788 0.007569610429352271 -0.0022577397703360323 -8.214442647976815e-07 -4.592086832501138e-09 2.5239465714847694e-07
DLDP_A_1 -9.200968629784002 -0.0002566886334429964 9.500220330081724e-05 2.7855490962881916e-08 2.858304867205082e-11 -1.0450952273741693e-08
#
SENSITIVITY_A GI.Throughput.1st.fits
#
#zero order (BEAM B) *******************
BEAMB -10 10
MMAG_EXTRACT_B 30.
MMAG_MARK_B 30.
#
# Trace description
#
DYDX_ORDER_B 0
DYDX_B_00.0 0.0 0.0 0.0 0.0 0.0
#
# X and Y Offsets
#
XOFF_B 0.0
YOFF_B 0.0
#
# Dispersion solution
#
DISP_ORDER_B 1
DLDP_B_0 8100.0 0.0 0.0 0.0 0.0 0.0
DLDP_B_1 -3800.0 0.0 0.0 0.0 0.0 0.0
#
#
SENSITIVITY_B GI.Throughput.0st.fits
# Sencond order (BEAM C) *******************
BEAMC -2148 -1254
MMAG_EXTRACT_C 30
MMAG_MARK_C 30
#
# Trace description
#
DYDX_ORDER_C 1
DYDX_C_0 0.0 0.0 0.0 0.0 0.0 0.0
DYDX_C_1 -0.0008726648475212713 0.0 0.0 0.0 0.0 0.0
#
# X and Y Offsets
#
XOFF_C 0.0
YOFF_C 0.0
#
# Dispersion solution
#
DISP_ORDER_C 1
DLDP_C_0 -33.01210344165788 0.007569610429352271 -0.0022577397703360323 -8.214442647976815e-07 -4.592086832501138e-09 2.5239465714847694e-07
DLDP_C_1 -4.600484314892002 -0.00012834431672149928 4.750110165041072e-05 1.3927745481441094e-08 1.4291524335939302e-11 -5.225476136871006e-09
#
SENSITIVITY_C GI.Throughput.2st.fits
#
# -1st order (BEAM D) *******************
BEAMD 535 1191
MMAG_EXTRACT_D 30
MMAG_MARK_D 30
#
# Trace description
#
DYDX_ORDER_D 1
DYDX_D_0 0.0 0.0 0.0 0.0 0.0 0.0
DYDX_D_1 0.0008726648475212713 0.0 0.0 0.0 0.0 0.0
#
# X and Y Offsets
#
XOFF_D 0.0
YOFF_D 0.0
#
# Dispersion solution
#
DISP_ORDER_D 1
DLDP_D_0 -33.01210344165788 0.007569610429352271 -0.0022577397703360323 -8.214442647976815e-07 -4.592086832501138e-09 2.5239465714847694e-07
DLDP_D_1 9.200968629784002 0.0002566886334429964 -9.500220330081724e-05 -2.7855490962881916e-08 -2.858304867205082e-11 1.0450952273741693e-08
#
SENSITIVITY_D GI.Throughput.-1st.fits
#
# -2st order (BEAM E) *******************
BEAME 1170 2281
MMAG_EXTRACT_E 30
MMAG_MARK_E 30
#
# Trace description
#
DYDX_ORDER_E 1
DYDX_E_0 0.0 0.0 0.0 0.0 0.0 0.0
DYDX_E_1 0.0008726648475212713 0.0 0.0 0.0 0.0 0.0
#
# X and Y Offsets
#
XOFF_E 0.0
YOFF_E 0.0
#
# Dispersion solution
#
DISP_ORDER_E 1
DLDP_E_0 -33.01210344165788 0.007569610429352271 -0.0022577397703360323 -8.214442647976815e-07 -4.592086832501138e-09 2.5239465714847694e-07
DLDP_E_1 4.600484314892002 0.00012834431672149928 -4.750110165041072e-05 -1.3927745481441094e-08 -1.4291524335939302e-11 5.225476136871006e-09
#
SENSITIVITY_E GI.Throughput.-2st.fits
#
INSTRUMETN CSSTSLS
GRATING GI
WAVELENGTH 6200 10000
# First order (BEAM A) *******************
BEAMA 516 1230
MMAG_EXTRACT_A 30
MMAG_MARK_A 30
#
# Trace description
#
DYDX_ORDER_A 1
DYDX_A_0 0.0 0.0 0.0 0.0 0.0 0.0
DYDX_A_1 0.0008726648475212713 0.0 0.0 0.0 0.0 0.0
#
# X and Y Offsets
#
XOFF_A 0.0
YOFF_A 0.0
#
# Dispersion solution
#
DISP_ORDER_A 1
DLDP_A_0 175.81371583954845 0.00046898716015618923 0.0011751407556484514 6.967374268344785e-07 -1.0886921620684591e-08 -1.1934641681891917e-07
DLDP_A_1 9.7236437973885 -4.0899320307831585e-05 -0.00010248139112795352 -6.50820335441285e-08 -2.968125617588231e-10 1.16888694637088e-08
#
SENSITIVITY_A GI.Throughput.1st.fits
#
#zero order (BEAM B) *******************
BEAMB -10 10
MMAG_EXTRACT_B 30.
MMAG_MARK_B 30.
#
# Trace description
#
DYDX_ORDER_B 0
DYDX_B_00.0 0.0 0.0 0.0 0.0 0.0
#
# X and Y Offsets
#
XOFF_B 0.0
YOFF_B 0.0
#
# Dispersion solution
#
DISP_ORDER_B 1
DLDP_B_0 8100.0 0.0 0.0 0.0 0.0 0.0
DLDP_B_1 3800.0 0.0 0.0 0.0 0.0 0.0
#
#
SENSITIVITY_B GI.Throughput.0st.fits
# Sencond order (BEAM C) *******************
BEAMC 1132 2359
MMAG_EXTRACT_C 30
MMAG_MARK_C 30
#
# Trace description
#
DYDX_ORDER_C 1
DYDX_C_0 0.0 0.0 0.0 0.0 0.0 0.0
DYDX_C_1 0.0008726648475212713 0.0 0.0 0.0 0.0 0.0
#
# X and Y Offsets
#
XOFF_C 0.0
YOFF_C 0.0
#
# Dispersion solution
#
DISP_ORDER_C 1
DLDP_C_0 175.81371583954845 0.00046898716015618923 0.0011751407556484514 6.967374268344785e-07 -1.0886921620684591e-08 -1.1934641681891917e-07
DLDP_C_1 4.86182189869425 -2.0449659998483498e-05 -5.1240695626007864e-05 -3.2541016814255404e-08 -1.4840628087939621e-10 5.8444347385742755e-09
#
SENSITIVITY_C GI.Throughput.2st.fits
#
# -1st order (BEAM D) *******************
BEAMD -1106 -591
MMAG_EXTRACT_D 30
MMAG_MARK_D 30
#
# Trace description
#
DYDX_ORDER_D 1
DYDX_D_0 0.0 0.0 0.0 0.0 0.0 0.0
DYDX_D_1 -0.0008726648475212713 0.0 0.0 0.0 0.0 0.0
#
# X and Y Offsets
#
XOFF_D 0.0
YOFF_D 0.0
#
# Dispersion solution
#
DISP_ORDER_D 1
DLDP_D_0 175.81371583954845 0.00046898716015618923 0.0011751407556484514 6.967374268344785e-07 -1.0886921620684591e-08 -1.1934641681891917e-07
DLDP_D_1 -9.7236437973885 4.0899320307831585e-05 0.00010248139112795352 6.50820335441285e-08 2.968125617588231e-10 -1.16888694637088e-08
#
SENSITIVITY_D GI.Throughput.-1st.fits
#
# -2st order (BEAM E) *******************
BEAME -2111 -1283
MMAG_EXTRACT_E 30
MMAG_MARK_E 30
#
# Trace description
#
DYDX_ORDER_E 1
DYDX_E_0 0.0 0.0 0.0 0.0 0.0 0.0
DYDX_E_1 -0.0008726648475212713 0.0 0.0 0.0 0.0 0.0
#
# X and Y Offsets
#
XOFF_E 0.0
YOFF_E 0.0
#
# Dispersion solution
#
DISP_ORDER_E 1
DLDP_E_0 175.81371583954845 0.00046898716015618923 0.0011751407556484514 6.967374268344785e-07 -1.0886921620684591e-08 -1.1934641681891917e-07
DLDP_E_1 -4.86182189869425 2.0449659998483498e-05 5.1240695626007864e-05 3.2541016814255404e-08 1.4840628087939621e-10 -5.8444347385742755e-09
#
SENSITIVITY_E GI.Throughput.-2st.fits
#
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment