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

make a new dimension with dataset.merge #6618

Closed
PLSeuJ opened this issue May 18, 2022 · 7 comments · Fixed by #6621
Closed

make a new dimension with dataset.merge #6618

PLSeuJ opened this issue May 18, 2022 · 7 comments · Fixed by #6621
Labels
plan to close May be closeable, needs more eyeballs

Comments

@PLSeuJ
Copy link
Contributor

PLSeuJ commented May 18, 2022

Is your feature request related to a problem?

I was trying to combine datasets with a field data (i.e. radar signal data on a lat and lon grid) each dataset being from a different point of time. As far as I could understand, there currently is no straight forward way to do this in xarray (or at least I did not find it).

Describe the solution you'd like

Maybe this would be a nice thing to add internally (e.g. xr.merge([ds1, ds2], newaxis='time')). Or in case I just did not find it, lets add it to the Combining data Documentation site for easy access.

Describe alternatives you've considered

I added a new coordinate and dimension (i.e. 'time') to every dataset individually before using merge for the datasets.

Additional context

No response

@TomNicholas
Copy link
Member

TomNicholas commented May 18, 2022

Hi @PLSeuJ, I'm not sure I understand (a minimum example of what you're trying to do would be helpful). Can you not just use xr.concat(ds1, d2, dim="time")? As long as your two radar data datasets lie on the same (lat, lon) grid points then that should do what you're asking for?

@dcherian
Copy link
Contributor

And it says so on the "Combining data" page:

For combining datasets or data arrays along a single dimension, see concatenate.

@dcherian dcherian added plan to close May be closeable, needs more eyeballs and removed enhancement labels May 18, 2022
@PLSeuJ
Copy link
Contributor Author

PLSeuJ commented May 18, 2022

Hi @TomNicholas and @dcherian ,

thanks for your replies! I am super sorry, I must have overseen the part were it says "or new dimension" in the concatenate documentation. This indeed is exactly what I thought about.
Sorry for the bummer!

@PLSeuJ PLSeuJ closed this as completed May 18, 2022
@TomNicholas
Copy link
Member

No problem @PLSeuJ - if you think the docs could be clearer in any way then we are open to suggestions!

@PLSeuJ
Copy link
Contributor Author

PLSeuJ commented May 18, 2022

I put some thoughts to that in the last hour, but in fact the documentation is very good, if you don't happen to give up on the first sentence.
I looked at the documentation style of all the methods and will propose a minor change to the concatenate docs first sentence. highlighting the words dataset and data array, as in the other methods descriptions.

PLSeuJ referenced this issue May 18, 2022
Adding and highlighting the keyword in the concatenate description, I tried to apply the description style of merge and combine - documentation.
@dcherian
Copy link
Contributor

Thanks @PLSeuJ let us know if you need any help with making that change

@PLSeuJ PLSeuJ mentioned this issue May 18, 2022
1 task
@PLSeuJ
Copy link
Contributor Author

PLSeuJ commented May 18, 2022

thanks @dcherian this first time took me a bit, but I think it worked out. It's a very minor change though. If i find the time, I will definitely come back to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plan to close May be closeable, needs more eyeballs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants