vergauwenthomas / PyFa

Python wrapper on Rfa using xarray
MIT License
0 stars 0 forks source link

Discussion on the PyFa use as a python package #35

Closed vergauwenthomas closed 6 months ago

vergauwenthomas commented 6 months ago

I think the purpose of the PyFa python package is to

Case-specific approach

The strategy towards this (in #27), and in how we described the issues, is to implement functions/methods for specific cases like:

All-in-one approach

However, I am getting more in favor of not following this approach but implementing a function that converts a FA file (with all its fields) into one xarray dataset. Here are some benefits i can think of:

  1. Easier to maintain since there will only be one core function. For field extraction, we can rely on the xarray methods.
  2. The user should only use pyfa once to convert FA files to netCDF. Then the user is free to use whatever she/he likes.
  3. All fields are present, so more flexibility for the user's application
  4. The possibility to convert vertical coordinates (since the geopotential/surface pressure are kept in the dataset)

The drawbacks:

  1. Conversion will take a lot longer because all fields are exported. This is sometimes an overkill if the user is only interested in one field.
  2. The output netCDF's will become quite big (i think since they are not compressed).

@kobebryant432, @wdewettin What is your opinion on this matter? Do you prefer specific-case approach or the all-in-one?

kobebryant432 commented 6 months ago

@vergauwenthomas
Agreed all in one approach is more flexible. I do believe that the data will become very big. If someone would want to do an analysis on the precipitation (10 years - daily) converting all files (all variables) is not feasible. Here a specific approach by specifying the required variables is more efficient.

Maybe these can somehow be combined?

vergauwenthomas commented 6 months ago

@kobebryant432 Agreed! What i can do is add the whitelist_fields and blacklist_fields arguments to the all_in_one method. By default, all available fields are imported. But if whitelist_fields is specified, only these fields are imported. blacklist_fields will be excluded from the import.

vergauwenthomas commented 6 months ago

Implement: