Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Please implement UNIT keyword in SPAWN

Greg Huey
2011-02-05
2013-06-03
  • Greg Huey
    Greg Huey
    2011-02-05

    Hello,
    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/fxposit.pro
    %                    MRDFITS           2664 /usr/local/Healpix_2.15a//src/idl/zzz_external/astron/mrdfits.pro
    %                    $MAIN$         
    % Execution halted at: MRDFITS            197 /usr/local/Healpix_2.15a//src/idl/zzz_external/astron/mrdfits.pro

    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.

    Thanks,
    Greg Huey

     
  • Greg Huey
    Greg Huey
    2011-05-03

    Update:
    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.

    Later,
    Greg

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

    Sylwester

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

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