

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# データフローエンドポイントを利用するパブリックブロードキャスト衛星 (復調および復号化）
<a name="examples.pbs-dataflow-endpoint-demod-decode"></a>

 この例では、 ユーザーガイドの [JPSS-1 - パブリックブロードキャスト衛星 (PBS) - 評価](examples.md#examples.pbs-definition)セクションで行った分析に基づいています。

 この例を完了するには、シナリオを想定する必要があります。つまり、データフローエンドポイントを使用して、HRD 通信パスを復調およびデコードされたダイレクトブロードキャストデータとしてキャプチャする必要があります。この例は、NASA Direct Readout Labs ソフトウェア (RT-STPS および IPOPP) を使用してデータを処理する場合の出発点として最適です。

## 通信パス
<a name="examples.pbs-dataflow-endpoint-demod-decode.communication-paths"></a>

 このセクションでは[データフロー通信パスを計画する](getting-started.step2.md)、開始方法を示します。この例では、 CloudFormation テンプレートにパラメータとリソースセクションの 2 つのセクションを作成します。

**注記**  
 CloudFormation テンプレートの内容の詳細については、「テンプレート[」セクション](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html)を参照してください。

 Parameters セクションでは、次のパラメータを追加します。 CloudFormation コンソールを使用してスタックを作成するときに、これらの値を指定します。

```
Parameters:
  EC2Key:
    Description: The SSH key used to access the EC2 receiver instance. Choose any SSH key if you are not creating an EC2 receiver instance. For instructions on how to create an SSH key see [https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html)
    Type: AWS::EC2::KeyPair::KeyName
    ConstraintDescription: must be the name of an existing EC2 KeyPair.

  ReceiverAMI:
    Description: The Ground Station DDX AMI ID you want to use. Please note that AMIs are region specific. For instructions on how to retrieve an AMI see [https://docs.aws.amazon.com/ground-station/latest/ug/dataflows.ec2-configuration.html#dataflows.ec2-configuration.amis](https://docs.aws.amazon.com/ground-station/latest/ug/dataflows.ec2-configuration.html#dataflows.ec2-configuration.amis)
    Type: AWS::EC2::Image::Id
```

**注記**  
 キーペアを作成し、Amazon EC2 `EC2Key`パラメータの名前を指定**する必要があります**。[ Amazon EC2 インスタンスのキーペアを作成する](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html)」を参照してください。  
 さらに、 CloudFormation スタックの作成時に、正しい**リージョン固有の** AMI ID を指定**する必要があります**。「[AWS Ground Station Amazon マシンイメージ (AMIs)](dataflows.ec2-configuration.md#dataflows.ec2-configuration.amis)」を参照してください。

 残りのテンプレートスニペットは、テンプレートのリソースセクションに属します CloudFormation 。

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

 EC2 インスタンスに単一の通信パスを配信するシナリオを考えると、単一の同期配信パスがあります。[同期データ配信](getting-started.step2.md#getting-started.step2.sync-data-delivery) セクションごとに、データフローエンドポイントアプリケーションを使用して Amazon EC2 インスタンスをセットアップおよび設定し、1 つ以上のデータフローエンドポイントグループを作成する必要があります。

```
  # The EC2 instance that will send/receive data to/from your satellite using AWS Ground Station.
  ReceiverInstance:
    Type: AWS::EC2::Instance
    Properties:
      DisableApiTermination: false
      IamInstanceProfile: !Ref GeneralInstanceProfile
      ImageId: !Ref ReceiverAMI
      InstanceType: m5.4xlarge
      KeyName: !Ref EC2Key
      Monitoring: true
      PlacementGroupName: !Ref ClusterPlacementGroup
      SecurityGroupIds:
        - Ref: InstanceSecurityGroup
      SubnetId: !Ref ReceiverSubnet
      BlockDeviceMappings:
        - DeviceName: /dev/xvda
          Ebs:
            VolumeType: gp2
            VolumeSize: 40
      Tags:
        - Key: Name
          Value: !Join [ "-" , [ "Receiver" , !Ref "AWS::StackName" ] ]
      UserData:
        Fn::Base64:
          |
          #!/bin/bash
          exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
          echo `date +'%F %R:%S'` "INFO: Logging Setup" >&2

          GROUND_STATION_DIR="/opt/aws/groundstation"
          GROUND_STATION_BIN_DIR="${GROUND_STATION_DIR}/bin"
          STREAM_CONFIG_PATH="${GROUND_STATION_DIR}/customer_stream_config.json"

          echo "Creating ${STREAM_CONFIG_PATH}"
          cat << STREAM_CONFIG > "${STREAM_CONFIG_PATH}"
          {
            "ddx_streams": [
              {
                "streamName": "Downlink",
                "maximumWanRate": 4000000000,
                "lanConfigDevice": "lo",
                "lanConfigPort": 50000,
                "wanConfigDevice": "eth1",
                "wanConfigPort": 55888,
                "isUplink": false
              }
            ]
          }
          STREAM_CONFIG

          echo "Waiting for dataflow endpoint application to start"
          while netstat -lnt | awk '$4 ~ /:80$/ {exit 1}'; do sleep 10; done

          echo "Configuring dataflow endpoint application streams"
          python "${GROUND_STATION_BIN_DIR}/configure_streams.py" --configFileName "${STREAM_CONFIG_PATH}"
          sleep 2
          python "${GROUND_STATION_BIN_DIR}/save_default_config.py"

          exit 0
```

```
  # The AWS Ground Station Dataflow Endpoint Group that defines the endpoints that AWS Ground
  # Station will use to send/receive data to/from your satellite.
  DataflowEndpointGroup:
    Type: AWS::GroundStation::DataflowEndpointGroup
    Properties:
      ContactPostPassDurationSeconds: 180
      ContactPrePassDurationSeconds: 120
      EndpointDetails:
        - Endpoint:
            Name: !Join [ "-" , [ !Ref "AWS::StackName" , "Downlink" ] ] # needs to match DataflowEndpointConfig name
            Address:
              Name: !GetAtt ReceiverInstanceNetworkInterface.PrimaryPrivateIpAddress
              Port: 55888
          SecurityDetails:
            SecurityGroupIds:
              - Ref: "DataflowEndpointSecurityGroup"
            SubnetIds:
              - !Ref ReceiverSubnet
            RoleArn: !GetAtt DataDeliveryServiceRole.Arn

  # The security group that the ENI created by AWS Ground Station belongs to.
  DataflowEndpointSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: Security Group for AWS Ground Station registration of Dataflow Endpoint Groups
      VpcId: !Ref ReceiverVPC
      SecurityGroupEgress:
        - IpProtocol: udp
          FromPort: 55888
          ToPort: 55888
          CidrIp: 10.0.0.0/8
          Description: "AWS Ground Station Downlink Stream To 10/8"
        - IpProtocol: udp
          FromPort: 55888
          ToPort: 55888
          CidrIp: 172.16.0.0/12
          Description: "AWS Ground Station Downlink Stream To 172.16/12"
        - IpProtocol: udp
          FromPort: 55888
          ToPort: 55888
          CidrIp: 192.168.0.0/16
          Description: "AWS Ground Station Downlink Stream To 192.168/16"

  # The placement group in which your EC2 instance is placed.
  ClusterPlacementGroup:
    Type: AWS::EC2::PlacementGroup
    Properties:
      Strategy: cluster

  # The security group for your EC2 instance.
  InstanceSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: AWS Ground Station receiver instance security group.
      VpcId: !Ref ReceiverVPC
      SecurityGroupIngress:
        # To allow SSH access to the instance, add another rule allowing tcp port 22 from your CidrIp
        - IpProtocol: udp
          FromPort: 55888
          ToPort: 55888
          SourceSecurityGroupId: !Ref DataflowEndpointSecurityGroup
          Description: "AWS Ground Station Downlink Stream"

  ReceiverVPC:
    Type: AWS::EC2::VPC
    Properties:
      CidrBlock: "10.0.0.0/16"
      Tags:
        - Key: "Name"
          Value: "AWS Ground Station - PBS to dataflow endpoint Demod Decode Example VPC"
        - Key: "Description"
          Value: "VPC for EC2 instance receiving AWS Ground Station data"

  ReceiverSubnet:
    Type: AWS::EC2::Subnet
    Properties:
      CidrBlock: "10.0.0.0/24"
      Tags:
        - Key: "Name"
          Value: "AWS Ground Station - PBS to dataflow endpoint Demod Decode Example Subnet"
        - Key: "Description"
          Value: "Subnet for EC2 instance receiving AWS Ground Station data"
      VpcId: !Ref ReceiverVPC

  # An ENI providing a fixed IP address for AWS Ground Station to connect to.
  ReceiverInstanceNetworkInterface:
    Type: AWS::EC2::NetworkInterface
    Properties:
      Description: Floating network interface providing a fixed IP address for AWS Ground Station to connect to.
      GroupSet:
        - !Ref InstanceSecurityGroup
      SubnetId: !Ref ReceiverSubnet

  # Attach the ENI to the EC2 instance.
  ReceiverInstanceInterfaceAttachment:
    Type: AWS::EC2::NetworkInterfaceAttachment
    Properties:
      DeleteOnTermination: false
      DeviceIndex: "1"
      InstanceId: !Ref ReceiverInstance
      NetworkInterfaceId: !Ref ReceiverInstanceNetworkInterface

  # The instance profile for your EC2 instance.
  GeneralInstanceProfile:
    Type: AWS::IAM::InstanceProfile
    Properties:
      Roles:
        - !Ref InstanceRole
```

 また、 AWS Ground Station がアカウントに Elastic Network Interface (ENI) を作成できるようにするには、適切なポリシー、ロール、プロファイルも必要です。

```
  # AWS Ground Station assumes this role to create/delete ENIs in your account in order to stream data.
  DataDeliveryServiceRole:
    Type: AWS::IAM::Role
    Properties:
      Policies:
        - PolicyDocument:
            Statement:
              - Action:
                  - ec2:CreateNetworkInterface
                  - ec2:DeleteNetworkInterface
                  - ec2:CreateNetworkInterfacePermission
                  - ec2:DeleteNetworkInterfacePermission
                  - ec2:DescribeSubnets
                  - ec2:DescribeVpcs
                  - ec2:DescribeSecurityGroups
                Effect: Allow
                Resource: '*'
            Version: '2012-10-17'
          PolicyName: DataDeliveryServicePolicy
      AssumeRolePolicyDocument:
        Version: 2012-10-17
        Statement:
          - Effect: Allow
            Principal:
              Service:
              - groundstation.amazonaws.com
            Action:
            - sts:AssumeRole

  # The EC2 instance assumes this role.
  InstanceRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Effect: "Allow"
            Principal:
              Service:
                - "ec2.amazonaws.com"
            Action:
              - "sts:AssumeRole"
      Path: "/"
      ManagedPolicyArns:
        - arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess
        - arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role
        - arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy
        - arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM
```

## AWS Ground Station 設定
<a name="examples.pbs-dataflow-endpoint-demod-decode.configs"></a>

 このセクションでは[設定の作成](getting-started.step3.md)、 ユーザーガイドについて説明します。

 自動トラックの使用に関する設定を行うには、*tracking-config* が必要です。自動トラックとして *PREFERRED* を選択すると、シグナルの品質が向上しますが、JPSS-1 エフェメリスの品質が十分であるため、シグナルの品質を満たす必要はありません。

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

 通信パスに基づいて、衛星部分を表す *antenna-downlink-demod-decode* 設定と、エンドポイントの詳細を定義するデータフローエンドポイントグループを参照する *dataflow-endpoint* 設定を定義する必要があります。

**注記**  
 `DemodulationConfig`、、および の値を設定する方法の詳細については`DecodeConfig`、「」を参照してください[アンテナダウンリンク復調デコード設定](how-it-works.config.md#how-it-works.config-antenna-downlink-demod-decode)。

```
  # The AWS Ground Station Antenna Downlink Config that defines the frequency spectrum used to
  # downlink data from your satellite.
  JpssDownlinkDemodDecodeAntennaConfig:
    Type: AWS::GroundStation::Config
    Properties:
      Name: "JPSS Downlink Demod Decode Antenna Config"
      ConfigData:
        AntennaDownlinkDemodDecodeConfig:
          SpectrumConfig:
            CenterFrequency:
              Value: 7812
              Units: "MHz"
            Polarization: "RIGHT_HAND"
            Bandwidth:
              Value: 30
              Units: "MHz"
          DemodulationConfig:
            UnvalidatedJSON: '{
              "type":"QPSK",
              "qpsk":{
                "carrierFrequencyRecovery":{
                  "centerFrequency":{
                    "value":7812,
                    "units":"MHz"
                  },
                  "range":{
                    "value":250,
                    "units":"kHz"
                  }
                },
                "symbolTimingRecovery":{
                  "symbolRate":{
                    "value":15,
                    "units":"Msps"
                  },
                  "range":{
                    "value":0.75,
                    "units":"ksps"
                  },
                  "matchedFilter":{
                    "type":"ROOT_RAISED_COSINE",
                    "rolloffFactor":0.5
                  }
                }
              }
            }'
          DecodeConfig:
            UnvalidatedJSON: '{
              "edges":[
                {
                  "from":"I-Ingress",
                  "to":"IQ-Recombiner"
                },
                {
                  "from":"Q-Ingress",
                  "to":"IQ-Recombiner"
                },
                {
                  "from":"IQ-Recombiner",
                  "to":"CcsdsViterbiDecoder"
                },
                {
                  "from":"CcsdsViterbiDecoder",
                  "to":"NrzmDecoder"
                },
                {
                  "from":"NrzmDecoder",
                  "to":"UncodedFramesEgress"
                }
              ],
              "nodeConfigs":{
                "I-Ingress":{
                  "type":"CODED_SYMBOLS_INGRESS",
                  "codedSymbolsIngress":{
                    "source":"I"
                  }
                },
                "Q-Ingress":{
                  "type":"CODED_SYMBOLS_INGRESS",
                  "codedSymbolsIngress":{
                    "source":"Q"
                  }
                },
                "IQ-Recombiner":{
                  "type":"IQ_RECOMBINER"
                },
                "CcsdsViterbiDecoder":{
                  "type":"CCSDS_171_133_VITERBI_DECODER",
                  "ccsds171133ViterbiDecoder":{
                    "codeRate":"ONE_HALF"
                  }
                },
                "NrzmDecoder":{
                  "type":"NRZ_M_DECODER"
                },
                "UncodedFramesEgress":{
                  "type":"UNCODED_FRAMES_EGRESS"
                }
              }
            }'
```

```
  # The AWS Ground Station Dataflow Endpoint Config that defines the endpoint used to downlink data
  # from your satellite.
  DownlinkDemodDecodeEndpointConfig:
    Type: AWS::GroundStation::Config
    Properties:
      Name: "Aqua SNPP JPSS Downlink Demod Decode Endpoint Config"
      ConfigData:
        DataflowEndpointConfig:
          DataflowEndpointName: !Join [ "-" , [ !Ref "AWS::StackName" , "Downlink" ] ]
          DataflowEndpointRegion: !Ref AWS::Region
```

## AWS Ground Station ミッションプロファイル
<a name="examples.pbs-dataflow-endpoint-demod-decode.mission-profile"></a>

 このセクションでは[ミッションプロファイルを作成する](getting-started.step4.md)、 ユーザーガイドについて説明します。

 関連付けられた設定ができたので、それらを使用してデータフローを構築できます。残りのパラメータにはデフォルトを使用します。

```
  # The AWS Ground Station Mission Profile that groups the above configurations to define how to
  # uplink and downlink data to your satellite.
  SnppJpssMissionProfile:
    Type: AWS::GroundStation::MissionProfile
    Properties:
      Name: "37849 SNPP And 43013 JPSS"
      ContactPrePassDurationSeconds: 120
      ContactPostPassDurationSeconds: 60
      MinimumViableContactDurationSeconds: 180
      TrackingConfigArn: !Ref TrackingConfig
      DataflowEdges:
        - Source: !Join [ "/", [ !Ref JpssDownlinkDemodDecodeAntennaConfig, "UncodedFramesEgress" ] ]
          Destination: !Ref DownlinkDemodDecodeEndpointConfig
```

## まとめる
<a name="examples.pbs-dataflow-endpoint-demod-decode.putting-it-together"></a>

 上記のリソースを使用すると、オンボーディングされた のいずれかからの同期データ配信のために JPSS-1 コンタクトをスケジュールできるようになりました AWS Ground Station [AWS Ground Station ロケーション](aws-ground-station-antenna-locations.md)。

 以下は、このセクションで説明されているすべてのリソースを 1 つの CloudFormation テンプレートにまとめた完全なテンプレートです。このテンプレートは で直接使用できます CloudFormation。

 という名前の CloudFormation テンプレート`AquaSnppJpss.yml`は、Aqua、SNPP、および JPSS-1/NOAA-20 衛星のデータ受信を開始するためのクイックアクセスを提供するように設計されています。これには、Amazon EC2 インスタンスと、問い合わせをスケジュールし、復調およびデコードされたダイレクトブロードキャストデータを受信するために必要な 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.yml .
```

 ブラウザで以下の URL に移動して、テンプレートをコンソールで表示およびダウンロードできます。

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

 次のリンク CloudFormation を使用して、 でテンプレートを直接指定できます。

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

**テンプレートではどのような追加リソースが定義されていますか？**

`AquaSnppJpss` テンプレートには、以下の追加リソースが含まれています。
+ （オプション) **CloudWatch Event Triggers** - AWS Lambda 問い合わせの AWS Ground Station 前後に によって送信された CloudWatch Events を使用してトリガーされる関数。 AWS Lambda 関数は、レシーバーインスタンスを起動し、オプションで停止します。
+ (オプション) **コンタクトの EC2 検証** - Lambda を使用して SNS 通知でコンタクトに Amazon EC2 インスタンスの検証システムをセットアップするオプション。現在の使用状況によっては、料金が発生する可能性があることに注意してください。
+  **Ground Station Amazon マシンイメージ取得 Lambda** - インスタンスにインストールされているソフトウェアと任意の AMI を選択するオプション。ソフトウェアのオプションは、`DDX 2.6.2 Only` と `DDX 2.6.2 with qRadio 3.6.0` です。広帯域 DigIF データ配信と AWS Ground Station エージェントを使用する場合は、「」を参照してください[AWS Ground Station エージェント (広帯域) を利用するパブリックブロードキャスト衛星](examples.pbs-agent.md)。これらのオプションは、追加のソフトウェア更新プログラムおよび機能がリリースされるにつれて引き続き拡張されます。
+  **追加のミッションプロファイル** - 追加のパブリックブロードキャスト衛星 (Aqua、SNPP、Terra) のミッションプロファイル。
+  **追加のアンテナダウンリンク設定** - 追加のパブリックブロードキャスト衛星 (Aqua、SNPP、Terra) のアンテナダウンリンク設定。

 このテンプレートでは衛星の値とパラメータが入力済みです。これらのパラメータを使用すると、これらの衛星で AWS Ground Station すぐに を簡単に使用できます。このテンプレートを使用する AWS Ground Station ときに を使用するには、独自の値を設定する必要はありません。ただし、値をカスタマイズして、ユースケースに合わせてテンプレートを使用することもできます。

 **データはどこで受信できますか?**

 データフローエンドポイントグループは、テンプレートで作成されるレシーバーインスタンスのネットワークインターフェイスを使用するように設定されます。レシーバーインスタンスは、データフローエンドポイントアプリケーションを使用して、データフローエンドポイントで定義されたポート AWS Ground Station で からデータストリームを受信します。受信すると、受信側インスタンスのループバックアダプターの UDP ポート 50000 を介してデータを消費できるようになります。データフローエンドポイントグループの設定の詳細については、[「AWS::GroundStation::DataflowEndpointGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-groundstation-dataflowendpointgroup.html)」を参照してください。