starepandas.guess_companion_path#

guess_companion_path(granule_path, folder=None, prefix=None)#

Tries to find a companion to the granule. The assumption being that granule file names are composed of {Product}.{date}.{time}.{version}.{production_timestamp}.{extension}

Parameters:
granule_path: str

The path of the granule to find the companion for

folder: str

the folder to look for companions

prefix: str

The prefix of the companion name; e.g. VJ102DNB

Examples

>>> granule_path = starepandas.datasets.get_path('VNP02DNB.A2020219.0742.001.2020219125654.nc')
>>> companion_path = guess_companion_path(granule_path, prefix='VNP03DNB')
>>> companion_name = companion_path.split('/')[-1]
>>> companion_name
'VNP03DNB.A2020219.0742.001.2020219124651.nc'