# Path: atrain_match/cloudproducts/read_oca.py
# OCA_READ_EXTRA = OCA_READ_EXTRA_ONLY_OCA + ['flag_cm']


import numpy as np
import logging
import os
from atrain_match.cloudproducts.read_oca import OCA_READ_EXTRA
    from atrain_match.utils.pps_prototyping_util import (get_coldest_values,
                                                         get_darkest_values,
                                                         get_warmest_values)
    from atrain_match.utils.pps_prototyping_util import add_cnn_features
    data = _interpolate_height_and_temperature_from_pressure(obt.imager, 440)
    setattr(obt.imager, 'segment_nwp_h440', data)
    data = _interpolate_height_and_temperature_from_pressure(obt.imager, 680)
    setattr(obt.imager, 'segment_nwp_h680', data)
    return obt


# ---------------------------------------------------------------------------

def imager_track_from_matched(obt, SETTINGS, cloudproducts,
                              extract_radiances=True,
                              extract_cma=True,
                              extract_ctth=True,
                              extract_ctype=True,
                              extract_cpp=True,
                              extract_aux_segments=True,
                              extract_aux=True, 
                              aux_params=None,
                              extract_some_data_for_x_neighbours=False,
                              find_mean_data_for_x_neighbours=False):
    aux_params_all = ["surftemp",
                      "t500", "t700", "t850", "t950", "ttro",
                      "ciwv",
                      "t900", "t1000", "t800", "t250", "t2m",
                      "ptro", "psur",
                      "h2m", "u10m", "v10m", "t2m",
                      "snowa", "snowd", "seaice",
                      "landuse", "fractionofland", "elevation",
                      "r37_sza_correction_done",


# Path: atrain_match/cloudproducts/read_oca.py
# OCA_READ_EXTRA = OCA_READ_EXTRA_ONLY_OCA + ['flag_cm']


# Path: atrain_match/libs/extract_imager_along_track.py
import numpy as np
import logging
import os
from atrain_match.cloudproducts.read_oca import OCA_READ_EXTRA
    from atrain_match.utils.pps_prototyping_util import (get_coldest_values,
                                                         get_darkest_values,
                                                         get_warmest_values)
    from atrain_match.utils.pps_prototyping_util import add_cnn_features

    data = _interpolate_height_and_temperature_from_pressure(obt.imager, 440)
    setattr(obt.imager, 'segment_nwp_h440', data)
    data = _interpolate_height_and_temperature_from_pressure(obt.imager, 680)
    setattr(obt.imager, 'segment_nwp_h680', data)
    return obt


# ---------------------------------------------------------------------------

def imager_track_from_matched(obt, SETTINGS, cloudproducts,
                              extract_radiances=True,
                              extract_cma=True,
                              extract_ctth=True,
                              extract_ctype=True,
                              extract_cpp=True,
                              extract_aux_segments=True,
                              extract_aux=True, 
                              aux_params=None,
                              extract_some_data_for_x_neighbours=False,
                              find_mean_data_for_x_neighbours=False):
    aux_params_all = ["surftemp",
                      "t500", "t700", "t850", "t950", "ttro",
                      "ciwv",
                      "t900", "t1000", "t800", "t250", "t2m",
                      "ptro", "psur",
                      "h2m", "u10m", "v10m", "t2m",
                      "snowa", "snowd", "seaice",
                      "landuse", "fractionofland", "elevation",
                      "r37_sza_correction_done",


    ] + OCA_READ_EXTRA # And NN-extra!