How to extract data for animal track?

I am new to CDS toolbox. I am just wondering if there is any way to annotate my animal tracking data with pressure level datasets (for instance air temperature). The track points are fixed with  2 hours of interval and each fix has lat, lon, datetime, altitude value.

I know there are tools out there for ERA-interim (through EnvDATA system), which ceased its operation since September 2019. But, I am not sure how to annotate my current tracking dataset of which time period spans from Sep 2019 to June 2020. I only imagine that it may be possible with CDS toolbox (potentially, ct.observation.interp_from_grid?). 

I would be grateful if anyone could show me how or direct me to any sources.

thanks in advance, 


Dear Batbayar,

The following workflow shows you how to extract data along an animal track:

The tool used is ct.observation.interp_from_grid as you suggested and the key is to define your animal track in the right way.

The sample animal track I created is a dictionary containing the keys 'lat', 'lon' and 'time'. Each key is associated to a list containing respectively the latitude, the longitude and the time of the animal's track.

Once the animal track dictionary is defined you can just interpolate along it.

Note that it is essential that the keys used in the animal track dictionary correspond to the dimension names of the data you are using.

I hope this helps and do not hesitate to get back to me for any question.