htrdrPy.script module

class htrdrPy.script.Script(case='')[source]

Bases: object

The Script module aims at creating a callable (a function) to be called on a Data object.

bandIntegratedImage(geometry: Geometry, kind, wavelengthUp, wavelengthLow, threadFlag='', MPIcmd='')[source]

Set up the script to calculate an image integrated over a given spectral range. # Inputs: - geometry (Geometry object): a geometry object previously created and set up - kind (str): type of calculation (“sw” or “lw”) - wavelength (float [m]): wavelength - threadFlag (str): thread option to use in the htrdr command. Should take the form “-t <num>” where <num> is the number of threads to be used. If left empty, the maximum number of threads (corresponding to the number of virtual cores on the computer) will be used. - MPIcmd (str): command (MPI) to pass before call to htrdr-planets

commpositeRBG(geometry: Geometry, wavelength1, wavelength2, wavelength3, kind, threadFlag='', MPIcmd='')[source]

THIS HAS NOT BEEN TESTED YET Set up the script to calculate the composite image from 3 monochromatic images. # Inputs: - geometry (Geometry object): a geometry object previously created and set up - wavelength1 (float [m]): wavelength for red channel - wavelength2 (float [m]): wavelength for green channel - wavelength2 (float [m]): wavelength for blue channel - kind (str): type of calculation (“sw” or “lw”) - threadFlag (str): thread option to use in the htrdr command. Should take the form “-t <num>” where <num> is the number of threads to be used. If left empty, the maximum number of threads (corresponding to the number of virtual cores on the computer) will be used. - MPIcmd (str): command (MPI) to pass before call to htrdr-planets

imageRatio(geometry: Geometry, wavelength1, wavelength2, kind, threadFlag='', MPIcmd='')[source]

Set up the script to calculate the ratio of 2 monochromatic images. # Inputs: - geometry (Geometry object): a geometry object previously created and set up - wavelength1 (float [m]): wavelength for numerator image - wavelength2 (float [m]): wavelength for denominator image - kind (str): type of calculation (“sw” or “lw”) - threadFlag (str): thread option to use in the htrdr command. Should take the form “-t <num>” where <num> is the number of threads to be used. If left empty, the maximum number of threads (corresponding to the number of virtual cores on the computer) will be used. - MPIcmd (str): command (MPI) to pass before call to htrdr-planets

monochromaticImage(geometry: Geometry, kind, wavelength, threadFlag='', MPIcmd='')[source]

Set up the script to calculate a monochromatic image. # Inputs: - geometry (Geometry object): a geometry object previously created and set up - kind (str): type of calculation (“sw” or “lw”) - wavelength (float [m]): wavelength - threadFlag (str): thread option to use in the htrdr command. Should take the form “-t <num>” where <num> is the number of threads to be used. If left empty, the maximum number of threads (corresponding to the number of virtual cores on the computer) will be used. - MPIcmd (str): command (MPI) to pass before call to htrdr-planets

reflectanceSpectrum(geometry: Geometry, kind, wavelengths, bandWidths=None, threadFlag='', MPIcmd='')[source]

Start mutliple runs of htrdr-planets to calculate a spectrum, producing an output for each wavelength # Input - geometry (Geometry object): a geometry object previously created and set up - kind (str): type of calculation (“sw” or “lw”) - wavelengths (1-D array (shape=(nWavelength), float [m])): wavelengths - bandWidths (optional, 1-D array (shape=(nWavelength), float [m])): integration band around each wavelength. If not provided, calculation is monochromatic - threadFlag (str): thread option to use in the htrdr command. Should take the form “-t <num>” where <num> is the number of threads to be used. If left empty, the maximum number of threads (corresponding to the number of virtual cores on the computer) will be used. - MPIcmd (str): command (MPI) to pass before call to htrdr-planets

spectrum(geometry: Geometry, kind, wavelengths, bandWidths=None, threadFlag='', MPIcmd='')[source]

Start mutliple runs of htrdr-planets to calculate a spectrum, producing an output for each wavelength # Input - geometry (Geometry object): a geometry object previously created and set up - kind (str): type of calculation (“sw” or “lw”) - wavelengths (1-D array (shape=(nWavelength), float [m])): wavelengths - bandWidths (optional, 1-D array (shape=(nWavelength), float [m])): integration band around each wavelength. If not provided, calculation is monochromatic - threadFlag (str): thread option to use in the htrdr command. Should take the form “-t <num>” where <num> is the number of threads to be used. If left empty, the maximum number of threads (corresponding to the number of virtual cores on the computer) will be used. - MPIcmd (str): command (MPI) to pass before call to htrdr-planets

startMultipleObsGeometry(obsList: list[Geometry], wavelength, threadFlag='', MPIcmd='')[source]

Start multiple runs with different observation geometries but the same planet inputs # Inputs: - obsList (1-D array (shape=(nObs), Geometry)): list of Geometry instances - wavelength: dictionnary containing the spectral information with the following items:

  • “type” (str): type of calculation (“cie_xyz”, “sw”, “lw”)

  • “low” (float [m]): lower bound of integration band

  • “up” (float [m]): upper bound of integration band (if monochromatic calculation, “up” = “low”)

  • threadFlag (str): thread option to use in the htrdr command. Should take the form “-t <num>” where <num> is the number of threads to be used. If left empty, the maximum number of threads (corresponding to the number of virtual cores on the computer) will be used.

  • MPIcmd (str): command (MPI) to pass before call to htrdr-planets

startRadBudgetGCM(geometry: Geometry, kind, threadFlag='', MPIcmd='', verbose=False)[source]

Set up the script to calculate athe radiative budget of each GCM cell. # Inputs: - geometry (Geometry object): a geometry object previously created and set up - kind (str): type of calculation (“sw” or “lw”) - threadFlag (str): thread option to use in the htrdr command. Should take the form “-t <num>” where <num> is the number of threads to be used. If left empty, the maximum number of threads (corresponding to the number of virtual cores on the computer) will be used. - MPIcmd (str): command (MPI) to pass before call to htrdr-planets

startThermalTwoStream(source, kind, method=3, nAngle=4, angle=30, sampling=10000.0, verbose=False)[source]

Under developement …

visibleImage(geometry: Geometry, threadFlag='', MPIcmd='')[source]

Set up the script to calculate a visible (RGB) image. # Inputs: - geometry (Geometry object): a geometry object previously created and set up - threadFlag (str): thread option to use in the htrdr command. Should take the form “-t <num>” where <num> is the number of threads to be used. If left empty, the maximum number of threads (corresponding to the number of virtual cores on the computer) will be used. - MPIcmd (str): command (MPI) to pass before call to htrdr-planets

htrdrPy.script.loadScript(filename)[source]

Load a Script object from the binary file where it is saved (generated after the call on a Data object)