original_docstring: 
      Collects the ancillary information required to create NBAR.
  
      :param container:
          An instance of an `AcquisitionsContainer` object.
  
      :param aerosol_dict:
          A `dict` defined as either of the following:
  
          * {'user': <value>}
          * {'pathname': <value>}
  
      :param water_vapour_dict:
          A `dict` defined as either of the following:
  
          * {'user': <value>}
          * {'pathname': <value>}
  
      :param ozone_path:
          A `str` containing the full file pathname to the directory
          containing the ozone data.
  
      :param dem_path:
          A `str` containing the full file pathname to the directory
          containing the digital elevation model data.
  
      :param brdf_path:
          A `str` containing the full file pathname to the directory
          containing the BRDF image mosaics.
  
      :param brdf_premodis_path:
          A `str` containing the full file pathname to the directory
          containing the premodis BRDF image mosaics.
  
      :param out_group:
          If set to None (default) then the results will be returned
          as an in-memory hdf5 file, i.e. the `core` driver. Otherwise,
          a writeable HDF5 `Group` object.
  
      :param compression:
          The compression filter to use.
          Default is H5CompressionFilter.LZF 
  
      :filter_opts:
          A dict of key value pairs available to the given configuration
          instance of H5CompressionFilter. For example
          H5CompressionFilter.LZF has the keywords *chunks* and *shuffle*
          available.
          Default is None, which will use the default settings for the
          chosen H5CompressionFilter instance.
  
      :return:
          An opened `h5py.File` object, that is either in-memory using the
          `core` driver, or on disk.
  
      :notes:
          The keywords compression and filter_opts aren't used as we no
          longer save the BRDF imagery. However, we may need to store
          tables in future, therefore they can remain until we know
          for sure they'll never be used.
      
docstring: Collects the ancillary information required to create NBAR.
docstring_tokens: Collects the ancillary information required to create NBAR .
code: def collect_nbar_ancillary(container, aerosol_dict=None,
                             water_vapour_dict=None, ozone_path=None,
                             dem_path=None, brdf_path=None,
                             brdf_premodis_path=None, out_group=None,
                             compression=H5CompressionFilter.LZF,
                             filter_opts=None):
      """
      Collects the ancillary information required to create NBAR.
  
      :param container:
          An instance of an `AcquisitionsContainer` object.
  
      :param aerosol_dict:
          A `dict` defined as either of the following:
  
          * {'user': <value>}
          * {'pathname': <value>}
  
      :param water_vapour_dict:
          A `dict` defined as either of the following:
  
          * {'user': <value>}
          * {'pathname': <value>}
  
      :param ozone_path:
          A `str` containing the full file pathname to the directory
          containing the ozone data.
  
      :param dem_path:
          A `str` containing the full file pathname to the directory
          containing the digital elevation model data.
  
      :param brdf_path:
          A `str` containing the full file pathname to the directory
          containing the BRDF image mosaics.
  
      :param brdf_premodis_path:
          A `str` containing the full file pathname to the directory
          containing the premodis BRDF image mosaics.
  
      :param out_group:
          If set to None (default) then the results will be returned
          as an in-memory hdf5 file, i.e. the `core` driver. Otherwise,
          a writeable HDF5 `Group` object.
  
      :param compression:
          The compression filter to use.
          Default is H5CompressionFilter.LZF 
  
      :filter_opts:
          A dict of key value pairs available to the given configuration
          instance of H5CompressionFilter. For example
          H5CompressionFilter.LZF has the keywords *chunks* and *shuffle*
          available.
          Default is None, which will use the default settings for the
          chosen H5CompressionFilter instance.
  
      :return:
          An opened `h5py.File` object, that is either in-memory using the
          `core` driver, or on disk.
  
      :notes:
          The keywords compression and filter_opts aren't used as we no
          longer save the BRDF imagery. However, we may need to store
          tables in future, therefore they can remain until we know
          for sure they'll never be used.
      """
      # Initialise the output files
      if out_group is None:
          fid = h5py.File('nbar-ancillary.h5', driver='core',
                          backing_store=False)
      else:
          fid = out_group
  
      acquisition = container.get_highest_resolution()[0][0]
      dt = acquisition.acquisition_datetime
      geobox = acquisition.gridded_geo_box()
  
      aerosol = get_aerosol_data(acquisition, aerosol_dict)
      write_scalar(aerosol[0], DatasetName.AEROSOL.value, fid, aerosol[1])
  
      wv = get_water_vapour(acquisition, water_vapour_dict)
      write_scalar(wv[0], DatasetName.WATER_VAPOUR.value, fid, wv[1])
  
      ozone = get_ozone_data(ozone_path, geobox.centre_lonlat, dt)
      write_scalar(ozone[0], DatasetName.OZONE.value, fid, ozone[1])
  
      elev = get_elevation_data(geobox.centre_lonlat, dem_path)
      write_scalar(elev[0], DatasetName.ELEVATION.value, fid, elev[1])
  
      # brdf
      dname_format = DatasetName.BRDF_FMT.value
      for group in container.groups:
          for acq in container.get_acquisitions(group=group):
              if acq.band_type is not BandType.REFLECTIVE:
                  continue
              data = get_brdf_data(acq, brdf_path, brdf_premodis_path,
                                   compression)
  
              # output
              for param in data:
                  dname = dname_format.format(parameter=param.value,
                                              band_name=acq.band_name)
                  brdf_value = data[param].pop('value')
                  write_scalar(brdf_value, dname, fid, data[param])
  
      if out_group is None:
          return fid
