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 5 years, 9 months ago.
-
AuthorPosts
-
May 6, 2014 at 5:15 am #627
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.
-
This topic was modified 8 years, 3 months ago by
jturner.
-
This topic was modified 8 years, 3 months ago by
jturner.
-
This topic was modified 8 years ago by
jturner.
-
This topic was modified 8 years ago by
jturner.
-
This topic was modified 8 years ago by
jturner.
-
This topic was modified 5 years, 9 months ago by
jturner.
Attachments:
August 1, 2014 at 10:04 pm #682It 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.
-
This reply was modified 5 years, 9 months ago by
jturner.
Attachments:
June 9, 2015 at 9:22 pm #916A 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).
January 6, 2016 at 1:58 pm #1092Hi, 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
January 6, 2016 at 2:54 pm #1093Hmmm, 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.
-
This reply was modified 6 years, 7 months ago by
jturner.
January 6, 2016 at 3:12 pm #1095I 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’
October 21, 2016 at 8:48 pm #1425Here’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.
Attachments:
-
This topic was modified 8 years, 3 months ago by
-
AuthorPosts
You must be logged in to reply to this topic.