PyFU datacube mosaicking package (updated Oct 2016)

Home Forums Gemini Data Reduction PyFU datacube mosaicking package (updated Oct 2016)

This topic contains 6 replies, has 2 voices, and was last updated by  jturner 1 year ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #627

    jturner
    Keymaster

    Last week I received an email request for the IFU datacube mosaicking scripts I had promised, so here they are. I was intending to resolve a bug with rotated output before posting, but it has been 6 months and the code is useful as-is, so here is the first proper public release, somewhat randomly designated v0.8. This has a handful of new features with respect to the copies I’ve previously sent to whomever asked and has been updated to work with recent versions of SciPy etc.

    This package runs in PyRAF and allows you to combine multiple, linear x-y-lambda datacubes with mutual spatial and/or spectral offsets and/or (not so well tested) different rotations or scales into an average cube. It doesn’t perform pixel rejection but will respect existing data quality in the input and has an option to propagate approximate variance. I’ve also added a new script to rebin data in log-wavelength for analysis, as well as the cross-correlation option for registration that I mentioned previously and an option for resampling cubes onto the same grid without co-adding. See the new README (attached) for more details.

    Cheers,

    James.

    Update: these attachments are old; you should use the newer release below, with bug fixes.

    0
    0
    • This topic was modified 3 years, 5 months ago by  jturner.
    • This topic was modified 3 years, 5 months ago by  jturner.
    • This topic was modified 3 years, 2 months ago by  jturner.
    • This topic was modified 3 years, 2 months ago by  jturner.
    • This topic was modified 3 years, 2 months ago by  jturner.
    • This topic was modified 1 year ago by  jturner.
    #682

    jturner
    Keymaster

    It turns out I had rushed that release a bit when someone asked for the scripts, so here’s an updated version with 3 bug fixes (for var=no being broken, separate=yes not working properly and possible grid size rounding errors). I hope this takes care of it.

    Cheers,

    James.

    Update: these attachments are old; you should use the newer release below, with bug fixes.

    0
    0
    • This reply was modified 1 year ago by  jturner.
    #916

    jturner
    Keymaster

    A user reports that this code no longer runs on NumPy 1.9 (Ureka 1.5.1) after the NumPy developers removed a sub-module it depends on. It may be possible to repair this problem with a one-line change but I’m not sure when I’ll get around to that. In the meantime, PyFU does run with NumPy 1.8 on Ureka 1.0 or 1.4 if you need it (or if you’re feeling adventurous you may be able to fix it yourself; I can’t think of a reason off hand why substituting the offending line with numpy.mean wouldn’t work).

    0
    0
    #1092

    nik
    Participant

    Hi, The numpy problem mentioned above can be removed by changing the following line in pyfmosaic.py
    outmask = numpy.zeros(outshape, dtype=’uint8′)

    to

    outmask = numpy.zeros(outshape)

    Thanks

    0
    0
    #1093

    jturner
    Keymaster

    Hmmm, that sounds like a different problem (what NumPy version are you using?).

    Sorry I hadn’t got around to posting a new version yet. The solution I have implemented was to change this bit in astro_ds.py:

             image = self.GetData()
             
             for dim in range(0, self.ndim-2):
                 image = numpy.numarray.mlab.mean(image,0)
    

    to this:

    
             image = numpy.mean(self.GetData(), axis=0, dtype=None, keepdims=False)
    

    Thanks for posting the info.

    0
    0
    • This reply was modified 1 year, 9 months ago by  jturner.
    #1095

    nik
    Participant

    I am using numpy version 1.10.1

    And the problem I was trying to fix occurs while running
    outmask += numpy.where(bdq, 0., trdq) in Addcubes:

    TypeError: Cannot cast ufunc add output from dtype(‘float64’) to dtype(‘uint8’) with casting rule ‘same_kind’

    0
    0
    #1425

    jturner
    Keymaster

    Here’s a new version that addresses the couple of problems that cropped up on NumPy 1.9 & 1.10 and now uses astropy.io.fits in place of pyfits. This one also finally has a setup.py & documented Python interface, for anyone wanting to use it directly as a Python module instead of via PyRAF. Sorry that took a while and thanks to nik for reporting the NumPy 1.10 change.

    1
    0
Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.