-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfits_jpg.py
More file actions
57 lines (38 loc) · 1.04 KB
/
fits_jpg.py
File metadata and controls
57 lines (38 loc) · 1.04 KB
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
46
47
#!/usr/bin/python
# -*- coding: cp1251 -*-
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 19 11:38:11 2019
@author: liuqiang
"""
import random as random_number
import sys
import math
import numpy as np
from scipy import stats
import scipy as sp
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib.patches as patches
import matplotlib.path as path
from matplotlib.ticker import NullFormatter
from numpy import *
from pylab import *
import os
import glob
import shutil
#import subprocess
import signal
import subprocess as sub
# Function to create png files using ds9
def ds9_image(image,name):
sub.call("ds9 %s -scale zscale -export jpg %s.jpg -exit" % (image,name), shell=True, close_fds=False)
# fits所在路径
data_path = r"D:/A_Postgraduate/den/bila/bila_4/"
fits_path = os.path.join(data_path,'*.fit*')
fits_list = glob.glob(fits_path)
for index,fit in enumerate(fits_list):
name_index = fit.split("/")[-1].split(".fits")[0]
ds9_image(fit,name_index)
print("completed!!!")