Files
HPI/library/dir_manager.py
tangchao0503 98cf134cca 第一次提交
1、hpi的可用代码;
2、修复了多次点击曝光后,福亮度数据错误的问题;
3、定标方式为大的蓝菲积分球的标准能量曲线,而不是基于asd的能量曲线;
2022-09-06 22:54:14 +08:00

30 lines
887 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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()