class_docstr: Tests for 'get_satpos'.
class_docstr_tok: ["Tests","for","'get_satpos","'","."]
docstr: Test getting the satellite position.
docstr_tok: ["Test","getting","the","satellite","position","."]
code: def test_get_satpos(
      self, included_prefixes, preference, expected_result
  ):
      """Test getting the satellite position."""
      all_orb_params = {
          "nadir_longitude": 1,
          "satellite_actual_longitude": 1.1,
          "satellite_nominal_longitude": 1.2,
          "projection_longitude": 1.3,
          "nadir_latitude": 2,
          "satellite_actual_latitude": 2.1,
          "satellite_nominal_latitude": 2.2,
          "projection_latitude": 2.3,
          "satellite_actual_altitude": 3,
          "satellite_nominal_altitude": 3.1,
          "projection_altitude": 3.2,
      }
      orb_params = {
          key: value
          for key, value in all_orb_params.items()
          if any(in_prefix in key for in_prefix in included_prefixes)
      }
      data_arr = xr.DataArray(
          (), attrs={"orbital_parameters": orb_params}
      )
  
      with warnings.catch_warnings(record=True) as caught_warnings:
          lon, lat, alt = get_satpos(data_arr, preference=preference)
      has_satpos_warnings = any(
          "using projection" in str(msg.message)
          for msg in caught_warnings
      )
      expect_warning = (
          included_prefixes == ("projection_",)
          and preference != "projection"
      )
      if expect_warning:
          assert has_satpos_warnings
      else:
          assert not has_satpos_warnings
      assert (lon, lat, alt) == expected_result
  
imports: from __future__ import annotations
  import datetime
  import logging
  import typing
  import unittest
  import warnings
  from math import sqrt
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  import xarray
  from satpy.tests.utils import xfail_skyfield_unstable_numpy2
  from satpy.utils import angle2xyz, get_legacy_chunk_size, get_satpos, import_error_helper, lonlat2xyz, proj_units_to_meters, xyz2angle, xyz2lonlat
label_desc: Use image node_id 1 for calling the TestGetSatPos obj's underlying member method code with example usage: obj.test_get_satpos(included_prefixes, preference, expected_result) without return types