Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract_location pre-processor fails for cubes with 2D latitude and longitude arrays #2177

Open
nhsavage opened this issue Aug 22, 2023 · 2 comments · May be fixed by #2186
Open

extract_location pre-processor fails for cubes with 2D latitude and longitude arrays #2177

nhsavage opened this issue Aug 22, 2023 · 2 comments · May be fixed by #2186
Assignees

Comments

@nhsavage
Copy link

Describe the bug
When using CORDEX data on a model with a rotated pole grid with the extract_location pre-processor it fails with:

ValueError: Interpolation coords must be 1-d for rectilinear interpolation.

The function: extract_point in preprocessor/_regrid.py

essentially needs extending to cope with cases where the latitude and longitude are not

Please attach

  • The recipe that you are trying to run, you can find a copy in the run directory in the output directory
  • The main_log_debug.txt file, this can also be found in the run directory in the output directory
@nhsavage nhsavage self-assigned this Aug 22, 2023
@nhsavage
Copy link
Author

recipe:

# ESMValTool
# recipe_python.yml
#
# See https://docs.esmvaltool.org/en/latest/recipes/recipe_examples.html
# for a description of this recipe.
#
# See https://docs.esmvaltool.org/projects/esmvalcore/en/latest/recipe/overview.html
# for a description of the recipe format.
---
documentation:
  description: |
    Example recipe that plots a map and timeseries of temperature
    from a CORDEX Africa Model.

  title: Recipe that runs an example diagnostic for CORDEX.

  authors:
    - andela_bouwe

  maintainer:
    - schlund_manuel

  projects:
    - esmval

datasets:
  - {institute: SMHI, driver: NCC-NorESM1-M, dataset: SMHI-RCA4, exp: historical, project: CORDEX, ensemble: r1i1p1, mip: mon, rcm_version: v1, domain: EUR-11}

preprocessors:
  # See https://docs.esmvaltool.org/projects/esmvalcore/en/latest/recipe/preprocessor.html
  # for a description of the preprocessor functions.

  to_degrees_c:
    convert_units:
      units: degrees_C

  annual_mean_amsterdam:
    extract_location:
      location: Amsterdam
      scheme: linear
    annual_statistics:
      operator: mean
    multi_model_statistics:
      statistics:
        - mean
      span: overlap
    convert_units:
      units: degrees_C

diagnostics:

  map:
    description: Map of European temperature in January 2000.
    themes:
      - phys
    realms:
      - atmos
    variables:
      tas:
        mip: Amon
        preprocessor: to_degrees_c
        timerange: 2000/P1M
        caption: |
          Domain map of {long_name} in January 2000 according to {dataset}.
    scripts:
      script1:
        script: examples/diagnostic.py
        quickplot:
          plot_type: pcolormesh
          cmap: Reds

  timeseries:
    description: Annual mean temperature in Amsterdam since 1970.
    themes:
      - phys
    realms:
      - atmos
    variables:
      tas_amsterdam:
        short_name: tas
        mip: Amon
        preprocessor: annual_mean_amsterdam
        timerange: 1970/2005
        caption: Annual mean {long_name} in Amsterdam according to {dataset}.
    scripts:
      script1:
        script: examples/diagnostic.py
        quickplot:
          plot_type: plot
  

@nhsavage
Copy link
Author

main_log_debug.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant