TNO Intern

Commit 94c2c1c0 authored by Arjo Segers's avatar Arjo Segers
Browse files

Fixed map plots. Fixed error messages.

parent 0026a38f
Loading
Loading
Loading
Loading
+11 −16
Original line number Diff line number Diff line
@@ -1196,20 +1196,15 @@ class CSO_GriddedCatalogue(CSO_CatalogueBase):
                            if len(values.shape) == 3:
                                # check ..
                                if (vsource_layer < 0) or (values.shape[2] < vsource_layer + 1):
                                    logging.error(
                                        "could not extract source layer %i from values with shape (%s)"
                                        % (vsource_layer, str(vvalues.shape))
                                    )
                                    logging.error(f"could not extract source layer {vsource_layer}"
                                             + f" from values with shape ({vvalues.shape})")
                                    raise Exception
                                # endif
                                # extract:
                                values = values[:, :, vsource_layer]
                            #
                            elif len(values.shape) != 2:
                                logging.error(
                                    "could not plot map of array with shape (%s)"
                                    % (str(values.shape))
                                )
                                logging.error(f"could not plot map of array with shape ({values.shape})")
                                raise Exception
                            # endif

@@ -1234,8 +1229,8 @@ class CSO_GriddedCatalogue(CSO_CatalogueBase):
                            # create map figure:
                            fig = cso_plot.QuickPat(
                                values,
                                xm=xm,
                                ym=ym,
                                x=xm,
                                y=ym,
                                vmin=vmin,
                                vmax=vmax,
                                cmap=cmap,
@@ -1255,15 +1250,15 @@ class CSO_GriddedCatalogue(CSO_CatalogueBase):
                            raise Exception
                        # endif  # ptype

                    else:
                        logging.info(f"{indent}    no    input file: {infile1}")
                    # endif # state file present

                # endif # renew

                ## testing ...
                # break

                else:
                    logging.info(f"{indent}    no    input file: {infile}")
                # endif # state file present

            # endfor # variables

            # next: