Esempio n. 1
0
    def resample(self, grid):
        """
        The resample method resamples the MutlispectralScatterer (extinction, albedo, phase) at all wavelengths.

        Parameters
        ----------
        grid: shdom.Grid
            The new grid to which the data will be resampled

        Returns
        -------
        scatterer: shdom.MultispectralScatterer
            A multi-spectral scatterer resampled onto the input grid
        """
        for wavelength in self.scatterer.keys():
            self.scatterer[float_round(wavelength)] = self.scatterer[
                float_round(wavelength)].resample(grid)
        return self
Esempio n. 2
0
    def get_optical_scatterer(self, wavelength):
        """
        Get the optical scatterer at a given wavelength.

        Parameters
        ----------
        wavelength: float
            Wavelength in microns.

        Notes
        -----
        The input wavelength is rounded to three decimals.
        """
        return self.scatterer[float_round(wavelength)]
Esempio n. 3
0
    def add_scatterer(self, scatterer):
        """
        Add an optical scatterer to the list.

        Parameters
        ----------
        scatterer: shdom.OpticalScatterer
            An optical scatterer at a given wavelength.
        """
        if self.num_wavelengths == 0:
            self._grid = scatterer.grid
        else:
            self._grid += scatterer.grid
        self._num_wavelengths += 1
        self.scatterer[float_round(scatterer.wavelength)] = scatterer.resample(
            self.grid)
        self._wavelength.append(scatterer.wavelength)
Esempio n. 4
0
    def get_phase(self, wavelength):
        """
        Get the optical phase function from microphysics and Mie scattering model for a given wavelength.

        Parameters
        ----------
        wavelength: float
            Wavelength in microns.

        Returns
        -------
        phase: shdom.GridPhase
            A GridPhase with the optical phase function

        Notes
        -----
        A Mie scattering model must be defined at the input wavelength by use of the add_mie method.
        The input wavelength is rounded to three decimals.
        """
        phase = self.mie[float_round(wavelength)].get_phase(
            self.reff, self.veff)
        return phase
Esempio n. 5
0
    def get_albedo(self, wavelength):
        """
        Get the optical single scattering albedo from microphysics and Mie scattering model for a given wavelength.

        Parameters
        ----------
        wavelength: float
            Wavelength in microns.

        Returns
        -------
        albedo: shdom.GridData
            A GridData with the optical single scattering albedo

        Notes
        -----
        A Mie scattering model must be defined at the input wavelength by use of the add_mie method.
        The input wavelength is rounded to three decimals.
        """
        albedo = self.mie[float_round(wavelength)].get_albedo(
            self.reff, self.veff)
        return albedo