CF coordinates get forgotten after operation modifying coordinates

Abierto
#396 4 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
data

Línea de trabajo

Start by reproducing the shown DataArray example and compare d.cf.coordinates with d.mean("time").cf.coordinates. Trace how CF coordinates are identified before and after the time reduction; done means the reduced result keeps TLON as longitude and TLAT as latitude without adding ULON or ULAT.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I have a DataArray that's similar, but not quite the same as the popds example dataset (the axes aren't labelled, and it has a time dimension):

<xarray.DataArray 'Tair_m' (time: 1, nj: 1080, ni: 1440)>
array([[[nan, nan, ..., nan, nan],
        [nan, nan, ..., nan, nan],
        ...,
        [nan, nan, ..., nan, nan],
        [nan, nan, ..., nan, nan]]], dtype=float32)
Coordinates:
  * time     (time) datetime64[ns] 2255-01-01
    TLON     (nj, ni) float32 nan nan nan nan nan nan ... nan nan nan nan nan
    TLAT     (nj, ni) float32 nan nan nan nan nan nan ... nan nan nan nan nan
    ULON     (nj, ni) float32 nan nan nan nan nan nan ... nan nan nan nan nan
    ULAT     (nj, ni) float32 nan nan nan nan nan nan ... nan nan nan nan nan
Dimensions without coordinates: nj, ni
Attributes:
    units:          C
    long_name:      air temperature
    cell_measures:  area: tarea
    cell_methods:   time: mean
    time_rep:       averaged

And of course, the coordinates get correctly decoded:

>>> d.cf.coordinates
{'longitude': ['TLON'], 'latitude': ['TLAT']}

But if I take the time mean of this dataset, the correct coordinates get forgotten:

>>> d.mean("time").cf.coordinates
{'longitude': ['TLON', 'ULON'], 'latitude': ['TLAT', 'ULAT']}
Lenguaje dominante
Python
Estrellas
181
Forks
49
Merge medio
43 min
PR fusionados (30 d)
1

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de xarray-contrib/cf-xarray

Todos los issues de xarray-contrib/cf-xarray

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.