[LSST|dm-users 639] Re: Detection and Measurement of Postage Stamp

Robert Lupton the Good rhl at astro.princeton.edu
Mon May 11 15:10:29 PDT 2015


I don't know how you are running your task, but if it's using commandLineTask then 
   --show=*[Bb]ackground* 
should show all configuration parameters matching the glob. (Benighted [t]csh users will need to quote the pattern)

        R

> On 11 May 2015, at 18:00, Jim Bosch <jbosch at astro.princeton.edu> wrote:
> 
> I think this should be just a matter of setting
> 
> detectSourcesConfig.reEstimateBackground = False
> 
> 
> 
> Jim
> 
> 
> 
>> On Mon, May 11, 2015 at 5:41 PM, Will Dawson <will at dawsonresearch.com> wrote:
>> I am trying to use DM Stack detect and analyze in object in a small postage stamp (see attached example, log scale). I know I can use lsst.afw.detection.Threshold() with lsst.afw.detection.FootprintSet() to create a footprint for the detected object. But I also (first) tried lsst.meas.algorithms.SourceDetectionTask(config=detectSourcesConfig, "other args") with config set as:
>> 
>> detectSourcesConfig   = measAlg.SourceDetectionConfig(thresholdType='value’)
>> or
>> detectSourcesConfig   = measAlg.SourceDetectionConfig(thresholdType='value',thresholdValue=0)
>> 
>> and got the error at the end of this email. I am not entirely sure how to parse this error statement, but if I had to guess: no objects are being detected because it is trying to estimate the background based on this stamp which contains primary just the object thus when it does image - background there is nothing above threshold left to detect. Or it chokes when trying to estimate the background.
>> 
>> Is there an option to run lsst.meas.algorithms.SourceDetectionTask with the background estimation/ subtraction process turned off? For example when detecting objects on an image that already has the background subtracted. Perhaps the only option is to stick with the detection.FootprintSet method. 
>> 
>> Thanks,
>> Will
>> 
>> 
>>  <28x28stamp.png>
>> 
>> ---------------------------------------------------------------------------
>> InvalidParameterError                     Traceback (most recent call last)
>> <ipython-input-66-d08d86b9540f> in <module>()
>>       2 # catalog atually stores stuff)
>>       3 table   = afwTable.SourceTable.make(schema)
>> ----> 4 catalog = detect.makeSourceCatalog(table, exposure, sigma=3)
>> 
>> /Users/dawson/lsst/DarwinX86/pipe_base/10.0+2/python/lsst/pipe/base/timer.pyc in wrapper(self, *args, **keyArgs)
>>     116         logInfo(obj = self, prefix = func.__name__ + "Start")
>>     117         try:
>> --> 118             res = func(self, *args, **keyArgs)
>>     119         finally:
>>     120             logInfo(obj = self, prefix = func.__name__ + "End")
>> 
>> /Users/dawson/lsst/DarwinX86/meas_algorithms/10.0+2/python/lsst/meas/algorithms/detection.pyc in run(self, table, exposure, doSmooth, sigma, clearMask)
>>     313             raise ValueError("Table has incorrect Schema")
>>     314         fpSets = self.detectFootprints(exposure=exposure, doSmooth=doSmooth, sigma=sigma,
>> --> 315                                        clearMask=clearMask)
>>     316         sources = afwTable.SourceCatalog(table)
>>     317         table.preallocate(fpSets.numPos + fpSets.numNeg) # not required, but nice
>> 
>> /Users/dawson/lsst/DarwinX86/pipe_base/10.0+2/python/lsst/pipe/base/timer.pyc in wrapper(self, *args, **keyArgs)
>>     116         logInfo(obj = self, prefix = func.__name__ + "Start")
>>     117         try:
>> --> 118             res = func(self, *args, **keyArgs)
>>     119         finally:
>>     120             logInfo(obj = self, prefix = func.__name__ + "End")
>> 
>> /Users/dawson/lsst/DarwinX86/meas_algorithms/10.0+2/python/lsst/meas/algorithms/detection.pyc in detectFootprints(self, exposure, doSmooth, sigma, clearMask)
>>     443             fpSets.background = bkgd
>>     444             self.log.log(self.log.INFO, "Resubtracting the background after object detection")
>> --> 445             mi -= bkgd.getImageF()
>>     446             del mi
>>     447 
>> 
>> /Users/dawson/lsst/DarwinX86/afw/10.0+3/python/lsst/afw/math/mathLib.pyc in getImageF(self, *args)
>>    5736         getImageF(Background self) -> boost::shared_ptr< lsst::afw::image::Image< float > >
>>    5737         """
>> -> 5738         return _mathLib.Background_getImageF(self, *args)
>>    5739 
>>    5740     def getImageI(self, *args):
>> 
>> InvalidParameterError: 
>>   File "src/math/Interpolate.cc", line 60, in std::pair<std::vector<double>, std::vector<double> > lsst::afw::math::(anonymous namespace)::recenter(const std::vector<double> &, const std::vector<double> &)
>>     You must provide at least 1 point {0}
>>   File "src/math/BackgroundMI.cc", line 196, in void lsst::afw::math::BackgroundMI::_setGridColumns(const Interpolate::Style, const lsst::afw::math::UndersampleStyle, const int, const std::vector<int> &) const
>>     setting _gridcolumns {1}
>> lsst::pex::exceptions::InvalidParameterError: 'You must provide at least 1 point {0}; setting _gridcolumns {1}'
>> 
>> 
>> _______________________________________________
>> dm-users mailing list
>> dm-users at lists.lsst.org
>> https://lists.lsst.org/mailman/listinfo/dm-users
> 
> _______________________________________________
> dm-users mailing list
> dm-users at lists.lsst.org
> https://lists.lsst.org/mailman/listinfo/dm-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lsst.org/pipermail/dm-users/attachments/20150511/db587683/attachment-0001.html>


More information about the dm-users mailing list