This function closes the file associated to the ephemeris descriptor eph, and frees all memory allocated by the functions open/create functions. After this call, the ephemeris descriptor eph is no longer valid.

The following example creates a new ephemeris file ephemeris.bsp

t_writephbin *weph;

weph = writeph_spk_create("ephemeris.bsp","asteroid_1");
if (weph)
{

  /* ... compute and write to weph ... */
  writeph_close(weph);
}