esheldon / psfsim_config

Configuration files for the psf simulations
0 stars 0 forks source link

decide on the right flux distribution #4

Open esheldon opened 8 years ago

esheldon commented 8 years ago

pick a distribution of star fluxes

esheldon commented 8 years ago

Take input stars for DES PSFEx and extrapolate to lower fluxes. @rmjarvis will send a distribution

esheldon commented 8 years ago

@rmjarvis I see files like this, stars used for psfex, have a magnitude: ~mjarvis/work/psfex_rerun/y1a1-v11/psf_cats/DECam_00239305_psf.fits

Do you know how to convert this to the flux used in the config files?

esheldon commented 8 years ago

(I recall you did not use the zero point in the header, for example)

esheldon commented 8 years ago

@mjarvis here is a typical mag dist. Are the zero points from the image headers (instrumental mags) or did you fudge it to be closer to calibrated mags?

r-band-star-mag-nozp

rmjarvis commented 8 years ago

The magnitudes there are just passed through from the input catalogs, which are SExtractor cats.

I'm not sure how that connects to flux in ADU, but that's what GalSim means by flux: the total number of ADU in the drawn image.

rmjarvis commented 8 years ago

I see files like this, stars used for psfex, have a magnitude: ~mjarvis/work/psfex_rerun/y1a1-v11/psf_cats/DECam_00239305_psf.fits

And yes, these are the files I was referring to with the PSF information. The ones with flags==0 are the stars that passed all cuts, including B/F rejection, tape bumps, and PSFEx outlier rejection.

esheldon commented 8 years ago

I see, so for ones with BF rejection we will have fewer bright stars than a real image.

rmjarvis commented 8 years ago

Yes. Although, we could make the simulation with a full distribution of stars (including fainter ones as we discussed -- by extrapolating this distribution to fainter magnitudes) and then just select a subset to send to PSFEx/Piff for the PSF solution.

rmjarvis commented 8 years ago

It looks like the distribution between m=14 and m=16 is pretty close to linear, so that's probably the power law that we should extrapolate in both directions.

esheldon commented 8 years ago

I agree that should be extrapolated to the faint end, but I don't have a reason to assume it is right at the bright end.

I see y1a1-v05 uses the desdm psfex parameter file, does that also use the brighter stars?

https://github.com/rmjarvis/DESWL/blob/master/psfex/notes.txt

esheldon commented 8 years ago

I see there are no actual outputs for that run....

rmjarvis commented 8 years ago

I never built the psf catalogs for that run. I could do that. But I do think a power law is pretty close to right for the range we care about. (We won't want to extrapolate forever in the bright direction -- we can stop somewhere around the saturation level.)

esheldon commented 8 years ago

I thought that some zeropoint was stored in the headers but I can't find it. I wonder if this was put into the sextractor parameter file

esheldon commented 8 years ago

According to Robert it is 25

esheldon commented 8 years ago

Extrapolation of fluxes. I need to see what the saturation point was for some images.

function is

    Nperimage = p0*logflux + p1
    p0: -1.09774941717 +/- 0.00555761691564
    p1: 5.65553631112 +/- 0.0222397225906

Number is the number per image

flux-extrapolate

esheldon commented 8 years ago

looks like 10^6 might be a good number for the cutoff flux in ADU in r band

esheldon commented 8 years ago

might be better to look at a bunch of your findstars diagnostic plots though

esheldon commented 8 years ago

1 full exposure, all objects

decam_00177365

esheldon commented 8 years ago

that plot, with galaxies, is far steeper than the star plot.

And the star plot just does not have large enough range where objects were not removed (either too faint or too bright) to fit a proper power law (the previous fit won't work because it is not positive).

The slope seems too shallow, -0.4

I think I need to see the bright stars to get a good fit.

fluxfit-r

esheldon commented 8 years ago

from looking at full catalogs, with no cut at the high flux end for BF, it seems a slope of -0.5 might be OK for log10(flux) in [4.4,6]

fitstars-r-nobf

esheldon commented 8 years ago

this produces too many bright stars. I'm not sure if the issue is units or something else

esheldon commented 8 years ago

@rmjarvis I saw in an example yaml config that flux should be in ADU, is that right? I think sextractor flux is in ADU

rmjarvis commented 8 years ago

Yes. Fluxes in Galsim are all in ADU.

esheldon commented 8 years ago

this might have been because I fit in log flux space. So an approximate fix is to increase the power law from x**-0.5 to x**-1.5. It looks better, but need to run through SExtractor to see how the flux distribution looks

esheldon commented 8 years ago

fixing to x**-1.5 results in agreement between data and the sim in terms of the true flux (from the truth file), over the range where the fit was done. We probably don't trust s/g separation at fainter mags to do a good comparision ( I just used class_star )

compare-flux-dist