Please implement UNIT keyword in SPAWN

Greg Huey
  • Greg Huey

    Greg Huey - 2011-02-05

    It appears that the UNIT keyword in the spawn code is not yet implemented. For example, in attempting to read a compressed FITS file:

    HGDL> result2 = mrdfits("data_2010-07-26_00-12-00_magnetogram.fits",1,hdr)
    Keyword parameter UNIT not allowed in call to: SPAWN
    % Keyword parameter UNIT not allowed in call to: SPAWN
    % Error occurred at: FXPOSIT            197 /usr/local/Healpix_2.15a//src/idl/zzz_external/astron/
    %                    MRDFITS           2664 /usr/local/Healpix_2.15a//src/idl/zzz_external/astron/
    %                    $MAIN$         
    % Execution halted at: MRDFITS            197 /usr/local/Healpix_2.15a//src/idl/zzz_external/astron/

    This is a limitation I've run into several times, and its not clear to me how to create a hack to get around it. In this case, the code to read the fits file wants to launch a subprocess to uncompress the image (via funpack). I'm using GDL 0.9 on an Ubuntu box. It would be great to see SPAWN fixed, but in the short term are there any suggestions for getting around this problem? As a temporary replacement, I'd need a way of running a program external to GDL, and feeding its output through a pipe so that it can be read via a unit in GDL.

    Greg Huey

  • Greg Huey

    Greg Huey - 2011-05-03

    Well, it was a bit of a pain to figure out how, but I hacked GDL to implement the UNIT keyword in the SPAWN command - its just too useful!

    Also, on a related note, I have also implemented numpy support in the GDL PYTHON command. That is, a python function can return a numpy array object into GDL via the PYTHON command. This was not really all that difficult. I can create and post diff upon request.


  • Sylwester Arabas

    Hello, please do post the two patches on the tracker! Thanks!


  • Sylwester Arabas

    Thank you!
    I've just added the SPAWN-UNIT patch to the CVS.
    Please do test it if possible.

  • Sylwester Arabas

    Just for the record, all NumPy related fixes were already in the CVS.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks