[AstroPy] Executable Script fitsheader

Peter Teuben teuben at astro.umd.edu
Tue Sep 10 10:55:35 EDT 2019


more than likely the argument is not fed via the glob module, as it 
seems to take *.fit as a literal, not a meta character. Looking at the 
documentation, it seems to support wildcards, but I should also note the 
documentation (in the source code) has 'errors', e.g. it lists

fitsheader --keyword NAXIS* filename.fits

as an example which I'm pretty sure doesn't work in all shells. In bash 
it will, since it's an overly controlling shell, or smart shell as some 
call it :-)  In csh, i can promise you, it won't work.

Since DOS does wildcards I believe, the other possibility could be that 
the command fitsheader doesn't point to the fitsheader.py from astropy, 
but from another package, since the name is pretty easy to come up with. 
Is there a "which" command in DOS ?

Does the command do the expected thing if you manually feed it more than 
one fit(s) file?

- peter


On 9/10/19 10:44 AM, j. vickroy wrote:
> Sorry I do not have an answer, but since there have been no responses, 
>  here is what I'm seeing:
>
> C:\Pictures\Astro>fitsheader *.fit
> ERROR: [Errno 22] Invalid argument: '*.fit' 
> [astropy.io.fits.scripts.fitsheader]
>
> My setup is:
>
>   * Microsoft Windows 10 fully-updated
>   * Python 3.7.3
>   * astropy 3.2.1
>
>
> When I have some time, I will look at fitsheader.py to see what the 
> problem is.
>
> Regards,
> /jimv
>
>
> On 9/9/2019 4:47:18 PM, "James Dull" <dull4.ja at gmail.com 
> <mailto:dull4.ja at gmail.com>> wrote:
>
>> I would like to extract header information from several hundred fits 
>> files and put it into a csv file. I ran across the executable script 
>> information fitsheader that appears to do just that. It works 
>> perfectly for a single file. However, when I follow the online 
>> command for that uses a wildcard so multiple files can be completed 
>> in a single pass I get "unrecognized command"
>>
>> Something similar happens with the other scripts if I use a wildcard.
>>
>> I feel I'm missing something simple.
>>
>> The command I'm using is: fitsheader --table ascii.csv *.fits > 
>> keywords.csv
>>
>> thanks
>> Jim
>>
>>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20190910/8148b55d/attachment-0001.html>


More information about the AstroPy mailing list