testPlotPSFMat.py 1.25 KB
Newer Older
Fang Yuedong's avatar
Fang Yuedong committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
画出指定PSF image
"""
import sys,os,math
import time
from IPython import display
import numpy as np
import matplotlib.pyplot as plt
import mpi4py.MPI as MPI

sys.path.append("/public/home/weichengliang/lnData/CSST_new_framwork/csstPSF")
import PSFConfig as myConfig
import PSFUtil as myUtil


def plotPSFMat(iccd, iwave, ipsf, psfPath):
    print('ipsf:', ipsf)
    psfInfo = myConfig.LoadPSF(iccd, iwave, ipsf, psfPath, InputMaxPixelPos=True, PSFCentroidWgt=True)
    imx = psfInfo['psfMat']    

    plt.close()
    fig = plt.figure(figsize=(8,8))
    cpp = 128
    dcpp= 10
    plt.imshow(imx[cpp-dcpp:cpp+dcpp, cpp-dcpp:cpp+dcpp])
    plt.annotate('iccd-{:} ipsf-{:}'.format(iccd, ipsf), (0.1, 0.9), xycoords='axes fraction',color='w')
    plt.savefig('figs/psfMatPlot_iccd{:}_ipsf{:}.pdf'.format(iccd, ipsf))
    

iccd = 28  #[1, 30]
iwave= 1  #[1, 4]
ipsf = 1  #[1, 100]
#psfPath = '/data/simudata/CSSOSDataProductsSims/data/csstPSFdata/CSSOS_psf_ciomp'
psfPath = '/data/simudata/CSSOSDataProductsSims/data/csstPSFdata/CSSOS_psf_ciomp_30X30'

for ipsf in range(12, 21):
    plotPSFMat(iccd, iwave, ipsf, psfPath)
for ipsf in range(12, 21):
    plotPSFMat(iccd, iwave, ipsf+30, psfPath)
for ipsf in range(12, 21):
    plotPSFMat(iccd, iwave, ipsf+60, psfPath)