本文整理汇总了Python中OCO_Matrix.OCO_Matrix.header['Retrieval_Mode']方法的典型用法代码示例。如果您正苦于以下问题:Python OCO_Matrix.header['Retrieval_Mode']方法的具体用法?Python OCO_Matrix.header['Retrieval_Mode']怎么用?Python OCO_Matrix.header['Retrieval_Mode']使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCO_Matrix.OCO_Matrix
的用法示例。
在下文中一共展示了OCO_Matrix.header['Retrieval_Mode']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_aerosol_file
# 需要导入模块: from OCO_Matrix import OCO_Matrix [as 别名]
# 或者: from OCO_Matrix.OCO_Matrix import header['Retrieval_Mode'] [as 别名]
def write_aerosol_file(sounding_data, out_filename, pressure_in, pressure_out):
aer_names = sounding_data['aerosol_names']
# If there are no aerosols for this sounding then just make an empty list
if aer_names == None:
aer_names = []
num_cols = len(aer_names) + 1
out_aer_data = numpy.zeros((len(pressure_out), num_cols), dtype=float)
out_aer_data[:, 0] = resample_profile(pressure_in, pressure_in, pressure_out, log_data=True, extrapolate=True)
aer_src_data = numpy.zeros((len(pressure_in), len(aer_names)), dtype=float)
for aer_idx in range(len(aer_names)):
curr_aer = sounding_data['aerosol_names'][aer_idx]
for lev_idx in range(len(pressure_in)):
aer_src_data[lev_idx, aer_idx] = abs(sounding_data['aerosol_extinction'][curr_aer][LEV_BEG+lev_idx])
if tuple(pressure_in) == tuple(pressure_out):
aer_dst_data = aer_src_data.transpose()
else:
aer_dst_data = resample_aerosol(pressure_in, aer_src_data, pressure_out, debug=True)
for aer_idx in range(len(aer_names)):
out_aer_data[:, aer_idx+1] = aer_dst_data[aer_idx, :]
out_mat_obj = OCO_Matrix()
out_mat_obj.file_id = 'True aerosol profiles from orbit simulator'
out_mat_obj.data = out_aer_data
out_mat_obj.labels = ['Pressure'] + list(aer_names)
out_mat_obj.header['Retrieval_Mode'] = 'linear'
out_mat_obj.units = ['Pa'] + [ '1/Pa' for x in range(len(aer_names)) ]
out_mat_obj.write(out_filename)