reader:
  name: ici_l1b_nc
  short_name: ICI L1B RAD NetCDF4
  long_name: EPS-SG ICI L1B Radiance (NetCDF4)
  description: >
    Reader for EUMETSAT EPS-SG Ice Cloud Imager Level 1B Radiance files in NetCDF4.
  status: Beta
  sensors: [ici]
  reader: !!python/name:satpy.readers.yaml_reader.FileYAMLReader

  data_identification_keys:
    name:
      required: true
    frequency_double_sideband:
      type: !!python/name:satpy.readers.pmw_channels_definitions.FrequencyDoubleSideBand
    polarization:
      enum:
        - H
        - V
    calibration:
      enum:
        - brightness_temperature
        - radiance
      transitive: true

file_types:
  # EUMETSAT EPSG-SG Ice Cloud Imager Level 1B Radiance files in NetCDF4 format
  nc_ici_l1b_rad:
    file_reader: !!python/name:satpy.readers.ici_l1b_nc.IciL1bNCFileHandler
    file_patterns: ['W_XX-EUMETSAT-Darmstadt,SAT,{spacecraft_name:s}-ICI-1B-RAD_C_EUMT_{creation_time:%Y%m%d%H%M%S}_{mission_type:s}_{environment:s}_{sensing_start_time:%Y%m%d%H%M%S}_{sensing_end_time:%Y%m%d%H%M%S}_{disposition_mode:s}_{processing_mode:s}____.nc']
    longitude: data/navigation_data/longitude
    latitude: data/navigation_data/latitude
    observation_zenith: data/navigation_data/ici_oza
    observation_azimuth: data/navigation_data/ici_azimuth
    solar_zenith: data/navigation_data/ici_solar_zenith_angle
    solar_azimuth: data/navigation_data/ici_solar_azimuth_angle
    orthorect: True

datasets:

# --- Coordinates ---
  lon_pixels_horn_1:
    name: lon_pixels_horn_1
    file_type: nc_ici_l1b_rad
    file_key: longitude
    orthorect_data: data/navigation_data/delta_longitude
    standard_name: longitude
    n_horns: 0

  lat_pixels_horn_1:
    name: lat_pixels_horn_1
    file_type: nc_ici_l1b_rad
    file_key: latitude
    orthorect_data: data/navigation_data/delta_latitude
    standard_name: latitude
    n_horns: 0

  lon_pixels_horn_2:
    name: lon_pixels_horn_2
    file_type: nc_ici_l1b_rad
    file_key: longitude
    orthorect_data: data/navigation_data/delta_longitude
    standard_name: longitude
    n_horns: 1

  lat_pixels_horn_2:
    name: lat_pixels_horn_2
    file_type: nc_ici_l1b_rad
    file_key: latitude
    orthorect_data: data/navigation_data/delta_latitude
    standard_name: latitude
    n_horns: 1

  lon_pixels_horn_3:
    name: lon_pixels_horn_3
    file_type: nc_ici_l1b_rad
    file_key: longitude
    orthorect_data: data/navigation_data/delta_longitude
    standard_name: longitude
    n_horns: 2

  lat_pixels_horn_3:
    name: lat_pixels_horn_3
    file_type: nc_ici_l1b_rad
    file_key: latitude
    orthorect_data: data/navigation_data/delta_latitude
    standard_name: latitude
    n_horns: 3

  lon_pixels_horn_4:
    name: lon_pixels_horn_4
    file_type: nc_ici_l1b_rad
    file_key: longitude
    orthorect_data: data/navigation_data/delta_longitude
    standard_name: longitude
    n_horns: 3

  lat_pixels_horn_4:
    name: lat_pixels_horn_4
    file_type: nc_ici_l1b_rad
    file_key: latitude
    orthorect_data: data/navigation_data/delta_latitude
    standard_name: latitude
    n_horns: 3

  lon_pixels_horn_5:
    name: lon_pixels_horn_5
    file_type: nc_ici_l1b_rad
    file_key: longitude
    orthorect_data: data/navigation_data/delta_longitude
    standard_name: longitude
    n_horns: 4

  lat_pixels_horn_5:
    name: lat_pixels_horn_5
    file_type: nc_ici_l1b_rad
    file_key: latitude
    orthorect_data: data/navigation_data/delta_latitude
    standard_name: latitude
    n_horns: 4

  lon_pixels_horn_6:
    name: lon_pixels_horn_6
    file_type: nc_ici_l1b_rad
    file_key: longitude
    orthorect_data: data/navigation_data/delta_longitude
    standard_name: longitude
    n_horns: 5

  lat_pixels_horn_6:
    name: lat_pixels_horn_6
    file_type: nc_ici_l1b_rad
    file_key: latitude
    orthorect_data: data/navigation_data/delta_latitude
    standard_name: latitude
    n_horns: 5

  lon_pixels_horn_7:
    name: lon_pixels_horn_7
    file_type: nc_ici_l1b_rad
    file_key: longitude
    orthorect_data: data/navigation_data/delta_longitude
    standard_name: longitude
    n_horns: 6

  lat_pixels_horn_7:
    name: lat_pixels_horn_7
    file_type: nc_ici_l1b_rad
    file_key: latitude
    orthorect_data: data/navigation_data/delta_latitude
    standard_name: latitude
    n_horns: 6

  longitude_ssp:
    name: longitude_ssp
    file_type: nc_ici_l1b_rad
    file_key: data/navigation_data/longitude_ssp
    standard_name: longitude

  latitude_ssp:
    name: latitude_ssp
    file_type: nc_ici_l1b_rad
    file_key: data/navigation_data/latitude_ssp
    standard_name: latitude

# --- Measurement data ---
  '1':
    name: '1'
    file_type: nc_ici_l1b_rad
    file_key: data/measurement_data/ici_radiance_183
    coordinates: [lon_pixels_horn_1, lat_pixels_horn_1]
    n_183: 0
    chan_index: 0
    frequency_double_sideband:
      central: 183.31
      side: 7.0
      bandwidth: 2.0
      unit: GHz
    polarization: V
    calibration:
      radiance:
        standard_name: toa_outgoing_radiance_per_unit_wavelength
        units: "mWm^-2sr^-1(cm^-1)^-1"
      brightness_temperature:
        standard_name: toa_brightness_temperature
        units: K

  '2':
    name: '2'
    file_type: nc_ici_l1b_rad
    file_key: data/measurement_data/ici_radiance_183
    coordinates: [lon_pixels_horn_1, lat_pixels_horn_1]
    n_183: 1
    chan_index: 1
    frequency_double_sideband:
      central: 183.31
      side: 3.4
      bandwidth: 1.5
      unit: GHz
    polarization: V
    calibration:
      radiance:
        standard_name: toa_outgoing_radiance_per_unit_wavelength
        units: "mWm^-2sr^-1(cm^-1)^-1"
      brightness_temperature:
        standard_name: toa_brightness_temperature
        units: K

  '3':
    name: '3'
    file_type: nc_ici_l1b_rad
    file_key: data/measurement_data/ici_radiance_183
    coordinates: [lon_pixels_horn_1, lat_pixels_horn_1]
    n_183: 2
    chan_index: 2
    frequency_double_sideband:
      central: 183.31
      side: 2.0
      bandwidth: 1.5
      unit: GHz
    polarization: V
    calibration:
      radiance:
        standard_name: toa_outgoing_radiance_per_unit_wavelength
        units: "mWm^-2sr^-1(cm^-1)^-1"
      brightness_temperature:
        standard_name: toa_brightness_temperature
        units: K

  '4':
    name: '4'
    file_type: nc_ici_l1b_rad
    file_key: data/measurement_data/ici_radiance_243
    coordinates: [lon_pixels_horn_2, lat_pixels_horn_2]
    n_243: 0
    chan_index: 3
    frequency_double_sideband:
      central: 243.2
      side: 2.5
      bandwidth: 3.0
      unit: GHz
    polarization: V
    calibration:
      radiance:
        standard_name: toa_outgoing_radiance_per_unit_wavelength
        units: "mWm^-2sr^-1(cm^-1)^-1"
      brightness_temperature:
        standard_name: toa_brightness_temperature
        units: K

  '5':
    name: '5'
    file_type: nc_ici_l1b_rad
    file_key: data/measurement_data/ici_radiance_243
    coordinates: [lon_pixels_horn_3, lat_pixels_horn_3]
    n_243: 1
    chan_index: 4
    frequency_double_sideband:
      central: 243.2
      side: 2.5
      bandwidth: 3.0
      unit: GHz
    polarization: H
    calibration:
      radiance:
        standard_name: toa_outgoing_radiance_per_unit_wavelength
        units: "mWm^-2sr^-1(cm^-1)^-1"
      brightness_temperature:
        standard_name: toa_brightness_temperature
        units: K

  '6':
    name: '6'
    file_type: nc_ici_l1b_rad
    file_key: data/measurement_data/ici_radiance_325
    coordinates: [lon_pixels_horn_4, lat_pixels_horn_4]
    n_325: 0
    chan_index: 5
    frequency_double_sideband:
      central: 325.15
      side: 9.5
      bandwidth: 3.0
      unit: GHz
    polarization: V
    calibration:
      radiance:
        standard_name: toa_outgoing_radiance_per_unit_wavelength
        units: "mWm^-2sr^-1(cm^-1)^-1"
      brightness_temperature:
        standard_name: toa_brightness_temperature
        units: K

  '7':
    name: '7'
    file_type: nc_ici_l1b_rad
    file_key: data/measurement_data/ici_radiance_325
    coordinates: [lon_pixels_horn_4, lat_pixels_horn_4]
    n_325: 1
    chan_index: 6
    frequency_double_sideband:
      central: 325.15
      side: 3.5
      bandwidth: 2.4
      unit: GHz
    polarization: V
    calibration:
      radiance:
        standard_name: toa_outgoing_radiance_per_unit_wavelength
        units: "mWm^-2sr^-1(cm^-1)^-1"
      brightness_temperature:
        standard_name: toa_brightness_temperature
        units: K

  '8':
    name: '8'
    file_type: nc_ici_l1b_rad
    file_key: data/measurement_data/ici_radiance_325
    coordinates: [lon_pixels_horn_4, lat_pixels_horn_4]
    n_325: 2
    chan_index: 6
    frequency_double_sideband:
      central: 325.15
      side: 1.5
      bandwidth: 1.6
      unit: GHz
    polarization: V
    calibration:
      radiance:
        standard_name: toa_outgoing_radiance_per_unit_wavelength
        units: "mWm^-2sr^-1(cm^-1)^-1"
      brightness_temperature:
        standard_name: toa_brightness_temperature
        units: K

  '9':
    name: '9'
    file_type: nc_ici_l1b_rad
    file_key: data/measurement_data/ici_radiance_448
    coordinates: [lon_pixels_horn_5, lat_pixels_horn_5]
    n_448: 0
    chan_index: 8
    frequency_double_sideband:
      central: 448.0
      side: 7.2
      bandwidth: 3.0
      unit: GHz
    polarization: V
    calibration:
      radiance:
        standard_name: toa_outgoing_radiance_per_unit_wavelength
        units: "mWm^-2sr^-1(cm^-1)^-1"
      brightness_temperature:
        standard_name: toa_brightness_temperature
        units: K

  '10':
    name: '10'
    file_type: nc_ici_l1b_rad
    file_key: data/measurement_data/ici_radiance_448
    coordinates: [lon_pixels_horn_5, lat_pixels_horn_5]
    n_448: 1
    chan_index: 9
    frequency_double_sideband:
      central: 448.0
      side: 3.0
      bandwidth: 2.0
      unit: GHz
    polarization: V
    calibration:
      radiance:
        standard_name: toa_outgoing_radiance_per_unit_wavelength
        units: "mWm^-2sr^-1(cm^-1)^-1"
      brightness_temperature:
        standard_name: toa_brightness_temperature
        units: K

  '11':
    name: '11'
    file_type: nc_ici_l1b_rad
    file_key: data/measurement_data/ici_radiance_448
    coordinates: [lon_pixels_horn_5, lat_pixels_horn_5]
    n_448: 2
    chan_index: 10
    frequency_double_sideband:
      central: 448.0
      side: 1.4
      bandwidth: 1.2
      unit: GHz
    polarization: V
    calibration:
      radiance:
        standard_name: toa_outgoing_radiance_per_unit_wavelength
        units: "mWm^-2sr^-1(cm^-1)^-1"
      brightness_temperature:
        standard_name: toa_brightness_temperature
        units: K

  '12':
    name: '12'
    file_type: nc_ici_l1b_rad
    file_key: data/measurement_data/ici_radiance_664
    coordinates: [lon_pixels_horn_6, lat_pixels_horn_6]
    n_664: 0
    chan_index: 11
    frequency_double_sideband:
      central: 664.0
      side: 4.2
      bandwidth: 5.0
      unit: GHz
    polarization: V
    calibration:
      radiance:
        standard_name: toa_outgoing_radiance_per_unit_wavelength
        units: "mWm^-2sr^-1(cm^-1)^-1"
      brightness_temperature:
        standard_name: toa_brightness_temperature
        units: K

  '13':
    name: '13'
    file_type: nc_ici_l1b_rad
    file_key: data/measurement_data/ici_radiance_664
    coordinates: [lon_pixels_horn_7, lat_pixels_horn_7]
    n_664: 1
    chan_index: 12
    frequency_double_sideband:
      central: 664.0
      side: 4.2
      bandwidth: 5.0
      unit: GHz
    polarization: H
    calibration:
      radiance:
        standard_name: toa_outgoing_radiance_per_unit_wavelength
        units: "mWm^-2sr^-1(cm^-1)^-1"
      brightness_temperature:
        standard_name: toa_brightness_temperature
        units: K

  # --- Navigation data ---
  time_start_scan_utc:
    name: time_start_scan_utc
    standard_name: time_start_scan_utc
    file_type: nc_ici_l1b_rad
    file_key: data/navigation_data/time_start_scan_utc
    coordinates: [longitude_ssp, latitude_ssp]

  # --- Geometric data ---
  solar_zenith_horn_1:
    name: solar_zenith_horn_1
    standard_name: solar_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_zenith
    n_horns: 0
    coordinates: [lon_pixels_horn_1, lat_pixels_horn_1]

  solar_zenith_horn_2:
    name: solar_zenith_horn_2
    standard_name: solar_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_zenith
    n_horns: 1
    coordinates: [lon_pixels_horn_2, lat_pixels_horn_2]

  solar_zenith_horn_3:
    name: solar_zenith_horn_3
    standard_name: solar_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_zenith
    n_horns: 2
    coordinates: [lon_pixels_horn_3, lat_pixels_horn_3]

  solar_zenith_horn_4:
    name: solar_zenith_horn_4
    standard_name: solar_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_zenith
    n_horns: 3
    coordinates: [lon_pixels_horn_4, lat_pixels_horn_4]

  solar_zenith_horn_5:
    name: solar_zenith_horn_5
    standard_name: solar_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_zenith
    n_horns: 4
    coordinates: [lon_pixels_horn_5, lat_pixels_horn_5]

  solar_zenith_horn_6:
    name: solar_zenith_horn_6
    standard_name: solar_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_zenith
    n_horns: 5
    coordinates: [lon_pixels_horn_6, lat_pixels_horn_6]

  solar_zenith_horn_7:
    name: solar_zenith_horn_7
    standard_name: solar_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_zenith
    n_horns: 6
    coordinates: [lon_pixels_horn_7, lat_pixels_horn_7]

  solar_azimuth_horn_1:
    name: solar_azimuth_horn_1
    standard_name: solar_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_azimuth
    n_horns: 0
    coordinates: [lon_pixels_horn_1, lat_pixels_horn_1]

  solar_azimuth_horn_2:
    name: solar_azimuth_horn_2
    standard_name: solar_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_azimuth
    n_horns: 1
    coordinates: [lon_pixels_horn_2, lat_pixels_horn_2]

  solar_azimuth_horn_3:
    name: solar_azimuth_horn_3
    standard_name: solar_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_azimuth
    n_horns: 2
    coordinates: [lon_pixels_horn_3, lat_pixels_horn_3]

  solar_azimuth_horn_4:
    name: solar_azimuth_horn_4
    standard_name: solar_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_azimuth
    n_horns: 3
    coordinates: [lon_pixels_horn_4, lat_pixels_horn_4]

  solar_azimuth_horn_5:
    name: solar_azimuth_horn_5
    standard_name: solar_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_azimuth
    n_horns: 4
    coordinates: [lon_pixels_horn_5, lat_pixels_horn_5]

  solar_azimuth_horn_6:
    name: solar_azimuth_horn_6
    standard_name: solar_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_azimuth
    n_horns: 5
    coordinates: [lon_pixels_horn_6, lat_pixels_horn_6]

  solar_azimuth_horn_7:
    name: solar_azimuth_horn_7
    standard_name: solar_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: solar_azimuth
    n_horns: 6
    coordinates: [lon_pixels_horn_7, lat_pixels_horn_7]

  observation_zenith_horn_1:
    name: observation_zenith_horn_1
    standard_name: sensor_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_zenith
    n_horns: 0
    coordinates: [lon_pixels_horn_1, lat_pixels_horn_1]

  observation_zenith_horn_2:
    name: observation_zenith_horn_2
    standard_name: sensor_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_zenith
    n_horns: 1
    coordinates: [lon_pixels_horn_2, lat_pixels_horn_2]

  observation_zenith_horn_3:
    name: observation_zenith_horn_3
    standard_name: sensor_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_zenith
    n_horns: 2
    coordinates: [lon_pixels_horn_3, lat_pixels_horn_3]

  observation_zenith_horn_4:
    name: observation_zenith_horn_4
    standard_name: sensor_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_zenith
    n_horns: 3
    coordinates: [lon_pixels_horn_4, lat_pixels_horn_4]

  observation_zenith_horn_5:
    name: observation_zenith_horn_5
    standard_name: sensor_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_zenith
    n_horns: 4
    coordinates: [lon_pixels_horn_5, lat_pixels_horn_5]

  observation_zenith_horn_6:
    name: observation_zenith_horn_6
    standard_name: sensor_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_zenith
    n_horns: 5
    coordinates: [lon_pixels_horn_6, lat_pixels_horn_6]

  observation_zenith_horn_7:
    name: observation_zenith_horn_7
    standard_name: sensor_zenith_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_zenith
    n_horns: 6
    coordinates: [lon_pixels_horn_7, lat_pixels_horn_7]

  observation_azimuth_horn_1:
    name: observation_azimuth_horn_1
    standard_name: sensor_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_azimuth
    n_horns: 0
    coordinates: [lon_pixels_horn_1, lat_pixels_horn_1]

  observation_azimuth_horn_2:
    name: observation_azimuth_horn_2
    standard_name: sensor_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_azimuth
    n_horns: 1
    coordinates: [lon_pixels_horn_2, lat_pixels_horn_2]

  observation_azimuth_horn_3:
    name: observation_azimuth_horn_3
    standard_name: sensor_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_azimuth
    n_horns: 2
    coordinates: [lon_pixels_horn_3, lat_pixels_horn_3]

  observation_azimuth_horn_4:
    name: observation_azimuth_horn_4
    standard_name: sensor_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_azimuth
    n_horns: 3
    coordinates: [lon_pixels_horn_4, lat_pixels_horn_4]

  observation_azimuth_horn_5:
    name: observation_azimuth_horn_5
    standard_name: sensor_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_azimuth
    n_horns: 4
    coordinates: [lon_pixels_horn_5, lat_pixels_horn_5]

  observation_azimuth_horn_6:
    name: observation_azimuth_horn_6
    standard_name: sensor_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_azimuth
    n_horns: 5
    coordinates: [lon_pixels_horn_6, lat_pixels_horn_6]

  observation_azimuth_horn_7:
    name: observation_azimuth_horn_5
    standard_name: sensor_azimuth_angle
    file_type: nc_ici_l1b_rad
    file_key: observation_azimuth
    n_horns: 6
    coordinates: [lon_pixels_horn_7, lat_pixels_horn_7]
