CF coordinates get forgotten after operation modifying coordinates

オープン
#396 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
data

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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']}
主要言語
Python
スター
181
フォーク
49
平均マージ
43分
マージ済み PR(30日)
1

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

xarray-contrib/cf-xarray のほかの issue

xarray-contrib/cf-xarray の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。