Closed xiaoguaishoubaobao closed 1 year ago
SourceExtractor performs aperture photometry by subsampling pixels by a factor of 5. The photutils aperture-photometry default uses the exact aperture overlap. As noted in the docs (https://photutils.readthedocs.io/en/latest/aperture.html#aperture-and-pixel-overlap), you can set method='subpixel', subpixels=5
to use SourceExtractor's approximation. Also note that there is a SourceExtractor configuration parameter
called MASK_TYPE
for dealing with neighboring sources that can affect its results.
Thank you very much for your reply I've used both of the 2 points you mentioned, but it doesn't work, it's still different I didn't describe the problem very clearly, I'll re-describe it
this is in Photutils ` aperture = CircularAperture(positions, r=3.) phot_table = aperture_photometry(gt_mask_value[:, :], aperture,method='subpixel', subpixels=5) id xcenter ycenter aperture_sum_0
`
this is in SourceExtractor
`
"#-------------------------------- Catalog ------------------------------------\n"
"\n"
"CATALOG_NAME test.cat # name of the output catalog\n"
"CATALOG_TYPE ASCII_HEAD # NONE,ASCII,ASCII_HEAD, ASCII_SKYCAT,\n"
" # ASCII_VOTABLE, FITS_1.0 or FITS_LDAC\n"
"PARAMETERS_NAME default.param # name of the file containing catalog contents\n"
" \n"
"#------------------------------- Extraction ----------------------------------\n"
" \n"
"DETECT_TYPE CCD # CCD (linear) or PHOTO (with gamma correction)\n"
"DETECT_MINAREA 10 # min. # of pixels above threshold\n"
"DETECT_THRESH 0.5 #
"PHOT_APERTURES 3 # MAG_APER aperture diameter(s) in pixels\n"
"PHOT_AUTOPARAMS 2.5,4.0 # MAG_AUTO parameters: <Kron_fact>,<min_radius>\n"
"PHOT_PETROPARAMS 2.0,4.0 # MAG_PETRO parameters: <Petrosian_fact>,\n"
" # <min_radius>\n"
"\n"
"SATUR_LEVEL 50000.0 # level (in ADUs) at which arises saturation\n"
"SATUR_KEY SATURATE # keyword for saturation level (in ADUs)\n"
" \n"
"MAG_ZEROPOINT 0.0 # magnitude zero-point\n"
"MAG_GAMMA 4.0 # gamma of emulsion (for photographic scans) \n"
"GAIN 0.0 # detector gain in e-/ADU\n"
"GAIN_KEY GAIN # keyword for detector gain in e-/ADU\n"
"PIXEL_SCALE 0 # size of pixel in arcsec (0=use FITS WCS info)这个很坑 直接用默认0就行\n"
" \n"
"#------------------------- Star/Galaxy Separation ----------------------------\n"
" \n"
"SEEING_FWHM 0.8 # stellar FWHM in arcsec\n"
"STARNNW_NAME default.nnw # Neural-Network_Weight table filename\n"
" \n"
"#------------------------------ Background -----------------------------------\n"
" \n"
"BACK_SIZE 64 # Background mesh: <size> or <width>,<height>\n"
"BACK_FILTERSIZE 3 # Background filter: <size> or <width>,<height>\n"
" \n"
"BACKPHOTO_TYPE LOCAL # can be GLOBAL or LOCAL\n"
" \n"
"#------------------------------ Check Image ----------------------------------\n"
" \n"
"CHECKIMAGE_TYPE SEGMENTATION # can be NONE, BACKGROUND, BACKGROUND_RMS,\n"
" # MINIBACKGROUND, MINIBACK_RMS, -BACKGROUND,\n"
" # FILTERED, OBJECTS, -OBJECTS, SEGMENTATION,\n"
" # or APERTURES\n"
"CHECKIMAGE_NAME sextractor_check.fits # Filename for the check-image\n"
" \n"
"#--------------------- Memory (change with caution!) -------------------------\n"
" \n"
"MEMORY_OBJSTACK 3000 # number of objects in stack\n"
"MEMORY_PIXSTACK 300000 # number of pixels in stack\n"
"MEMORY_BUFSIZE 1024 # number of lines in buffer\n"
" \n"
"#----------------------------- Miscellaneous ---------------------------------\n"
" \n"
"VERBOSE_TYPE QUIET # can be QUIET, NORMAL or FULL\n"
"HEADER_SUFFIX .head # Filename extension for additional headers\n"
"WRITE_XML N # Write XML file (Y/N)?\n"
"XML_NAME sex.xml # Filename for XML output\n"
"\n"
"#----------------------------- ASSOC parameters ---------------------------------\n"
"\n"
"ASSOC_NAME sky.list # name of the ASCII file to ASSOCiate, the expected pixel \n"
" # coordinates list given as [id, xpos, ypos]\n"
"ASSOC_DATA 0 # columns of the data to replicate (0=all), replicate id\n"
" # of the object in the SExtractor output file\n"
"ASSOC_PARAMS 2,3 # columns of xpos,ypos[,mag] in the expected pixel\n"
" # coordinates list\n"
"ASSOC_RADIUS 2.0 # cross-matching radius (pixels)\n"
"ASSOC_TYPE NEAREST # ASSOCiation method: FIRST, NEAREST, MEAN,\n"
" # MAG_MEAN, SUM, MAG_SUM, MIN or MAX\n"
"ASSOCSELEC_TYPE ALL # ASSOC selection type: ALL, MATCHED or -MATCHED\n"
`
and the input data is phosim mask.fits data with nobackground
mask.fits have 145 objects ,I used index 7 object
I extract except the object whose index is 8
链接:https://pan.baidu.com/s/1XliU3tg2rvtoXns5uBYm_A 提取码:qwsy
please help me thanks a lot for your reply
The results I used are basically the same as those of APT. Explain that the photometric result of photoutils is correct Sex should be a setting problem but I don't know what is the problem ,hahahah
You are subtracting a local background in SourceExtractor, but you are not doing that in photutils
. To do a direct comparison, you would need to turn off background subtraction in SourceExtractor:
BACK_TYPE MANUAL
BACK_VALUE 0.0
You can easily test the correctness of photutils aperture photometry by performing photometry on an array of all ones. You will get back the area of the aperture.
Sorry I still get the same result when I use the parameters you said There is no background in the mask file. Why do you need to remove the background in sex? Below is my config file `
CATALOG_NAME test.cat # name of the output catalog CATALOG_TYPE ASCII_HEAD # NONE,ASCII,ASCII_HEAD, ASCII_SKYCAT,
PARAMETERS_NAME default.param # name of the file containing catalog contents
DETECT_TYPE CCD # CCD (linear) or PHOTO (with gamma correction)
DETECT_MINAREA 10 # min. # of pixels above threshold
DETECT_THRESH 0.6 #
FILTER Y # apply filter for detection (Y or N)? FILTER_NAME default.conv # name of the file containing the filter
DEBLEND_NTHRESH 64 # Number of deblending sub-thresholds DEBLEND_MINCONT 0.0003 # Minimum contrast parameter for deblending
CLEAN Y # Clean spurious detections? (Y or N)? CLEAN_PARAM 1.0 # Cleaning efficiency
MASK_TYPE BLANK # type of detection MASKing: can be one of
PHOT_APERTURES 3 # MAG_APER aperture diameter(s) in pixels
PHOT_AUTOPARAMS 2.5,4.0 # MAG_AUTO parameters:
SATUR_LEVEL 50000.0 # level (in ADUs) at which arises saturation SATUR_KEY SATURATE # keyword for saturation level (in ADUs)
MAG_ZEROPOINT 0.0 # magnitude zero-point MAG_GAMMA 4.0 # gamma of emulsion (for photographic scans) GAIN 0.0 # detector gain in e-/ADU GAIN_KEY GAIN # keyword for detector gain in e-/ADU PIXEL_SCALE 0 # size of pixel in arcsec (0=use FITS WCS info)这个很坑 直接用默认0就行
SEEING_FWHM 0.8 # stellar FWHM in arcsec STARNNW_NAME default.nnw # Neural-Network_Weight table filename
BACK_TYPE MANUAL # can be GLOBAL or LOCAL
BACK_VALUE 0.0 # can be GLOBAL or LOCAL
BACK_SIZE 64 # Background mesh:
CHECKIMAGE_TYPE SEGMENTATION # can be NONE, BACKGROUND, BACKGROUND_RMS,
# FILTERED, OBJECTS, -OBJECTS, SEGMENTATION,
# or APERTURES
CHECKIMAGE_NAME sextractor_check.fits # Filename for the check-image
MEMORY_OBJSTACK 3000 # number of objects in stack MEMORY_PIXSTACK 300000 # number of pixels in stack MEMORY_BUFSIZE 1024 # number of lines in buffer
VERBOSE_TYPE QUIET # can be QUIET, NORMAL or FULL HEADER_SUFFIX .head # Filename extension for additional headers WRITE_XML N # Write XML file (Y/N)? XML_NAME sex.xml # Filename for XML output
ASSOC_NAME set_0.list # name of the ASCII file to ASSOCiate, the expected pixel
ASSOC_DATA 0 # columns of the data to replicate (0=all), replicate id
ASSOC_PARAMS 2,3 # columns of xpos,ypos[,mag] in the expected pixel
ASSOC_RADIUS 2.0 # cross-matching radius (pixels) ASSOC_TYPE NEAREST # ASSOCiation method: FIRST, NEAREST, MEAN,
ASSOCSELEC_TYPE ALL # ASSOC selection type: ALL, MATCHED or -MATCHED
`
Looking forward to your reply
I found some new problems When I set the aperture directly to a larger size, like 12 18 The flux obtained in the three software is the same, which means that it has nothing to do with the background But when the aperture is relatively small, the flux obtained by sextractor is obviously smaller than that of the other two softwares I suspected that the center point was different, but after I set the same center point, the result is still the same I now suspect that the aperture of the sextractor is smaller than the other 2 software after setting the same value. For example, 3,5,7 will actually become 2,4,6. can you help me
The problem is solved. Sex uses the diameter, and the other two software uses the radius. It is the same when they are unified.
i note this
[issues](https://github.com/astropy/photutils/issues/407)