SourceXtractorPlusPlus icon indicating copy to clipboard operation
SourceXtractorPlusPlus copied to clipboard

Zeropoint should be configurable per image

Open ayllon opened this issue 4 years ago • 3 comments

To be done on the Python config. Might be nice to have, in general, arbitrary key/value per image, so it is easy to reuse should we need to.

ayllon avatar Nov 30 '20 08:11 ayllon

Well, this is really a comment. This functionality kind of exists via the parameter "flux_scale_keyword", no? Maybe that parameter could be generalized in the sense that if the given value is a float that value is being used instead of the keyword value? Of course this is all in the linear regime instead of the mag regime, but that's not really an issue, or?

mkuemmel avatar Jun 11 '21 07:06 mkuemmel

Hello everyone. I apologize if this is not the place to ask the following question.

I am trying to use SourceXtractorPlusPlus in dual mode to do photometry and I don't understand how to indicate the zero point in magnitudes for each image. I tried modifying the flux_scale or modifying the python script but I don't get the expected results.

I try to explain my doubt better: In the previous version of sextractor, I put the value of the zero point in the configuration file

MAG_ZEROPOINT 30.0 # zero-point magnitude and that value is the one used to calculate the magnitude

-2.5*log(flux) + MAG_ZEROPOINT where flux is the flux of the image that is being measured.

If I am using this example from the tutorial, How do I indicate the zero points for each band separately?

Thank you!

JPCalderon avatar Dec 07 '23 02:12 JPCalderon

Hi @JPCalderon

both ways do work. You can either provide one ZP in the python configuration file and then regulate between bands with the FLUX_SCALE keyword. Personally I have not done this, but I know that other people use FLUX_SCALE.

You can also specify several ZP's and apply then to images in different bands. The syntax I use for this is something like (schematical):

mag_zeropoints = {'B': 21.0, 'R': 22.0, 'I': 23.0} . . for band, group in mesgroup: . . mag_AB[i] = DependentParameter( lambda f, zp=mag_zeropoints[band]: -2.5 * np.log10(f) + zp, flux[i])

with flux[i] the flux in instrumental units measured in one band.

  • please note the 'zp=' notation which is necessary due to the lambda formalism;
  • obviously the variable 'band' in the split groups must correspond to the keywords in the dictionary;

Feel free to upload you python cofniguration file.

mkuemmel avatar Dec 07 '23 11:12 mkuemmel