Starlink / starlink-pywrapper

Idiomatic access to Starlink applications from Python.
14 stars 2 forks source link

A typo in the documentation #2

Open izkgao opened 5 years ago

izkgao commented 5 years ago

https://starlink-pywrapper.readthedocs.io/en/latest/details.html#commands-that-should-be-avoided

There is a typo in the documentation (link given above).

:meth:`starlink.utilities.get_ndf_fitsheader

It should be

:meth:`starlink.utilities.get_ndf_fitshdr

And I did some speed tests on those functions.

%%timeit a = fitsval(file, 'PROJECT') 40.8 ms ± 1.88 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

%%timeit b = get_ndf_fitshdr(file)['PROJECT'] 1.02 ms ± 14.7 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)

%%timeit c = fitslist(file, returnstdout=True) 44.6 ms ± 5.03 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

get_ndf_fitshdr is about 40 times faster than fitsval.

It would be good if there is a suggestion on choosing which function to use in the documentation even if the user do not need the whole header.

It is really nice to have get_ndf_fitshdr when there are plenty of files. Thanks a lot.