code_tokens: def collect_nbar_ancillary ( container , aerosol_dict = None , water_vapour_dict = None , ozone_path = None , dem_path = None , brdf_path = None , brdf_premodis_path = None , out_group = None , compression = H5CompressionFilter . LZF , filter_opts = None ) : if out_group is None : fid = h5py . File ( 'nbar-ancillary.h5' , driver = 'core' , backing_store = False ) else : fid = out_group acquisition = container . get_highest_resolution ( ) [ 0 ] [ 0 ] dt = acquisition . acquisition_datetime geobox = acquisition . gridded_geo_box ( ) aerosol = get_aerosol_data ( acquisition , aerosol_dict ) write_scalar ( aerosol [ 0 ] , DatasetName . AEROSOL . value , fid , aerosol [ 1 ] ) wv = get_water_vapour ( acquisition , water_vapour_dict ) write_scalar ( wv [ 0 ] , DatasetName . WATER_VAPOUR . value , fid , wv [ 1 ] ) ozone = get_ozone_data ( ozone_path , geobox . centre_lonlat , dt ) write_scalar ( ozone [ 0 ] , DatasetName . OZONE . value , fid , ozone [ 1 ] ) elev = get_elevation_data ( geobox . centre_lonlat , dem_path ) write_scalar ( elev [ 0 ] , DatasetName . ELEVATION . value , fid , elev [ 1 ] ) dname_format = DatasetName . BRDF_FMT . value for group in container . groups : for acq in container . get_acquisitions ( group = group ) : if acq . band_type is not BandType . REFLECTIVE : continue data = get_brdf_data ( acq , brdf_path , brdf_premodis_path , compression ) for param in data : dname = dname_format . format ( parameter = param . value , band_name = acq . band_name ) brdf_value = data [ param ] . pop ( 'value' ) write_scalar ( brdf_value , dname , fid , data [ param ] ) if out_group is None : return fid
short_docstring: Collects the ancillary information required to create NBAR.
short_docstring_tokens: Collects the ancillary information required to create NBAR .
comment: """
      Collects the ancillary information required to create NBAR.
  
      :param container:
          An instance of an `AcquisitionsContainer` object.
  
      :param aerosol_dict:
          A `dict` defined as either of the following:
  
          * {'user': <value>}
          * {'pathname': <value>}
  
      :param water_vapour_dict:
          A `dict` defined as either of the following:
  
          * {'user': <value>}
          * {'pathname': <value>}
  
      :param ozone_path:
          A `str` containing the full file pathname to the directory
          containing the ozone data.
  
      :param dem_path:
          A `str` containing the full file pathname to the directory
          containing the digital elevation model data.
  
      :param brdf_path:
          A `str` containing the full file pathname to the directory
          containing the BRDF image mosaics.
  
      :param brdf_premodis_path:
          A `str` containing the full file pathname to the directory
          containing the premodis BRDF image mosaics.
  
      :param out_group:
          If set to None (default) then the results will be returned
          as an in-memory hdf5 file, i.e. the `core` driver. Otherwise,
          a writeable HDF5 `Group` object.
  
      :param compression:
          The compression filter to use.
          Default is H5CompressionFilter.LZF 
  
      :filter_opts:
          A dict of key value pairs available to the given configuration
          instance of H5CompressionFilter. For example
          H5CompressionFilter.LZF has the keywords *chunks* and *shuffle*
          available.
          Default is None, which will use the default settings for the
          chosen H5CompressionFilter instance.
  
      :return:
          An opened `h5py.File` object, that is either in-memory using the
          `core` driver, or on disk.
  
      :notes:
          The keywords compression and filter_opts aren't used as we no
          longer save the BRDF imagery. However, we may need to store
          tables in future, therefore they can remain until we know
          for sure they'll never be used.
      """$SEP$# Initialise the output files$SEP$# brdf$SEP$# output