podaac / net2cog

Harmony service for transforming netCDF file to cloud optimized geotiffs
Apache License 2.0
3 stars 3 forks source link

Simplify Conversion Code: Use Only Rioxarray for NetCDF to COG #16

Open srizvi-NASA opened 5 months ago

srizvi-NASA commented 5 months ago

The current conversion code utilizes both rasterio and rioxarray libraries for processing netcdf data into COG format. However, simplifying the conversion process by using only rioxarray seems feasible and advantageous.

Previously, rioxarray encountered an issue when converting object data types in MUR-JPL-L4-GLOB-v4.1 files to NumPy timedeltas. This can likely be addressed by implementing data pre-processing steps before feeding the data to rioxarray.

Here's why transitioning to solely using rioxarray is beneficial:

  1. Reduced Complexity: Maintaining a single library simplifies the codebase and reduces potential dependency conflicts.
  2. Leveraging Rioxarray's Functionality: Rioxarray offers built-in functions specifically designed for working with COG datasets, which can streamline the conversion process.
  3. Resolving Previous Exception: By addressing the data pre-processing step mentioned above, we can overcome the prior exception encountered with rioxarray.

By transitioning to a single library approach using rioxarray, we can achieve a more efficient and robust conversion process.

frankinspace commented 5 months ago

Supportive of using only rioxarray

srizvi-NASA commented 2 months ago

I am in the process of making sure that the net2cog handles level-2 data. The current code is good for level-3 (gridded data). The code and the use of various libraries will depend upon a generalized solution to handle level-2 data.