ATNF / yandasoft

Astronomical Calibration and Imaging Software
Other
16 stars 8 forks source link

Selavy fails during source extraction on Stokes V image #17

Open marxide opened 2 years ago

marxide commented 2 years ago

I am trying to run Selavy on a Stokes V ASKAP image. It fails with the following error:

FATAL selavy.log (0, 2042034444ab) [2022-05-27 19:04:51,109] - Askap error in selavy: Image test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits does not match any requested Stokes ('hasMatch' failed) (thrown in /home/askap-askapsoft/build/askap-analysis/askap/analysis/extraction/SourceDataExtractor.cc:323)

The error messages implies I may need to set the Stokes parameter in the configuration, but the only place I see to this from the documentation is for extracting spectra which is turned off in my parset. Furthermore, it appears the Stokes is set correctly in the image header (CRVAL4=4).

The input image is a 1000 x 1000 px Stokes V image cutout from the VAST survey in which I inserted a couple of sources (one positive, the other negative). The positive source model has an amplitude of 0.007 with centre (500, 500) px. Selavy finds this source as expected. From the log:

Component FluxPeak,X0,Y0,MAJ,MIN,PA = 0.00686331 (0.00004450), 500.024 (0.020), 499.907 (0.017), 8.355 (0.057), 5.047 (0.006), 0.954 (0.009)

I assume the negative source would be found if re-run using flagNegative = true?

Invocation

Using the Yandasoft docker image in serial mode.

docker run -v $PWD:/data -w /data csirocass/yandasoft:1.6.0-mpich selavy -c selavy.in

The same error occurs when I run this in distributed mode on Magnus using the ASKAPsoft module.

Probably not relevant but I noticed the versions reported in the log don't match the docker image tag:

INFO  analysis.askapparallel (0, 2042034444ab) [2022-05-27 19:00:38,908] - ASKAP selavy (serial)
INFO  analysis.askapparallel (0, 2042034444ab) [2022-05-27 19:00:38,908] - 1.2.0
INFO  analysis.askapparallel (0, 2042034444ab) [2022-05-27 19:00:38,908] - Compiled with OpenMP support
INFO  selavy.log (0, 2042034444ab) [2022-05-27 19:00:38,908] - ASKAP source finder 1.4.0

Should one or both of these be 1.6.0?

Image header

SIMPLE  =                    T / conforms to FITS standard
BITPIX  =                  -32 / array data type
NAXIS   =                    4 / number of array dimensions
NAXIS1  =                 1000
NAXIS2  =                 1000
NAXIS3  =                    1
NAXIS4  =                    1

BUNIT   = 'Jy/beam '           / Brightness (pixel) unit
EQUINOX =   2.000000000000E+03
RADESYS = 'FK5     '
LONPOLE =   1.800000000000E+02
LATPOLE =   5.249805555556E-01
PC01_01 =   1.000000000000E+00
PC02_01 =   0.000000000000E+00
PC03_01 =   0.000000000000E+00
PC04_01 =   0.000000000000E+00
PC01_02 =   0.000000000000E+00
PC02_02 =   1.000000000000E+00
PC03_02 =   0.000000000000E+00
PC04_02 =   0.000000000000E+00
PC01_03 =   0.000000000000E+00
PC02_03 =   0.000000000000E+00
PC03_03 =   1.000000000000E+00
PC04_03 =   0.000000000000E+00
PC01_04 =   0.000000000000E+00
PC02_04 =   0.000000000000E+00
PC03_04 =   0.000000000000E+00
PC04_04 =   1.000000000000E+00
CTYPE1  = 'RA---SIN'
CRVAL1  =   2.579170833333E+00
CDELT1  =  -6.944444444444E-04
CRPIX1  =               1254.0
CUNIT1  = 'deg     '
CTYPE2  = 'DEC--SIN'
CRVAL2  =   5.249805555556E-01
CDELT2  =   6.944444444444E-04
CRPIX2  =               1252.0
CUNIT2  = 'deg     '
CTYPE3  = 'FREQ    '
CRVAL3  =   8.874910000000E+08
CDELT3  =   1.000000000000E+00
CRPIX3  =   1.000000000000E+00
CUNIT3  = 'Hz      '
CTYPE4  = 'STOKES  '
CRVAL4  =   4.000000000000E+00
CDELT4  =   1.000000000000E+00
CRPIX4  =   1.000000000000E+00
CUNIT4  = '        '
PV2_1   =   0.000000000000E+00
PV2_2   =   0.000000000000E+00
DATE    = '2020-02-24T00:50:58.799000' /Date FITS file was written
TIMESYS = 'UTC     '           /Time system for HDU
ORIGIN  = 'ASKAPsoft'
BMAJ    =  0.00575587623849718 / Restoring beam major axis
BMIN    =   0.0034148642752317 / Restoring beam minor axis
BPA     =     58.0166576854815 / Restoring beam position angle
BTYPE   = 'Intensity'          /
DATE-OBS= '2019-08-27T14:28:14.841'
DATE-BEG= '2019-08-27T14:28:14.841'
DATE-END= '2019-08-27T14:40:31.384'
TELAPSE =      736.54299999999
TIMEUNIT= 's       '
MJD-BEG =      58722.602949549
MJD-END =      58722.611474352
MJD-OBS =      58722.602949549
MJDREF  =                  0.0

Parset

Selavy.image                                    = test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits
Selavy.imageHistory                             = ["Produced with ASKAPsoft version 1.2.1"]
Selavy.imagetype                                = fits
#
# These parameters define the measurement of spectral indices
Selavy.spectralTermsFromTaylor                  = true
Selavy.spectralTerms.nterms                     = 1
Selavy.findSpectralTerms                        = [false,false]
Selavy.nsubx                                    = 1
Selavy.nsuby                                    = 1
Selavy.overlapx                                 = 0
Selavy.overlapy                                 = 0
#
Selavy.resultsFile                              = selavy-test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.txt
Selavy.writeDuchampFiles                        = false
#
# Detection threshold
Selavy.snrCut                                   = 5
Selavy.flagGrowth                               = true
Selavy.growthCut                                = 3
#
Selavy.VariableThreshold                        = true
Selavy.VariableThreshold.reuse                  = true
Selavy.VariableThreshold.boxSize                = 50
Selavy.VariableThreshold.ThresholdImageName     = detThresh.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored
Selavy.VariableThreshold.NoiseImageName         = noiseMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored
Selavy.VariableThreshold.AverageImageName       = meanMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored
Selavy.VariableThreshold.SNRimageName           = snrMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored
Selavy.VariableThreshold.imagetype              = fits
Selavy.Weights.weightsImage                     = test-weights.v.VAST_0012+00A.SB9667.cont.taylor.0.fits
Selavy.Weights.weightsCutoff                    = 0.01
#
Selavy.Fitter.doFit                             = true
Selavy.Fitter.fitTypes                          = [full,psf]
Selavy.Fitter.numGaussFromGuess                 = true
Selavy.Fitter.maxReducedChisq                   = 10.
Selavy.Fitter.imagetype                         = fits
#
Selavy.threshSpatial                            = 5
Selavy.flagAdjacent                             = true
#
Selavy.minPix                                   = 3
Selavy.minVoxels                                = 3
Selavy.minChannels                              = 1
Selavy.sortingParam                             = -pflux
#
# Not performing RM Synthesis for this case
Selavy.RMSynthesis                              = false
#
# No spectral extraction being performed
Selavy.Components.extractSpectra                = false
Selavy.Components.extractNoiseSpectra           = false

Full log

Debug: registered context Global=0
INFO  analysis.askapparallel (0, 2042034444ab) [2022-05-27 19:00:38,908] - ASKAP selavy (serial)
INFO  analysis.askapparallel (0, 2042034444ab) [2022-05-27 19:00:38,908] - 1.2.0
INFO  analysis.askapparallel (0, 2042034444ab) [2022-05-27 19:00:38,908] - Compiled with OpenMP support
INFO  selavy.log (0, 2042034444ab) [2022-05-27 19:00:38,908] - ASKAP source finder 1.4.0
INFO  selavy.log (0, 2042034444ab) [2022-05-27 19:00:38,909] - Parset file contents:
Selavy.Components.extractNoiseSpectra=false
Selavy.Components.extractSpectra=false
Selavy.findSpectralTerms=[false,false]
Selavy.Fitter.doFit=true
Selavy.Fitter.fitTypes=[full,psf]
Selavy.Fitter.imagetype=fits
Selavy.Fitter.maxReducedChisq=10.
Selavy.Fitter.numGaussFromGuess=true
Selavy.flagAdjacent=true
Selavy.flagGrowth=true
Selavy.growthCut=3
Selavy.image=test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits
Selavy.imageHistory=["Produced with ASKAPsoft version 1.2.1"]
Selavy.imagetype=fits
Selavy.minChannels=1
Selavy.minPix=3
Selavy.minVoxels=3
Selavy.nsubx=1
Selavy.nsuby=1
Selavy.overlapx=0
Selavy.overlapy=0
Selavy.resultsFile=selavy-test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.txt
Selavy.RMSynthesis=false
Selavy.snrCut=5
Selavy.sortingParam=-pflux
Selavy.spectralTerms.nterms=1
Selavy.spectralTermsFromTaylor=true
Selavy.threshSpatial=5
Selavy.VariableThreshold=true
Selavy.VariableThreshold.AverageImageName=meanMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored
Selavy.VariableThreshold.boxSize=50
Selavy.VariableThreshold.imagetype=fits
Selavy.VariableThreshold.NoiseImageName=noiseMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored
Selavy.VariableThreshold.reuse=true
Selavy.VariableThreshold.SNRimageName=snrMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored
Selavy.VariableThreshold.ThresholdImageName=detThresh.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored
Selavy.Weights.weightsCutoff=0.01
Selavy.Weights.weightsImage=test-weights.v.VAST_0012+00A.SB9667.cont.taylor.0.fits
Selavy.writeDuchampFiles=false

INFO  analysis.weighter (0, 2042034444ab) [2022-05-27 19:00:38,909] - Using weights image: test-weights.v.VAST_0012+00A.SB9667.cont.taylor.0.fits
WARN  analysis.varthresh (0, 2042034444ab) [2022-05-27 19:00:38,913] - Variable Thresholder: reuse=true, but SNR image snrMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits can not be opened. Turning reuse off.
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:00:38,913] - Initialising parallel finder, based on Duchamp v1.6.3
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:00:38,926] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  selavy.log (0, 2042034444ab) [2022-05-27 19:00:38,929] - Parset file as used:
binaryCatalogue=selavy-catalogue.dpc
casaFile=selavy-results.crf
Components.extractNoiseSpectra=false
Components.extractSpectra=false
ds9File=selavy-results.reg
findSpectralTerms=[false,false]
fitAnnotationFile=selavy-fitResults.ann
fitBoxAnnotationFile=selavy-fitResults.boxes.ann
fitResultsFile=selavy-fitResults.txt
Fitter.doFit=true
Fitter.fitTypes=[full,psf]
Fitter.imagetype=fits
Fitter.maxReducedChisq=10.
Fitter.numGaussFromGuess=true
flagAdjacent=true
flagGrowth=true
growthCut=3
headerFile=selavy-results.hdr
image=test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits
imageHistory=["Produced with ASKAPsoft version 1.2.1"]
imagetype=fits
karmaFile=selavy-results.ann
logFile=selavy-Logfile.txt
minChannels=1
minPix=3
minVoxels=3
nsubx=1
nsuby=1
overlapx=0
overlapy=0
resultsFile=selavy-test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.txt
RMSynthesis=false
snrCut=5
sortingParam=-pflux
spectralTerms.nterms=1
spectralTermsFromTaylor=true
spectraTextFile=selavy-spectra.txt
subimageAnnotationFile=selavy-SubimageLocations.ann
threshSpatial=5
VariableThreshold=true
VariableThreshold.AverageImageName=meanMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored
VariableThreshold.boxSize=50
VariableThreshold.imagetype=fits
VariableThreshold.NoiseImageName=noiseMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored
VariableThreshold.reuse=true
VariableThreshold.SNRimageName=snrMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored
VariableThreshold.ThresholdImageName=detThresh.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored
votFile=selavy-results.xml
Weights.weightsCutoff=0.01
Weights.weightsImage=test-weights.v.VAST_0012+00A.SB9667.cont.taylor.0.fits
writeDuchampFiles=false

INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:00:38,937] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:00:38,939] - Dimensions of input image = 1000 x 1000 x 1 x 1
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:00:38,939] - Using subsection [1:1000,1:1000,1:1,1:1]
INFO  analysis.casainterface (0, 2042034444ab) [2022-05-27 19:00:38,941] - Read beam from casa image: [20.7212 arcsec, 12.2935 arcsec, 58.0167 deg]
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:00:38,941] - Reading data from image test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:00:38,982] - Dimensions are 1000 1000 1
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:00:38,982] - Preparing weights image
INFO  analysis.weighter (0, 2042034444ab) [2022-05-27 19:00:38,982] - Reading weights from test-weights.v.VAST_0012+00A.SB9667.cont.taylor.0.fits, section [1:1000,1:1000,1:1,1:1]
INFO  analysis.weighter (0, 2042034444ab) [2022-05-27 19:00:38,982] - Using casa::Slicer [0, 0, 0, 0] to [999, 999, 0, 0] with stride [1, 1, 1, 1], length [1000, 1000, 1, 1]
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:00:38,997] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.weighter (0, 2042034444ab) [2022-05-27 19:00:39,035] - Normalising weights image to maximum 7.23191e+06
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:00:39,042] - Defining the variable threshold maps
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:00:39,048] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:00:39,049] - Creating a new FITS image noiseMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored with the shape [1000, 1000, 1, 1]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:00:39,052] - Created Empty R/W FITSImage noiseMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:00:39,054] - Updating brightness units
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:00:39,628] - Setting Beam info
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:00:39,641] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:00:39,642] - Creating a new FITS image meanMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored with the shape [1000, 1000, 1, 1]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:00:39,645] - Created Empty R/W FITSImage meanMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:00:39,648] - Updating brightness units
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:00:40,257] - Setting Beam info
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:00:40,271] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:00:40,272] - Creating a new FITS image snrMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored with the shape [1000, 1000, 1, 1]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:00:40,275] - Created Empty R/W FITSImage snrMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:00:40,277] - Updating brightness units
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:00:40,804] - Setting Beam info
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:00:40,816] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:00:40,817] - Creating a new FITS image detThresh.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored with the shape [1000, 1000, 1, 1]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:00:40,820] - Created Empty R/W FITSImage detThresh.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:00:40,822] - Updating brightness units
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:00:41,372] - Setting Beam info
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:00:41,383] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.varthresh (0, 2042034444ab) [2022-05-27 19:00:41,387] - Will calculate the pixel-by-pixel signal-to-noise map
INFO  analysis.varthresh (0, 2042034444ab) [2022-05-27 19:00:41,387] - Will write the SNR map to snrMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits
INFO  analysis.varthresh (0, 2042034444ab) [2022-05-27 19:00:41,387] - Will write the noise map to noiseMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits
INFO  analysis.varthresh (0, 2042034444ab) [2022-05-27 19:00:41,387] - Will write the average background map to meanMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits
INFO  analysis.varthresh (0, 2042034444ab) [2022-05-27 19:00:41,387] - Will write the flux threshold map to detThresh.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits
INFO  analysis.varthresh (0, 2042034444ab) [2022-05-27 19:00:41,387] - Will calculate box-wise signal-to-noise in image of shape [1000, 1000, 1, 1] using  'spatial' mode with chunks of shape [1000, 1000, 1, 1] and a box of shape [50, 50]
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:15,570] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:04:15,572] - Writing a slice with the shape [1000, 1000, 1, 1] into a FITS image noiseMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored at [0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:15,573] - Writing array to FITS image at (Cindex)[0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:19,582] - Written 1000000 elements
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:19,622] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:04:19,623] - Reading a slice of the FITS image noiseMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored slice [0, 0, 0, 0] to [999, 999, 0, 0] with stride [1, 1, 1, 1], length [1000, 1000, 1, 1]
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:04:19,657] - Writing a slice with the shape [1000, 1000, 1, 1] into a FITS image noiseMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored at [0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:19,657] - Writing array to FITS image at (Cindex)[0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:24,052] - Written 1000000 elements
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:24,095] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:04:24,097] - Writing a slice with the shape [1000, 1000, 1, 1] into a FITS image meanMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored at [0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:24,097] - Writing array to FITS image at (Cindex)[0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:28,570] - Written 1000000 elements
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:28,615] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:04:28,616] - Reading a slice of the FITS image meanMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored slice [0, 0, 0, 0] to [999, 999, 0, 0] with stride [1, 1, 1, 1], length [1000, 1000, 1, 1]
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:04:28,644] - Writing a slice with the shape [1000, 1000, 1, 1] into a FITS image meanMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored at [0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:28,644] - Writing array to FITS image at (Cindex)[0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:33,115] - Written 1000000 elements
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:33,150] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:04:33,151] - Writing a slice with the shape [1000, 1000, 1, 1] into a FITS image snrMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored at [0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:33,151] - Writing array to FITS image at (Cindex)[0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:37,495] - Written 1000000 elements
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:37,536] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:04:37,537] - Reading a slice of the FITS image snrMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored slice [0, 0, 0, 0] to [999, 999, 0, 0] with stride [1, 1, 1, 1], length [1000, 1000, 1, 1]
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:04:37,567] - Writing a slice with the shape [1000, 1000, 1, 1] into a FITS image snrMap.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored at [0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:37,568] - Writing array to FITS image at (Cindex)[0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:42,014] - Written 1000000 elements
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:42,054] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:04:42,056] - Writing a slice with the shape [1000, 1000, 1, 1] into a FITS image detThresh.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored at [0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:42,056] - Writing array to FITS image at (Cindex)[0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:46,535] - Written 1000000 elements
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:46,581] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:04:46,583] - Reading a slice of the FITS image detThresh.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored slice [0, 0, 0, 0] to [999, 999, 0, 0] with stride [1, 1, 1, 1], length [1000, 1000, 1, 1]
INFO  analysis.fitsImageAccessor (0, 2042034444ab) [2022-05-27 19:04:46,615] - Writing a slice with the shape [1000, 1000, 1, 1] into a FITS image detThresh.test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored at [0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:46,615] - Writing array to FITS image at (Cindex)[0, 0, 0, 0]
INFO  analysis.FITSImageRW (0, 2042034444ab) [2022-05-27 19:04:50,974] - Written 1000000 elements
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,005] - Setting threshold to be 5
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,005] - Searching with a variable threshold
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,014] - Intermediate list has 1 objects. Now merging.
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,018] - Merged list has 1 objects.
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,018] - Found 1 objects, of which 0 are on the boundary and 1 are good.
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,018] - Fitting source profiles.
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,018] - Setting up source #1 / 1, size 132, peaking at (x,y)=(500,500)
INFO  analysis.radioSource (0, 2042034444ab) [2022-05-27 19:04:51,020] - Fitting source J001224+000011 at RA=00:12:24.5, Dec=+00:00:11, or global position (x,y)=(499.988,499.828)
INFO  analysis.radioSource (0, 2042034444ab) [2022-05-27 19:04:51,020] - detect threshold = 0.000515887,  peak flux = 0.00698555,  noise level = 0.000171746
INFO  analysis.radioSource (0, 2042034444ab) [2022-05-27 19:04:51,021] - Commencing fits of type "full"
INFO  analysis.sourcefitting (0, 2042034444ab) [2022-05-27 19:04:51,025] - Num Gaussians = 1, Converged, chisq = 95.9945, chisq/nu =  0.767956, dof = 125, RMS = 0.852778
INFO  analysis.radioSource (0, 2042034444ab) [2022-05-27 19:04:51,025] - Commencing fits of type "psf"
INFO  analysis.sourcefitting (0, 2042034444ab) [2022-05-27 19:04:51,028] - Num Gaussians = 1, Converged, chisq = 140.92, chisq/nu =  1.10094, dof = 128, RMS = 1.03324
INFO  analysis.radioSource (0, 2042034444ab) [2022-05-27 19:04:51,028] - BEST FIT: 1 Gaussians with fit type "full", chisq = 95.9945, chisq/nu =  0.767956, RMS = 0.852778
INFO  analysis.sourcefitting (0, 2042034444ab) [2022-05-27 19:04:51,028] - Component FluxPeak,X0,Y0,MAJ,MIN,PA = 0.00686331 (0.00004450), 500.024 (0.020), 499.907 (0.017), 8.355 (0.057), 5.047 (0.006), 0.954 (0.009)
INFO  analysis.radioSource (0, 2042034444ab) [2022-05-27 19:04:51,028] - -----------------------
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,028] - Retrieving lists from workers
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,028] - Beginning the cleanup
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,028] - num edge sources in cube = 0
INFO  analysis.weighter (0, 2042034444ab) [2022-05-27 19:04:51,028] - Using weights image: test-weights.v.VAST_0012+00A.SB9667.cont.taylor.0.fits
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:51,040] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,041] - Initialising parallel finder, based on Duchamp v1.6.3
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:51,049] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:51,056] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,057] - Dimensions of input image = 1000 x 1000 x 1 x 1
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,057] - Using subsection [1:1000,1:1000,1:1,1:1]
INFO  analysis.casainterface (0, 2042034444ab) [2022-05-27 19:04:51,058] - Read beam from casa image: [20.7212 arcsec, 12.2935 arcsec, 58.0167 deg]
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:51,065] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,067] - Finished parameterising 0 edge sources
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,067] - Now have a total of 1 sources.
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,067] - Finished adding sources to cube. Now have 1 objects.
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,067] - Found 1 sources.
INFO  analysis.weighter (0, 2042034444ab) [2022-05-27 19:04:51,067] - Using weights image: test-weights.v.VAST_0012+00A.SB9667.cont.taylor.0.fits
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:51,075] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,076] - Initialising parallel finder, based on Duchamp v1.6.3
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:51,085] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:51,092] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,095] - Dimensions of input image = 1000 x 1000 x 1 x 1
INFO  analysis.parallelanalysis (0, 2042034444ab) [2022-05-27 19:04:51,095] - Using subsection [1:1000,1:1000,1:1,1:1]
INFO  analysis.casainterface (0, 2042034444ab) [2022-05-27 19:04:51,097] - Read beam from casa image: [20.7212 arcsec, 12.2935 arcsec, 58.0167 deg]
INFO  analysis.CASA (0, 2042034444ab) [2022-05-27 19:04:51,106] - FITSCoordinateUtil::fromFITSHeader: Neither SPECSYS nor VELREF keyword given, spectral reference frame not defined ...
FATAL selavy.log (0, 2042034444ab) [2022-05-27 19:04:51,109] - Askap error in selavy: Image test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits does not match any requested Stokes ('hasMatch' failed) (thrown in /home/askap-askapsoft/build/askap-analysis/askap/analysis/extraction/SourceDataExtractor.cc:323)
Askap error in selavy: Image test-image.v.VAST_0012+00A.SB9667.cont.taylor.0.restored.fits does not match any requested Stokes ('hasMatch' failed) (thrown in /home/askap-askapsoft/build/askap-analysis/askap/analysis/extraction/SourceDataExtractor.cc:323)

Test data

test-image-data.tar.gz

mattwhiting commented 2 years ago

I will take a closer look, but I suspect the issue is with the code that does the extraction (in this case of the background region around an island for its parameterisation). It probably defaults to extracting the Stokes I, and needs to be told about the polarisation of the input image.

And to answer your question - yes, setting flagNegative to true would search for negative sources (by inverting the image and running the same detection algorithm)