我无法从Goes16 NetCDF fi中提取“乐队名称”

2024-09-29 05:19:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图从NetCDF文件中提取“波段名称”,但出现了一个无法识别的语法错误。波段名称由M3C13识别,我只想提取M3C后的13。我的代码是:

channel_13 = 'C13/OR_ABI-L2-CMIPF-M3C13_G16_s20180391900384_e20180391911162_c20180391911244.nc'
path_30 = '/Volumes/Anthonys_backup/Masters_Thesis/Satellite_Data/new/'

# Path to the GOES-R simulated image file
path = path_30 + channel_13

# Search for the GOES-R channel in the file name
Band = (path[<span class="skimlinks-unlinked">path.find("M3C")+3:path.find("_G16</span>I Band: " + Band)

print(Band)

有什么建议吗


Tags: 文件thepath名称band波段channelnetcdf