[AstroPy] Executable Script fitsheader

j. vickroy jgv.home at gmail.com
Wed Sep 11 09:54:29 EDT 2019


Sine python provides the glob module, I believe these astropy scripts 
should not assume command-line expansion of wildcards.

At a minimum, their documentation should be updated to state the 
implicit assumption that wildcard expansion is left to the shell, and 
that, in particular, they do not work as advertised when used in 
Microsoft Windows cmd.exe.

Regards,
/jimv

On 9/11/2019 3:55:16 AM, "Sotiria Fotopoulou" <sn.fotop at gmail.com> 
wrote:

>I don't think the wildcard expansion is astropy's shortcoming.
>Perhaps an issue should be raised for a more informative error message 
>or a suggestion to be printed to use powershell.
>
>Cheers,
>Sotiria
>
>On Wed, Sep 11, 2019 at 10:45 AM Peter Dzwig <pdzwig at summaventures.com> 
>wrote:
>>I tend to agree, although it is some time since I used Windows as a
>>serious compute environment, I seem to recall that cmd.exe lacked a 
>>lot
>>of the support that Powershell gives/gave better support.
>>
>>Should this be reported to astropy as a bug?
>>
>>Peter Dzwig
>>
>>On 10/09/2019 22:54, Simon Conseil wrote:
>> > Hi,
>> >
>> > Usually for this kind of script the shell takes care of the wildcard
>> > expansion (e.g. with bash/zsh on Linux/MacOS).
>> >
>> > I don't know much about Windows, a quick search seems to show 
>>cmd.exe
>> > does not support wildcard expansion, but Powershell does
>> > 
>>(https://superuser.com/questions/460598/is-there-any-way-to-get-the-windows-cmd-shell-to-expand-wildcard-paths).
>> >
>> > Simon
>> >
>> >
>> > Le 10/09/2019 à 19:04, James Dull a écrit :
>> >> Thanks for all of the input.
>> >>
>> >> I should have provided more information. I have the same set-up as
>> >> described below and get the same error.
>> >> I am using Windows 10.
>> >>
>> >> Jim
>> >>
>> >> On Tue, Sep 10, 2019 at 8:44 AM j. vickroy <jgv.home at gmail.com> 
>>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> 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
>> >>>
>> >>
>> >> _______________________________________________
>> >> AstroPy mailing list
>> >> AstroPy at python.org
>> >> https://mail.python.org/mailman/listinfo/astropy
>> >
>> > _______________________________________________
>> > AstroPy mailing list
>> > AstroPy at python.org
>> > https://mail.python.org/mailman/listinfo/astropy
>> >
>>
>>--
>>
>>Dr. Peter Dzwig
>>_______________________________________________
>>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/20190911/7b062a59/attachment-0001.html>


More information about the AstroPy mailing list