sensor_name: visir/seviri

modifiers:
  sunz_corrected:
    modifier: !!python/name:satpy.modifiers.SunZenithCorrector

  co2_corrected:
    modifier: !!python/name:satpy.modifiers.CO2Corrector
    sensor: [seviri]
    prerequisites:
    - IR_108
    - IR_134

  rayleigh_corrected:
    modifier: !!python/name:satpy.modifiers.PSPRayleighReflectance
    atmosphere: us-standard
    aerosol_type: rayleigh_only
    prerequisites:
    - name: VIS006
      modifiers: [sunz_corrected]
    optional_prerequisites:
    - satellite_azimuth_angle
    - satellite_zenith_angle
    - solar_azimuth_angle
    - solar_zenith_angle

composites:

  ct_masked_ir:
    compositor: !!python/name:satpy.composites.MaskingCompositor
    prerequisites:
    - IR_108
    - ct
    standard_name: ct_masked_ir
    conditions:
      - method: equal
        value: 0
        transparency: 100
      - method: equal
        value: 1
        transparency: 100
      - method: equal
        value: 2
        transparency: 100
      - method: equal
        value: 3
        transparency: 100
      - method: equal
        value: 4
        transparency: 100
      - method: equal
        value: 10
        transparency: 35

  nwc_geo_ct_masked_ir:
    compositor: !!python/name:satpy.composites.MaskingCompositor
    prerequisites:
    - IR_108
    - ct
    standard_name: nwc_geo_ct_masked_ir
    # Default is opaque (transparency = 0)
    conditions:
      - method: equal
        value: Cloud-free_land
        transparency: 100
      - method: equal
        value: Cloud-free_sea
        transparency: 100
      - method: equal
        value: Snow_over_land
        transparency: 100
      - method: equal
        value: Sea_ice
        transparency: 100
      - method: equal
        value: Fractional_clouds
        transparency: 45
      - method: equal
        value: High_semitransparent_thin_clouds
        transparency: 50
      - method: equal
        value: High_semitransparent_above_snow_ice
        transparency: 60

  cloudtop:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - name: IR_039
      modifiers: [co2_corrected]
    - IR_108
    - IR_120
    standard_name: cloudtop

  cloudtop_daytime:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - name: IR_039
      modifiers: [nir_emissive]
    - IR_108
    - IR_120
    standard_name: cloudtop

  convection:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - compositor: !!python/name:satpy.composites.DifferenceCompositor
      prerequisites:
        - WV_062
        - WV_073
    - compositor: !!python/name:satpy.composites.DifferenceCompositor
      prerequisites:
        - name: IR_039
          modifiers: [co2_corrected]
        - IR_108
    - compositor: !!python/name:satpy.composites.DifferenceCompositor
      prerequisites:
        - IR_016
        - VIS006
    standard_name: convection

  night_fog:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - compositor: !!python/name:satpy.composites.DifferenceCompositor
      prerequisites:
      - IR_120
      - IR_108
    - compositor: !!python/name:satpy.composites.DifferenceCompositor
      prerequisites:
      - IR_108
      - name: IR_039
        modifiers: [co2_corrected]
    - IR_108
    standard_name: night_fog

  snow:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - name: VIS008
      modifiers: [sunz_corrected]
    - name: IR_016
      modifiers: [sunz_corrected]
    - name: IR_039
      modifiers: [nir_reflectance]
    standard_name: snow

  day_microphysics:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - name: VIS008
      modifiers: [sunz_corrected]
    - name: IR_039
      modifiers: [nir_reflectance]
    - IR_108
    standard_name: day_microphysics

  day_microphysics_winter:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - name: VIS008
      modifiers: [sunz_corrected]
    - name: IR_039
      modifiers: [nir_reflectance]
    - IR_108
    standard_name: day_microphysics_winter

  natural_color_raw:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - IR_016
    - VIS008
    - VIS006
    standard_name: natural_color

  natural_color:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - name: IR_016
      modifiers: [sunz_corrected]
    - name: VIS008
      modifiers: [sunz_corrected]
    - name: VIS006
      modifiers: [sunz_corrected]
    standard_name: natural_color

  natural_color_nocorr:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - name: IR_016
    - name: VIS008
    - name: VIS006
    standard_name: natural_color

  fog:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - compositor: !!python/name:satpy.composites.DifferenceCompositor
      prerequisites:
      - IR_120
      - IR_108
    - compositor: !!python/name:satpy.composites.DifferenceCompositor
      prerequisites:
      - IR_108
      - IR_087
    - IR_108
    standard_name: fog

  cloudmask:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - cma
    - cma_pal
    standard_name: cloudmask

  cloudtype:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - ct
    - ct_pal
    standard_name: cloudtype

  cloud_top_height:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - ctth_alti
    - ctth_alti_pal
    standard_name: cloud_top_height

  cloud_top_pressure:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - ctth_pres
    - ctth_pres_pal
    standard_name: cloud_top_pressure

  cloud_top_temperature:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - ctth_tempe
    - ctth_tempe_pal
    standard_name: cloud_top_temperature

  cloud_top_phase:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - cmic_phase
    - cmic_phase_pal
    standard_name: cloud_top_phase

  cloud_drop_effective_radius:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - cmic_reff
    - cmic_reff_pal
    standard_name: cloud_drop_effective_radius

  cloud_optical_thickness:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - cmic_cot
    - cmic_cot_pal
    standard_name: cloud_optical_thickness

  cloud_liquid_water_path:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - cmic_lwp
    - cmic_lwp_pal
    standard_name: cloud_liquid_water_path

  cloud_ice_water_path:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - cmic_iwp
    - cmic_iwp_pal
    standard_name: cloud_ice_water_path

  precipitation_probability:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - pc
    - pc_pal
    standard_name: precipitation_probability

  convective_rain_rate:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - crr
    - crr_pal
    standard_name: convective_rain_rate

  convective_precipitation_hourly_accumulation:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - crr_accum
    - crr_pal
    standard_name: convective_precipitation_hourly_accumulation

  total_precipitable_water:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - ishai_tpw
    - ishai_tpw_pal
    standard_name: total_precipitable_water

  showalter_index:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - ishai_shw
    - ishai_shw_pal
    standard_name: showalter_index

  lifted_index:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - ishai_li
    - ishai_li_pal
    standard_name: lifted_index

  convection_initiation_prob30:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - ci_prob30
    - ci_pal
    standard_name: convection_initiation_prob30

  convection_initiation_prob60:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - ci_prob60
    - ci_pal
    standard_name: convection_initiation_prob60

  convection_initiation_prob90:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - ci_prob90
    - ci_pal
    standard_name: convection_initiation_prob90

  asii_prob:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - asii_turb_trop_prob
    - asii_turb_prob_pal
    standard_name: asii_prob

  rdt_cell_type:
    compositor: !!python/name:satpy.composites.PaletteCompositor
    prerequisites:
    - MapCellCatType
    - MapCellCatType_pal
    standard_name: rdt_cell_type

  realistic_colors:
    compositor: !!python/name:satpy.composites.RealisticColors
    standard_name: realistic_colors
    prerequisites:
      - name: VIS006
        modifiers: [sunz_corrected]
      - name: VIS008
        modifiers: [sunz_corrected]
      - name: HRV
        modifiers: [sunz_corrected]

  ir_overview:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - name: IR_039
      modifiers: [co2_corrected]
    - IR_108
    - IR_120
    standard_name: ir_overview

  overview_raw:
    compositor: !!python/name:satpy.composites.RGBCompositor
    prerequisites:
    - VIS006
    - VIS008
    - IR_108
    standard_name: overview
  overview:
    compositor: !!python/name:satpy.composites.RGBCompositor
    prerequisites:
    - name: VIS006
      modifiers: [sunz_corrected]
    - name: VIS008
      modifiers: [sunz_corrected]
    - IR_108
    standard_name: overview

  green_snow:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - name: IR_016
    - name: VIS006
    - name: IR_108
    standard_name: green_snow

  colorized_ir_clouds:
    compositor: !!python/name:satpy.composites.SingleBandCompositor
    prerequisites:
      - name: 'IR_108'
    standard_name: colorized_ir_clouds

  vis_sharpened_ir:
    compositor: !!python/name:satpy.composites.LuminanceSharpeningCompositor
    standard_name: vis_sharpened_ir
    prerequisites:
      - name: 'HRV'
        modifiers: [sunz_corrected]
      - name: colorized_ir_clouds

  ir_sandwich:
    compositor: !!python/name:satpy.composites.SandwichCompositor
    standard_name: ir_sandwich
    prerequisites:
      - name: 'HRV'
        modifiers: [sunz_corrected]
      - name: colorized_ir_clouds

  natural_enh:
    compositor: !!python/name:satpy.composites.NaturalEnh
    standard_name: natural_enh
    ch16_w: 1.3
    ch08_w: 2.5
    ch06_w: 2.2
    prerequisites:
    - name: IR_016
      modifiers: [sunz_corrected]
    - name: VIS008
      modifiers: [sunz_corrected]
    - name: VIS006
      modifiers: [sunz_corrected]

  hrv_clouds:
    compositor: !!python/name:satpy.composites.GenericCompositor
    standard_name: hrv_clouds
    prerequisites:
      - name: HRV
        modifiers: [sunz_corrected]
      - name: HRV
        modifiers: [sunz_corrected]
      - IR_108
  hrv_fog:
    compositor: !!python/name:satpy.composites.GenericCompositor
    standard_name: hrv_fog
    prerequisites:
      - name: IR_016
        modifiers: [sunz_corrected]
      - name: HRV
        modifiers: [sunz_corrected]
      - name: HRV
        modifiers: [sunz_corrected]

  hrv_severe_storms:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
    - name: HRV
      modifiers: [sunz_corrected]
    - name: HRV
      modifiers: [sunz_corrected]
    - compositor: !!python/name:satpy.composites.DifferenceCompositor
      prerequisites:
      - wavelength: 10.8
      - wavelength: 3.9
    standard_name: hrv_severe_storms

  hrv_severe_storms_masked:
    compositor: !!python/name:satpy.composites.MaskingCompositor
    conditions:
    # Data will be masked where SZA corrected HRV data is less than 70 %, or NaN
    - method: less
      value: 75
      transparency: 70
    - method: less
      value: 70
      transparency: 100
    - method: isnan
      transparency: 100
    prerequisites:
    # Composite
    - name: hrv_severe_storms
    # Data used in masking
    - name: HRV
      modifiers: [sunz_corrected]
    standard_name: hrv_severe_storms_masked

  natural_with_night_fog:
    compositor: !!python/name:satpy.composites.DayNightCompositor
    standard_name: natural_with_night_fog
    prerequisites:
      - natural_color
      - night_fog

  natural_color_with_night_ir:
    compositor: !!python/name:satpy.composites.DayNightCompositor
    standard_name: natural_color_with_night_ir
    prerequisites:
      - natural_color
      - night_ir_with_background

  natural_color_raw_with_night_ir:
    compositor: !!python/name:satpy.composites.DayNightCompositor
    standard_name: natural_color_with_night_ir
    lim_low: 80
    lim_high: 90
    prerequisites:
      - natural_color
      - cloudtop

  natural_color_with_night_ir_hires:
    compositor: !!python/name:satpy.composites.DayNightCompositor
    standard_name: natural_color_with_night_ir_hires
    prerequisites:
      - natural_color
      - night_ir_with_background_hires

  natural_enh_with_night_ir:
    compositor: !!python/name:satpy.composites.DayNightCompositor
    standard_name: natural_color_with_night_ir
    prerequisites:
      - natural_enh
      - night_ir_with_background

  natural_enh_with_night_ir_hires:
    compositor: !!python/name:satpy.composites.DayNightCompositor
    standard_name: natural_color_with_night_ir_hires
    prerequisites:
      - natural_enh
      - night_ir_with_background_hires

  night_ir_alpha:
    compositor: !!python/name:satpy.composites.GenericCompositor
    standard_name: night_ir_alpha
    prerequisites:
      - name: IR_039
      - name: IR_108
      - name: IR_120
      - name: IR_108

  night_ir_with_background:
    compositor: !!python/name:satpy.composites.BackgroundCompositor
    standard_name: night_ir_with_background
    prerequisites:
      - night_ir_alpha
      - _night_background

  night_ir_with_background_hires:
    compositor: !!python/name:satpy.composites.BackgroundCompositor
    standard_name: night_ir_with_background
    prerequisites:
      - night_ir_alpha
      - _night_background_hires

  _vis06:
    compositor: !!python/name:satpy.composites.GenericCompositor
    standard_name: vis06
    prerequisites:
      - name: VIS006
        modifiers: [sunz_corrected]

  _hrv:
    compositor: !!python/name:satpy.composites.GenericCompositor
    standard_name: hrv
    prerequisites:
      - name: HRV
        modifiers: [sunz_corrected]

  _vis06_filled_hrv:
    compositor: !!python/name:satpy.composites.Filler
    standard_name: vis06_filled_hrv
    prerequisites:
    - _hrv
    - _vis06

  _ir108:
    compositor: !!python/name:satpy.composites.GenericCompositor
    standard_name: ir108
    prerequisites:
      - name: IR_108

  _vis_with_ir:
    compositor: !!python/name:satpy.composites.DayNightCompositor
    standard_name: vis_with_ir
    lim_low: 85.0
    lim_high: 88.0
    prerequisites:
      - _vis06_filled_hrv
      - _ir108

  vis_with_ir_cloud_overlay:
    compositor: !!python/name:satpy.composites.MaskingCompositor
    standard_name: vis_with_ir_cloud_overlay
    prerequisites:
    - _vis_with_ir
    - ct
    # Default is opaque (transparency = 0)
    conditions:
      - method: equal
        value: Cloud-free_land
        transparency: 100
      - method: equal
        value: Cloud-free_sea
        transparency: 100
      - method: equal
        value: Snow_over_land
        transparency: 100
      - method: equal
        value: Sea_ice
        transparency: 100
      - method: equal
        value: Fractional_clouds
        transparency: 45
      - method: equal
        value: High_semitransparent_thin_clouds
        transparency: 50
      - method: equal
        value: High_semitransparent_above_snow_ice
        transparency: 60
