Datasets:

DOI:
License:

Accumulated Data from NWP

#8
by kwon-encored - opened

@peterdudfield
Hi,
I wanted to take a moment to thank you and your team for consistently providing prompt and detailed responses to my queries—it's much appreciated.

As I was reviewing the code repository, I came across a section that deals with "accumulated data channels" within the NWP variables.
https://github.com/openclimatefix/ocf_datapipes/blob/9ec252eeee44937c12ab52699579bdcace76e72f/ocf_datapipes/select/select_time_slice_nwp.py#L55

Could you please point me to where I can find a list or dictionary that defines which variables are accumulated and which are not?
Also, how would you handle the difference in length between accumulated and non-accumulated? (I noticed you used .diff() which is expected to make accum. array one-length shorter than non-accum)

            xr_non_accum = xr_min.sel({self.channel_dim_name: non_accum_channels})
            xr_sel_non_accum = xr_non_accum.sel(
                step=step_indexer, init_time_utc=init_time_indexer
            )

            # Slice out the channels which need to be diffed
            xr_accum = xr_min.sel({self.channel_dim_name: accum_channels})

            # Take the diff and slice requested data
            xr_accum = xr_accum.diff(dim="step", label="lower")
            xr_sel_accum = xr_accum.sel(step=step_indexer, init_time_utc=init_time_indexer)

            # Join diffed and non-diffed variables
            xr_sel = xr.concat([xr_sel_non_accum, xr_sel_accum], dim=self.channel_dim_name)`

Thanks in advance for your help.

Open Climate Fix org

Hi @kwon-encored , thanks for your continuing interest!

The list of accumulated channels will depend on the data you have on hand, and will need to be set manually in the data config under nwp_accum_channels

As for the length, this bit here https://github.com/openclimatefix/ocf_datapipes/blob/9ec252eeee44937c12ab52699579bdcace76e72f/ocf_datapipes/select/select_time_slice_nwp.py#L121-L130 adds an extra step that can be diffed out to preserve the original length, and later on both accum and non_accum parts are sliced to the original required init_times and steps here https://github.com/openclimatefix/ocf_datapipes/blob/9ec252eeee44937c12ab52699579bdcace76e72f/ocf_datapipes/select/select_time_slice_nwp.py#L134 and here https://github.com/openclimatefix/ocf_datapipes/blob/9ec252eeee44937c12ab52699579bdcace76e72f/ocf_datapipes/select/select_time_slice_nwp.py#L143

Sign up or log in to comment