LinkedEarth / Pyleoclim_util

Python Package for the Analysis of Paleoclimate Data. Documentation at
https://pyleoclim-util.readthedocs.io
GNU General Public License v3.0
87 stars 33 forks source link

Mapping multiple LipdSeries objects #267

Closed alexkjames closed 1 year ago

alexkjames commented 1 year ago

Is your feature request related to a problem? Please describe. A lot of my paleoclimate analysis within Pyleoclim begins with loading a big folder full of Lipd files into a pyleo.Lipd object, turning them into LipdSeries objects with .toLipdSeriesList, parsing those results for specific features, and looking at what comes out. Right now all of this is easy except for the looking at what comes out part. There's no way to take a big list or group of LipdSeries objects and map them the way we can with pyleo.Lipd objects. There is also no way to easily get those LipdSeries objects back into a pyleo.Lipd object, so I have to come up with somewhat convoluted workarounds just to map my parsed dataset.

Describe the solution you'd like I think the best option would be to create a new class called MultipleLipdSeries. It would be a child of MultipleSeries, and offer the ability to easily map collections of LipdSeries objects, perform spatial analysis, filter by archive, etc. The main thing that would be nice would be the mapping capability, but there's a whole host of potential use cases.

Describe alternatives you've considered Making it possible to feed the lipd_ts attribute from LipdSeries objects back into a pyleo.Lipd object. Right now the structure of the lipd_ts attribute isn't what pyleo.Lipd expects of lipd dictionaries, so none of the functionalities work.

CommonClimate commented 1 year ago

That sounds good @alexkjames , but I would re-use as much of @fzhu2e 's cfr code as possible for that. @khider and I were talking this morning about the output of pyLipd being a pandas dataframe much like what Feng made for CFR, as it makes a bunch of tasks (like mapping and plotting the temporal availability) very easy. Maybe explore a .to_df() export capability that would let your collection of lipd series easily mappable using his code?

khider commented 1 year ago

This may fall under PyLipd outputs.

CommonClimate commented 1 year ago

revisit after #270 is closed

CommonClimate commented 1 year ago

@alexkjames , the MultipleGeoSeries .map() and .map_neighbors() functions should now address this. Can you have a look? @khider is it worth having a LiPDSeries to GeoSeries converter?

khider commented 1 year ago

No. LiPDSeries is being deprecated. But we should have a Series to GeoSeries

CommonClimate commented 1 year ago

True ; and issue #419 will address that.