第一次提交
1、hpi的可用代码; 2、修复了多次点击曝光后,福亮度数据错误的问题; 3、定标方式为大的蓝菲积分球的标准能量曲线,而不是基于asd的能量曲线;
This commit is contained in:
29
library/dir_manager.py
Normal file
29
library/dir_manager.py
Normal file
@ -0,0 +1,29 @@
|
||||
import os
|
||||
from library.functions import get_path
|
||||
|
||||
|
||||
class DirManager():
|
||||
def __init__(self):
|
||||
self.base_dir = get_path()
|
||||
self.log_dir = self.base_dir + '//log'
|
||||
|
||||
self.create_directory(self.log_dir)
|
||||
print(self.log_dir)
|
||||
|
||||
|
||||
# 查看是否存在保存光谱和影像文件的目录,如果没有就创建
|
||||
def create_directory(self, directory):
|
||||
'''
|
||||
:param directory: 需要创建的文件夹绝对路径,不能将参数directory省略而在此函数内部使用self.log_dir,
|
||||
因为本类的继承类也需要使用此函数
|
||||
:return:
|
||||
'''
|
||||
if not os.path.exists(directory):
|
||||
print('创建文件夹:', directory)
|
||||
os.makedirs(directory)
|
||||
# else:
|
||||
# print('文件夹存在:%s' % self.log_dir)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
x = DirManager()
|
Reference in New Issue
Block a user