Skip to content

Commit

Permalink
Merge pull request #59 from ninahakansson/metimage
Browse files Browse the repository at this point in the history
Metimage
  • Loading branch information
adybbroe authored Jan 19, 2024
2 parents ae0a967 + 8eb6b4c commit fc4314d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
8 changes: 5 additions & 3 deletions nwcsafpps_runner/l1c_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,23 @@
from level1c4pps.viirs2pps_lib import process_one_scene as process_viirs
from level1c4pps.modis2pps_lib import process_one_scene as process_modis
from level1c4pps.avhrr2pps_lib import process_one_scene as process_avhrr
from level1c4pps.metimage2pps_lib import process_one_scene as process_metimage

from nwcsafpps_runner.config import get_config_from_yamlfile as get_config

LOG = logging.getLogger(__name__)

SUPPORTED_SERVICE_NAMES = ['seviri-l1c', 'viirs-l1c', 'avhrr-l1c', 'modis-l1c']
SUPPORTED_SERVICE_NAMES = ['seviri-l1c', 'viirs-l1c', 'avhrr-l1c', 'modis-l1c', 'metimage-l1c']

SUPPORTED_SATELLITES = {'seviri-l1c':
['meteosat-8', 'meteosat-9', 'meteosat-10', 'meteosat-11'],
SUPPORTED_SATELLITES = {'seviri-l1c': ['meteosat-8', 'meteosat-9', 'meteosat-10', 'meteosat-11'],
'metimage-l1c': ['metop-sg-a1', 'metop-sg-a2', 'metop-sg-a3'],
'viirs-l1c': ['suomi-npp', 'noaa-20', 'noaa-21', 'noaa-22'],
'avhrr-l1c': ['noaa-19', 'noaa-18', 'metop-b', 'metop-a', 'metop-c'],
'modis-l1c': ['eos-terra', 'eos-aqua']
}

LVL1C_PROCESSOR_MAPPING = {'seviri-l1c': process_seviri,
'metimage-l1c': process_metimage,
'viirs-l1c': process_viirs,
'modis-l1c': process_modis,
'avhrr-l1c': process_avhrr}
Expand Down
1 change: 1 addition & 0 deletions nwcsafpps_runner/tests/test_level1c_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def test_check_service_is_supported(self):
check_service_is_supported('viirs-l1c')
check_service_is_supported('avhrr-l1c')
check_service_is_supported('modis-l1c')
check_service_is_supported('metimage-l1c')

self.assertRaises(ServiceNameNotSupported, check_service_is_supported, 'seviri')

Expand Down
19 changes: 16 additions & 3 deletions nwcsafpps_runner/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,20 @@ class FindTimeControlFileError(Exception):
'Metop-B', 'Metop-A', 'Metop-C']
SUPPORTED_EARS_AVHRR_SATELLITES = ['Metop-B', 'Metop-C']
SUPPORTED_MODIS_SATELLITES = ['EOS-Terra', 'EOS-Aqua']
SUPPORTED_VIIRS_SATELLITES = ['Suomi-NPP', 'NOAA-20', 'NOAA-21', 'NOAA-22']
SUPPORTED_VIIRS_SATELLITES = ['Suomi-NPP', 'NOAA-20', 'NOAA-21', 'NOAA-22', 'NOAA-23']
SUPPORTED_SEVIRI_SATELLITES = ['Meteosat-09', 'Meteosat-10', 'Meteosat-11']
SUPPORTED_METIMAGE_SATELLITES = ['Metop-SG-A1', 'Metop-SG-A2', 'Metop-SG-A3']

SUPPORTED_PPS_SATELLITES = (SUPPORTED_AVHRR_SATELLITES +
SUPPORTED_MODIS_SATELLITES +
SUPPORTED_SEVIRI_SATELLITES +
SUPPORTED_METIMAGE_SATELLITES +
SUPPORTED_VIIRS_SATELLITES)

GEOLOC_PREFIX = {'EOS-Aqua': 'MYD03', 'EOS-Terra': 'MOD03'}
DATA1KM_PREFIX = {'EOS-Aqua': 'MYD021km', 'EOS-Terra': 'MOD021km'}

PPS_SENSORS = ['amsu-a', 'amsu-b', 'mhs', 'avhrr/3', 'viirs', 'modis', 'seviri']
PPS_SENSORS = ['amsu-a', 'amsu-b', 'mhs', 'avhrr/3', 'viirs', 'modis', 'seviri', 'metimage']
REQUIRED_MW_SENSORS = {}
REQUIRED_MW_SENSORS['NOAA-15'] = ['amsu-a', 'amsu-b']
REQUIRED_MW_SENSORS['NOAA-18'] = []
Expand All @@ -92,8 +94,11 @@ class FindTimeControlFileError(Exception):
'NOAA-15': 'noaa15',
'Metop-A': 'metop02', 'Metop-B': 'metop01',
'Metop-C': 'metop03',
'Metop-SG-A1': 'metopsga1',
'Metop-SG-A2': 'metopsga2',
'Metop-SG-A3': 'metopsga3',
'Suomi-NPP': 'npp',
'NOAA-20': 'noaa20', 'NOAA-21': 'noaa21',
'NOAA-20': 'noaa20', 'NOAA-21': 'noaa21', 'NOAA-23': 'noaa23',
'EOS-Aqua': 'eos2', 'EOS-Terra': 'eos1',
'Meteosat-09': 'meteosat09', 'Meteosat-10': 'meteosat10',
'Meteosat-11': 'meteosat11'}
Expand All @@ -107,6 +112,8 @@ class FindTimeControlFileError(Exception):
SENSOR_LIST[sat] = 'viirs'
elif 'Meteosat' in sat:
SENSOR_LIST[sat] = 'seviri'
elif 'Metop-SG' in sat:
SENSOR_LIST[sat] = 'metimage'
else:
SENSOR_LIST[sat] = ['avhrr/3', 'mhs', 'amsu-a']

Expand Down Expand Up @@ -305,6 +312,12 @@ def ready2run(msg, files4pps, use_l1c, **kwargs):
'Sensor ' + str(msg.data['sensor']) +
' not required for S-NPP/VIIRS PPS processing...')
return False
elif msg.data['platform_name'] in SUPPORTED_METIMAGE_SATELLITES:
if msg.data['sensor'] not in ['metimage', ]:
LOG.info(
'Sensor ' + str(msg.data['sensor']) +
' not required for METIMAGE PPS processing...')
return False
else:
if msg.data['sensor'] not in NOAA_METOP_PPS_SENSORNAMES:
LOG.info(
Expand Down

0 comments on commit fc4314d

Please sign in to comment.