在ASF根据事件(Event)下载SAR数据

什么是事件搜索?

事件搜索利用 SAR 处理的能力来监测自然灾害。目前支持的灾害是火山爆发地震
生成的产品包括完全地形校正的图像时间序列,以及受自然灾害影响区域的干涉 SAR 数据
为了促进完全自动化,处理流程由现有的危险警报系统(例如 USGS 地震通知服务)自动触发。

事件监测标准

地震

如果地震事件具有潜在的地表变形,则创建地震订阅,根据以下逻辑进行粗略评估:在这里插入图片描述

火山

火山订阅标准来自史密森学会全球火山活动计划的国际火山 RSS 提要。如果火山被标记为警告警报级别或红色航空代码,则会为火山创建订阅。在全球范围内,如果火山活动高到足以被全球火山活动计划触发和发布,SARVIEWS 会创建订阅。火山订阅从活动前 1 年开始处理数据,并无限期地继续,直到火山活动水平恢复正常。

使用事件搜索的具体步骤

开始事件搜索

首先在Search Type中选择Event(事件)
在这里插入图片描述
输入事件发生地点
在这里插入图片描述

选择事件种类(火山or地震)
在这里插入图片描述

选好了之后界面会变成如下状态
在这个页面中显示的是近期的火山或者地震活动

点击图中某个事件,可以看到下面显示的三栏

在这里插入图片描述

事件列(左)

左侧是选中事件及其附近时间或地点事件的类型(火山还是地震,根据图表可以判断)、震源深度、地点、时间等信息,点击事件名右侧的缩放至图层可以缩放到该事件相应地点。
在这里插入图片描述
在这里插入图片描述

事件详细信息列(中)

  • 此处列出了活动详情。这包括事件处理的开始和停止时间。对于地震,还会显示震级和深度。
  • 您可以复制事件 ID。
  • 单击SARVIEWS 活动将被定向到您选择的活动的 SARVIEWS 页面。
  • 对于地震事件,会列出USGS ID 。对于火山,列出了史密森尼 ID 。单击链接转到 USGS 或史密森尼事件页面。
  • 根据需要调整地理搜索多边形比例滑块。感兴趣区域多边形也将在地图上改变。滑块数值越大,黄色正方形的面积越大。
  • 一旦您对地理搜索多边形比例感到满意,请单击地理以使用事件的感兴趣区域和日期启动地理搜索。单击之后就是一般的直接搜索并下载数据的界面了
  • 单击列表以启动列表搜索,包括所有活动的产品场景。
  • 单击SARVIEWS以被定向到您选择的事件的 SARVIEWS 页面。
  • 标有在 Image Viewer 中打开的眼睛图标会打开更大的浏览查看器窗口。
    • 在浏览查看器中,使用+或-按钮进行缩放。您也可以使用鼠标进行缩放和平移。
    • 单击或滚动底部的缩略图以查看所选事件的其他浏览图像。
    • 场景元数据列在浏览查看器窗口的右侧。
  • 单击下载此图像图标以下载浏览图像。
    在这里插入图片描述
    Geographic界面
    在这里插入图片描述

List界面
在这里插入图片描述

SARVIEWS界面
在这里插入图片描述

文件列(右)

  • 此列中列出了所选事件的文件总数。
  • 单击事件产品图以打开浏览查看器窗口。
  • 单击每个文件旁边的复选框以选择或取消选择文件。选定的文件将固定在地图上。选择所需文件后,您还可以使用结果面板左上方的“下载”或“复制”控件与所选产品进行交互。
  • 单击On Demand将所选文件添加到您的 On Demand 队列以进行进一步处理。
  • 单击购物车图标将所选文件添加到您的下载队列。
  • 单击下载以下载选定的文件。
    在这里插入图片描述

注意:必须先登录才能下载产品。

欢迎关注作者的公众号“We Goooo”,添加作者vx:wiingoo

