# Add additional support for more product files by producing similar product files with already-supported product files

**URL:** https://forum.atmospherictoolbox.org/t/add-additional-support-for-more-product-files-by-producing-similar-product-files-with-already-supported-product-files/444
**Category:** HARP
**Created:** [December 20, 2021, 3:34pm UTC](https://forum.atmospherictoolbox.org/t/add-additional-support-for-more-product-files-by-producing-similar-product-files-with-already-supported-product-files/444 "2021-12-20T15:34:38Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![sander.niemeijer](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/sander.niemeijer/32/5_2.png) [@sander.niemeijer](https://forum.atmospherictoolbox.org/u/sander.niemeijer)
#### Post date: [December 21, 2021, 3:18pm UTC](https://forum.atmospherictoolbox.org/t/add-additional-support-for-more-product-files-by-producing-similar-product-files-with-already-supported-product-files/444/2 "2021-12-21T15:18:37Z")

</div>

You have to be aware that HARP supports two types of products:

- Products that are already stored [using HARP conventions](http://stcorp.github.io/harp/doc/html/conventions/index.html) (which can be [netcdf3](http://stcorp.github.io/harp/doc/html/conventions/netcdf3.html), [hdf4](http://stcorp.github.io/harp/doc/html/conventions/hdf4.html), or [netcdf4/hdf5](http://stcorp.github.io/harp/doc/html/conventions/hdf5.html))
- Products in one of the foreign formats for which an importer is available (as listed [in the documentation](http://stcorp.github.io/harp/doc/html/ingestions/index.html))

Trying to modify a product which is in an external format to allow it to be read by HARP does not make sense. You are then better of creating your own product having HARP conventions directly (i.e. creating your own HARP importer).

Creating a converter is not that difficult if you use the HARP python interface.

A template script for how to do this is the following:

```
import numpy as np
from datetime import datetime, timedelta

import harp

product = harp.Product()

# replace this section with reading routines to get data from your own product
times = [datetime(2020,1,1) + timedelta(seconds=x) for x in range(100)]
latitude_bounds = np.zeros([100,4])
longitude_bounds = np.zeros([100,4])
co2 = np.zeros([100])

# datetime
time_origin = datetime(2000, 1, 1)
times = np.array([(t - time_origin).total_seconds() / (24 * 60 * 60) for t in times])
product.datetime = harp.Variable(times, ["time"])
product.datetime.unit = "days since 2000-01-01"

# latitude
product.latitude_bounds = harp.Variable(latitude_bounds, ["time", None])
product.latitude_bounds.unit = "degree_north"
# longitude
product.longitude_bounds = harp.Variable(longitude_bounds, ["time", None])
product.longitude_bounds.unit = "degree_east"
# value
product.CO2_column_number_density = harp.Variable(co2, ["time"])
product.CO2_column_number_density.unit = "molec/cm^2" # replace with actual unit of measurement

# Export as HARP product
harp.export_product(product, "myproduct.nc")

```

If you want to create a L3 grid from it, you don’t even have to export to a file. You could then directly use the following to get your grid:

```
gridded_product = harp.execute_operations(product, 'bin_spatial(....)')
```

---

_[View the full topic](https://forum.atmospherictoolbox.org/t/add-additional-support-for-more-product-files-by-producing-similar-product-files-with-already-supported-product-files/444)._
