Esempio n. 1
0
def line():
    """Create an example retrieval line."""
    return pyplis.LineOnImage(630,
                              780,
                              1000,
                              350,
                              pyrlevel_def=0,
                              normal_orientation="left")
Esempio n. 2
0
    XS = np.sin(np.deg2rad(23)) * DS

    # 400/2 pixels in the horizontal gives horizontal pixel size
    DX = XS / 200. * 1000

    print("DX, ", DX, DY, DZ, DS, XS)

    # Clear sky ROI
    BG_ROI = [0, 10, 0, 40]
    # Setup optical flow class (you may play with the parameters)

    ### DEFINE PCS LINES
    pcs1 = pyplis.LineOnImage(
        COL_NUM1,
        ROW_BOTTOM,
        COL_NUM1,
        ROW_TOP,
        line_id="A",
        normal_orientation="right",  #"left",#
        color="#e67300")
    pcs2 = pyplis.LineOnImage(
        COL_NUM2,
        ROW_BOTTOM,
        COL_NUM2,
        ROW_TOP,
        line_id="B",
        normal_orientation="right",  #"left",
        color="#1a1aff")

    ### LOAD IMAGES
    ImagesAA = load_MYSTIC_images(filebase,
                                  wavelengthA,
Esempio n. 3
0
    ax.set_xlabel("PCS", fontsize=16)
    ax.legend(loc="best", fancybox=True, framealpha=0.5, fontsize=12)
    return fig


# SCRIPT MAIN FUNCTION
if __name__ == "__main__":
    close("all")

    # Create a background model with relevant sky reference areas
    bg_model = init_background_model()

    # Define exemplary plume cross section line
    pcs_line = pyplis.LineOnImage(x0=530,
                                  y0=730,
                                  x1=890,
                                  y1=300,
                                  line_id="example PCS",
                                  color="lime")

    plume, plume_vigncorr, bg = load_and_prepare_images()

    auto_params, fig0 = autosettings_vs_manual_settings(bg_model)

    # Script option
    if USE_AUTO_SETTINGS:
        bg_model.update(**auto_params)

    # Model 4 exemplary tau images

    # list to store figures of tau plotted tau images
    _tau_figs = []
Esempio n. 4
0
            ROW_TOP    = 90+150
        elif case_here=='CASEC':
            COL_NUM1L = 250
            COL_NUM1R = 250
            COL_NUM2 = 290
            COL_NUM3 = 300
            ROW_BOTTOM = 0+150
            ROW_TOP    = 110+150

        # Clear sky ROI
        BG_ROI = [0, 10, 0, 40]
        # Setup optical flow class (you may play with the parameters)
        FLOW = pyplis.OptflowFarneback()
        
        PCS1 = pyplis.LineOnImage(COL_NUM1L, ROW_BOTTOM, COL_NUM1R, ROW_TOP,
                                 line_id="A", normal_orientation="right", #"left",#
                                 color="#e67300")
        PCS2 = pyplis.LineOnImage(COL_NUM2, ROW_BOTTOM, COL_NUM2,  ROW_TOP,
                                 line_id="B", normal_orientation="right", #"left",
                                 color="#1a1aff")
        PCS3 = pyplis.LineOnImage(COL_NUM3, ROW_BOTTOM, COL_NUM3,  ROW_TOP,
                                 line_id="C", normal_orientation="right", #"left",
                                 color="#1a1a00")

        pcs1 = PCS1
        pcs2 = PCS2
        pcs3 = PCS3
        # in this object the results from the optical flow histogram analysis
        # are stored (i.e. time series of local average displacement vector)
        props1 = pyplis.LocalPlumeProperties(roi_id=pcs1.line_id,
                                            color=pcs1.color)
# IMPORT GLOBAL SETTINGS
from SETTINGS import IMG_DIR, SAVEFIGS, SAVE_DIR, FORMAT, DPI, OPTPARSE
# IMPORTS FROM OTHER EXAMPLE SCRIPTS
from ex10_bg_imglists import get_bg_image_lists

# Check script version
check_version()

# SCRIPT OPTONS
# lower boundary for I0 value in dilution fit
I0_MIN = 0.0
AA_THRESH = 0.03

# exemplary plume cross section line for emission rate retrieval (is also used
# for full analysis in ex12)
PCS_LINE = pyplis.LineOnImage(x0=530, y0=586, x1=910, y1=200, line_id="pcs")
# Retrieval lines for dilution correction (along these lines, topographic
# distances and image radiances are determined for fitting the atmospheric
# extinction coefficients)
TOPO_LINE1 = pyplis.LineOnImage(1100, 650, 1000, 900, line_id="flank far",
                                color="lime",
                                linestyle="-")

TOPO_LINE2 = pyplis.LineOnImage(1000, 990, 1100, 990, line_id="flank close",
                                color="#ff33e3",
                                linestyle="-")

# all lines in this array are used for the analysis
USE_LINES = [TOPO_LINE1, TOPO_LINE2]

# specify pixel resolution of topographic distance retrieval (every nth pixel
Esempio n. 6
0
    # Load cell calibration (see example 5)
    cellcalib = perform_auto_cell_calib()

    # get cell calibration
    cellcalib.prepare_calib_data(
        pos_x_abs=fov_x,  # change if you want it for a specific pix
        pos_y_abs=fov_y,  # change if you want it for a specific pix
        radius_abs=fov_extend,  # radius of retrieval disk
        on_id="on",  # ImgList ID of onband filter
        off_id="off")  # ImgList ID of offband filter

    cell_aa_calib = cellcalib.calib_data["aa"]

    # Define lines on image for plume profiles
    pcs1 = pyplis.LineOnImage(620, 700, 940, 280,
                              line_id="center")
    pcs2 = pyplis.LineOnImage(40, 40, 40, 600,
                              line_id="edge")

    # Plot DOAS calibration polynomial
    ax0 = doascalib.plot(add_label_str="DOAS")
    ax0 = cellcalib.calib_data["aa"].plot(ax=ax0, c="r")
    ax0.set_title("")
    ax0.set_xlim([0, 0.5])

    # Get current AA image from image list
    aa_init = aa_list.current_img()

    # now determine sensitivity correction masks from the different cells
    masks = {}
    aa_imgs_corr = {}