metno / pyaerocom

Python tools for climate and air quality model evaluation
https://pyaerocom.readthedocs.io/
GNU General Public License v3.0
26 stars 15 forks source link

Allow importing a DataFrame as a ColocatedData object #1371

Open thorbjoernl opened 1 month ago

thorbjoernl commented 1 month ago

Is your feature request related to a problem? Please describe. Allow creating a ColocatedData object from a pandas DataFrame. Basically the inverse of ColocatedData.to_dataframe().

Would allow for another path for injecting ColocatedData into Pyaerocom.

Describe the solution you would like to see A clear and concise description of what you want to happen.

Additional context Add any other context or screenshots about the feature request here.

Ovewh commented 1 month ago

Is it possible to also allow for xarray dataset to be injected as ColocatedData? Let's say I do the collocation manually using the pyaerocom api i.e.

coldata = pya.colocation.colocator.colocate_gridded_ungridded(rsdscs,data,ts_type='monthly',harmonise_units=False)
ds = coldata.data
ds.to_netcdf("awsome_colocated_data.nc")

which returns coldata as a Xarray dataset that i can save to disk. Could i inject this into pyaeroval for visualization? In let's say by reading it in my config.py?

lewisblake commented 1 month ago

@Ovewh In theory if you do it correctly it is possible. But this interface for picking up collocated data objects in a WIP https://pyaerocom.readthedocs.io/en/latest/pyaerocom-tutorials/making_a_colocated_data_object_with_pyaerocom.html