Hi David,
On Nov 10, 2008, at 4:01 AM, David Nutter wrote:
> If it helps, I am trying to open a datacube, measure the rms in each
> pixel, and set any pixels to bad if the rms is greater than a
> predefined value. [Please also shout if I can't do this with perl!]
Do you have to do it with Perl? You could just as easily do KAPPA/
THRESH:
thresh in=input out=output comp=var thrlo=-10000 newlo=bad thrhi=5
newhi=bad
...or something like that. It'll probably be quicker.
Mind you, that's if you already have a variance component set up. If
you don't, then you'd probably want to use COLLAPSE (with
ESTIMATOR=RMS) to determine the RMS per pixel, then threshold the
resulting variance image, then grow that image back into a cube, then
copy the bad pixels into the input NDF.
Alternatively, as Tim said, it sounds like you're doing pretty much
what I've already (mostly) put into place for the ORAC-DR QA pipeline.
It takes a variance component (calculated from the Tsys values in the
header) and compares it with the actual variance in the data
(calculated by doing COLLAPSE with ESTIMATOR=RMS). Any values that
differ by more than N% get masked out. Is this similar to what you want?
The primitive that does this (_QA_RMS_TSYS_CONSISTENCY_) will be
released with the next Starlink release. I'm currently targetting a
Wednesday release, pending testing.
Cheers,
Brad.
|