

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用 Amazon S3 数据传输的公共广播卫星
<a name="examples.pbs-to-s3"></a>

 此示例建立在用户指南[JPSS-1-公共广播卫星 (PBS)-评估](examples.md#examples.pbs-definition)部分所做的分析的基础上。

 在本示例中，你需要假设一个场景，即你想将 HRD 通信路径捕获为数字中频，并将其存储起来以备将来的批处理之用。这样可以节省数字化后的原始射频 (RF) 同相正交 (I/Q) 样本。将数据放入 Amazon S3 存储桶后，您可以使用所需的任何软件对数据进行解调和解码。有关处理的详细示例，请参阅[ MathWorks 教程](https://www.mathworks.com/help/satcom/ug/capture-satellite-data-using-aws-ground-station.html)。使用此示例后，您可以考虑添加 Amazon EC2 现货定价组件来处理数据并降低总体处理成本。

## 通信路径
<a name="examples.pbs-to-s3.communication-paths"></a>

 本节介绍[规划您的数据流通信路径](getting-started.step2.md)入门。

 以下所有模板片段都属于 CloudFormation 模板的 “资源” 部分。

```
Resources:
  # Resources that you would like to create should be placed within the Resources section.
```

**注意**  
 有关 CloudFormation 模板内容的更多信息，请参阅[模板部分](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html)。

 考虑到我们向 Amazon S3 提供单一通信路径的场景，您知道您将拥有一条异步传输路径。根据本[异步数据传输](getting-started.step2.md#getting-started.step2.async-data-delivery)节，您必须定义一个 Amazon S3 存储桶。

```
  # The S3 bucket where AWS Ground Station will deliver the downlinked data.
  GroundStationS3DataDeliveryBucket:
    Type: AWS::S3::Bucket
    DeletionPolicy: Retain
    UpdateReplacePolicy: Retain
    Properties:
      # Results in a bucket name formatted like: aws-groundstation-data-{account id}-{region}-{random 8 character string}
      BucketName: !Join ["-", ["aws-groundstation-data", !Ref AWS::AccountId, !Ref AWS::Region, !Select [0, !Split ["-", !Select [2, !Split ["/", !Ref AWS::StackId]]]]]]
```

 此外，您还需要创建相应的角色和策略 AWS Ground Station 才能允许使用存储桶。

```
  # The IAM role that AWS Ground Station will assume to have permission find and write
  # data to your S3 bucket.
  GroundStationS3DataDeliveryRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action:
              - 'sts:AssumeRole'
            Effect: Allow
            Principal:
              Service:
                - groundstation.amazonaws.com
            Condition:
              StringEquals:
                "aws:SourceAccount": !Ref AWS::AccountId
              ArnLike:
                "aws:SourceArn": !Sub "arn:aws:groundstation:${AWS::Region}:${AWS::AccountId}:config/s3-recording/*"

  # The S3 bucket policy that defines what actions AWS Ground Station can perform on your S3 bucket.
  GroundStationS3DataDeliveryBucketPolicy:
    Type: AWS::IAM::Policy
    Properties:
      PolicyDocument:
        Statement:
          - Action:
              - 's3:GetBucketLocation'
            Effect: Allow
            Resource:
              - !GetAtt GroundStationS3DataDeliveryBucket.Arn
          - Action:
              - 's3:PutObject'
            Effect: Allow
            Resource:
              - !Join [ "/", [ !GetAtt GroundStationS3DataDeliveryBucket.Arn, "*" ] ]
      PolicyName: GroundStationS3DataDeliveryPolicy
      Roles:
        - !Ref GroundStationS3DataDeliveryRole
```

## AWS Ground Station 配置
<a name="examples.pbs-to-s3.configs"></a>

 本节介绍[创建配置](getting-started.step3.md)入门。

 你需要一个*跟踪配置*来设置你使用自动追踪的偏好。选择 *P* REFERRED 作为自动跟踪可以提高信号质量，但由于 JPSS-1 星历质量足够，因此不需要满足信号质量。

```
  TrackingConfig:
    Type: AWS::GroundStation::Config
    Properties:
      Name: "JPSS Tracking Config"
      ConfigData:
        TrackingConfig:
          Autotrack: "PREFERRED"
```

 根据通信路径，您需要定义一个*天线下行链*路配置来表示卫星部分，并定义一个 *s3 录音*以引用您刚刚创建的 Amazon S3 存储桶。

```
  # The AWS Ground Station Antenna Downlink Config that defines the frequency spectrum used to
  # downlink data from your satellite.
  JpssDownlinkDigIfAntennaConfig:
    Type: AWS::GroundStation::Config
    Properties:
      Name: "JPSS Downlink DigIF Antenna Config"
      ConfigData:
        AntennaDownlinkConfig:
          SpectrumConfig:
            Bandwidth:
              Units: "MHz"
              Value: 30
            CenterFrequency:
              Units: "MHz"
              Value: 7812
            Polarization: "RIGHT_HAND"

  # The AWS Ground Station S3 Recording Config that defines the S3 bucket and IAM role to use
  # when AWS Ground Station delivers the downlink data.
  S3RecordingConfig:
    Type: AWS::GroundStation::Config
    DependsOn: GroundStationS3DataDeliveryBucketPolicy
    Properties:
      Name: "JPSS S3 Recording Config"
      ConfigData:
        S3RecordingConfig:
          BucketArn: !GetAtt GroundStationS3DataDeliveryBucket.Arn
          RoleArn: !GetAtt GroundStationS3DataDeliveryRole.Arn
```

## AWS Ground Station 任务简介
<a name="examples.pbs-to-s3.mission-profile"></a>

 本节介绍[创建任务档案](getting-started.step4.md)入门。

 现在你已经有了相关的配置，你可以用它们来构造数据流。其余参数将使用默认值。

```
  # The AWS Ground Station Mission Profile that groups the above configurations to define how to downlink data.
  JpssAsynchMissionProfile:
    Type: AWS::GroundStation::MissionProfile
    Properties:
      Name: "43013 JPSS Asynchronous Data"
      MinimumViableContactDurationSeconds: 180
      TrackingConfigArn: !Ref TrackingConfig
      DataflowEdges:
        - Source: !Ref JpssDownlinkDigIfAntennaConfig
          Destination: !Ref S3RecordingConfig
```

## 把它放在一起
<a name="examples.pbs-to-s3.putting-it-together"></a>

 利用上述资源，您现在可以安排 JPSS-1 联系人从任何已上线人员进行异步数据传输。 AWS Ground Station [AWS Ground Station 地点](aws-ground-station-antenna-locations.md)

 以下是一个完整的 CloudFormation 模板，其中包括本节中描述的所有资源，这些资源组合成一个可以直接在中使用的模板 CloudFormation。

 名为的 CloudFormation 模板`AquaSnppJpss-1TerraDigIfS3DataDelivery.yml`包含一个 Amazon S3 存储桶以及安排联系和接收 VITA-49 信号/IP 直接广播数据所需的 AWS Ground Station 资源。

 如果你的账户未登录 Aqua、SNPP、JPSS-1/NOAA-20 和 Terra，请参阅。[机载卫星](getting-started.step1.md)

**注意**  
 您可以使用有效 AWS 凭证访问客户登录 Amazon S3 存储桶，从而访问模板。以下链接使用区域性 Amazon S3 存储桶。更改`us-west-2`区域代码以表示要在其中创建 CloudFormation 堆栈的相应区域。  
 此外，以下说明使用 YAML。但是，模板有 YAML 和 JSON 这两种格式。要使用 JSON，请在下载模板`.json`时将`.yml`文件扩展名替换为。

 要使用下载模板 AWS CLI，请使用以下命令：

```
aws s3 cp s3://groundstation-cloudformation-templates-us-west-2/AquaSnppJpss-1TerraDigIfS3DataDelivery.yml .
```

 在浏览器中导航到以下 URL，可以在控制台中查看和下载此模板：

```
https://s3.console.aws.amazon.com/s3/object/groundstation-cloudformation-templates-us-west-2/AquaSnppJpss-1TerraDigIfS3DataDelivery.yml
```

 您可以使用以下链接直接在中 CloudFormation 指定模板：

```
https://groundstation-cloudformation-templates-us-west-2.s3.us-west-2.amazonaws.com/AquaSnppJpss-1TerraDigIfS3DataDelivery.yml
```