Project

General

Profile

Revision 837:bc739dd2cd7c

IDbc739dd2cd7c
Parent 836:9e8a3379a845
Child 838:750fb4349dae

Added by Maarten Sneep about 2 years ago

Additional selectors for the AAI analysis

View differences:

src/PyCAMA_DDS2B_AAI_cfg.py
15 15
# when True use sza_max and a selection on the solar zenith angle
16 16
# otherwise use a symmetric latitude band
17 17
use_sza = True
18
use_abs_lat_max = True
19
use_pacific = False
20
use_center = True
18 21

  
19
sza_max = 60.0
22
sza_max = 85.0
20 23
abs_lat_max = 60.0
24
center_count = 240
25

  
21 26

  
22 27
# longitude selection over the pacific is always fun because of the dateline.
23 28
# This is the selection Jos uses, and this circumvents the issue.
29
# Only active if use_pacific is True
24 30
western_longitude = -180.0
25 31
eastern_longitude = -135.0
26 32

  
......
3727 3733
        }
3728 3734

  
3729 3735
    
3730
    # select on a metadata attribute
3731
    d['general_settings']['metadata_filter'] = {'/METADATA/GRANULE_DESCRIPTION/LongitudeOfDaysideNadirEquatorCrossing': {'range':[western_longitude, eastern_longitude]}}
3736
    if use_pacific:
3737
        # select on a metadata attribute
3738
        d['general_settings']['metadata_filter'] = {'/METADATA/GRANULE_DESCRIPTION/LongitudeOfDaysideNadirEquatorCrossing': {'range':[western_longitude, eastern_longitude]}}
3732 3739
    
3733 3740
    # select on sza or latitude
3734 3741
    for i in range(len(d['AER_AI']['variables'])):
3742
        # remove sun glint
3743
        d['AER_AI']['variables'][i]['transformers'] = [{'class': 'transform.ProcessingQualityFlagsFilter', 'arguments': {'mask':2048}}]
3744
        
3735 3745
        if use_sza:
3736
            d['AER_AI']['variables'][i]['transformers'] = [{'class': 'transform.BandFilter',
3737
                                              'arguments':{'lower': 0.0, 'upper': sza_max, 'parameter': 'solar_zenith_angle'}},
3738
                                              {'class': 'transform.ProcessingQualityFlagsFilter', 'arguments': {'mask':2048}}]
3739
        else:
3740
            d['AER_AI']['variables'][i]['transformers'] = [{'class': 'transform.BandFilter',
3741
                                              'arguments':{'lower': -abs_lat_max, 'upper': abs_lat_max, 'parameter': 'latitude'}},
3742
                                              {'class': 'transform.ProcessingQualityFlagsFilter', 'arguments': {'mask':2048}}]
3746
            d['AER_AI']['variables'][i]['transformers'].append({'class': 'transform.BandFilter', 'arguments':{'lower': 0.0, 'upper': sza_max, 'parameter': 'solar_zenith_angle'}})
3747
        
3748
        if use_abs_lat_max:
3749
            d['AER_AI']['variables'][i]['transformers'].append({'class': 'transform.BandFilter',
3750
                                              'arguments':{'lower': -abs_lat_max, 'upper': abs_lat_max, 'parameter': 'latitude'}})
3751
        
3752
        if use_center:
3753
            d['AER_AI']['variables'][i]['transformers'].append({'class': 'SwathPartSelection', 'arguments': {'count': center_count}})
3743 3754
    
3744
    label = 'sza' if use_sza else 'lat'
3745
    r = int(sza_max) if use_sza else int(abs_lat_max)
3755
    labels = ["pacific" if use_pacific else "global"]
3746 3756
    
3747
    fname = f'PyCAMA_config_AER_AI_{label}_{r}.xml'
3757
    if use_sza:
3758
        labels.append(f"sza_{int(sza_max)}")
3759
    if use_abs_lat_max:
3760
        labels.append(f"lat_{int(abs_lat_max)}")
3761
    if use_center:
3762
        labels.append(f"center_{center_count}")
3763
        
3764
    fname = f'PyCAMA_config_AER_AI_{"_".join(labels)}.xml'
3748 3765
    
3749 3766
    with open(fname, 'w') as fref:
3750 3767
        print(plistlib.dumps(d).decode('UTF-8'), file=fref)

Also available in: Unified diff