如何解决如何从光谱python libraray中的envi文件读取波长信息?
我正在研究envi格式的高光谱图像。我已经使用光谱python库成功读取了它。现在,我想获得每个波段(波长中心)。请为这个任务建议方法。
解决方法
如果使用光谱模块打开ENVI图像,则波长(波段中心)在打开的图像的protected function finalize(ResponseInterface $response)
{
// stop PHP sending a Content-Type automatically
ini_set('default_mimetype','');
$request = $this->container->get('request');
if ($this->isEmptyResponse($response) && !$this->isHeadRequest($request)) {
return $response->withoutHeader('Content-Type')->withoutHeader('Content-Length');
}
// Add Content-Length header if `addContentLengthHeader` setting is set
if (isset($this->container->get('settings')['addContentLengthHeader']) &&
$this->container->get('settings')['addContentLengthHeader'] == true) {
if (ob_get_length() > 0) {
throw new \RuntimeException("Unexpected data in output buffer. " .
"Maybe you have characters before an opening <?php tag?");
}
$size = $response->getBody()->getSize();
if ($size !== null && !$response->hasHeader('Content-Length')) {
$response = $response->withHeader('Content-Length',(string) $size);
}
}
// clear the body if this is a HEAD request
if ($this->isHeadRequest($request)) {
return $response->withBody(new Body(fopen('php://temp','r+')));
}
return $response;
}
属性中。
bands.centers
您还可以从打开的图像的>>> import spectral as spy
>>> img = spy.open_image('EO1H0150332002114111KZ.L1R.hdr')
>>> print(img.bands.centers[:5])
[355.59,365.76,375.94,386.11,396.29]
属性中获取原始标头元数据。
metadata
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。