import os import rasterio from rasterio.windows import Window from rasterio.warp import transform_bounds, reproject, Resampling import numpy as np # Function to crop patches from a new SAR GeoTIFF image using original optical patch names from a folder def crop_optical_using_sar_patches(whole_optical_path, sar_patch_folder, output_dir, patch_size=1024, keyword=None): if not os.path.exists(output_dir): os.makedirs(output_dir) # Get all SAR patches sar_patch_paths = [ os.path.join(sar_patch_folder, f) for f in os.listdir(sar_patch_folder) if f.endswith('.tif') and (keyword in f if keyword else True) ] with rasterio.open(whole_optical_path) as optical_src: optical_crs = optical_src.crs optical_count = optical_src.count patch_count = 0 for sar_patch_path in sar_patch_paths: sar_patch_name = os.path.basename(sar_patch_path) optical_patch_name = sar_patch_name.replace("_post_disaster", "_pre_disaster") patch_output_path = os.path.join(output_dir, optical_patch_name) with rasterio.open(sar_patch_path) as sar_patch: sar_bounds = sar_patch.bounds sar_crs = sar_patch.crs # Transform SAR bounds to optical image CRS if needed if sar_crs != optical_crs: transformed_bounds = transform_bounds(sar_crs, optical_crs, sar_bounds.left, sar_bounds.bottom, sar_bounds.right, sar_bounds.top) else: transformed_bounds = sar_bounds # Convert transformed bounds to pixel coordinates in optical image col_start, row_start = ~optical_src.transform * (transformed_bounds[0], transformed_bounds[3]) col_stop, row_stop = ~optical_src.transform * (transformed_bounds[2], transformed_bounds[1]) col_start, row_start = int(col_start), int(row_start) col_stop, row_stop = int(col_stop), int(row_stop) # Check bounds validity if (-512 <= col_start < optical_src.width+1 and -512 <= row_start < optical_src.height+1 and col_stop <= optical_src.width + 1025 and row_stop <= optical_src.height + 1025): window = Window(col_start, row_start, col_stop - col_start, row_stop - row_start) patch_data = optical_src.read(window=window) # Resample to fixed patch size resampled_patch = np.zeros((optical_count, patch_size, patch_size), dtype=patch_data.dtype) reproject( source=patch_data, destination=resampled_patch, src_transform=optical_src.window_transform(window), src_crs=optical_crs, dst_transform=rasterio.transform.from_bounds(*transformed_bounds, patch_size, patch_size), dst_crs=optical_crs, resampling=Resampling.lanczos ) profile = optical_src.profile profile.update({ 'height': patch_size, 'width': patch_size, 'transform': rasterio.transform.from_bounds(*transformed_bounds, patch_size, patch_size), 'count': optical_count, 'compress': None }) with rasterio.open(patch_output_path, 'w', **profile) as dst: dst.write(resampled_patch) patch_count += 1 else: print(f"[!] Patch {sar_patch_name} is out of bounds and skipped.") print(f"[✔] Generated {patch_count} optical patches and saved in {output_dir}") # Example usage: if __name__ == '__main__': # Define the absolute path to the new SAR GeoTIFF image whole_optical_scene_path = r'D:\Research\Dataset\BRIGHT\Myanmar_Hurricane_GoogleEarth_AOI01\pre_disaster_modified.tif' # Define the folder containing the original GeoTIFF optical patches sar_patch_folder = r'D:\Research\Dataset\BRIGHT\BRIGHT_final\post-event\post-event' # Define the path to the directory where the new SAR patches will be saved output_dir = 'D:\Research\Dataset\BRIGHT\github_test' crop_event = 'myanmar-hurricane' # Generate the SAR patches with a keyword filter crop_optical_using_sar_patches(whole_optical_scene_path, sar_patch_folder, output_dir, patch_size=1024, keyword=crop_event)
05-26
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Vigo*GIS_RS

来瓶可乐~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值