Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What units are the fluxes in? #10

Open
keflavich opened this issue Sep 5, 2022 · 5 comments
Open

What units are the fluxes in? #10

keflavich opened this issue Sep 5, 2022 · 5 comments

Comments

@keflavich
Copy link
Contributor

I'm seeing fluxes that don't make a ton of sense to me. The data are in units of MJy/sr with values typically ranging from ~10 (very faint) to ~1000 (just shy of saturation). The fluxes I'm getting out are ~10^12. I haven't figured out a plausible way to go from my values to these large values; my best guess is that I'm using the wrong column of the data.

        x                  y                 flux       passno       dx            dy         dflux    ... dspread_model      fluxiso               xiso                  yiso             sky                   skycoords               
                                                                                                       ...                                                                                                        deg,deg                
------------------ ------------------ ----------------- ------ ------------- ------------- ----------- ... ------------- ------------------ -------------------- ---------------------- ---------- --------------------------------------
3.9103704690933228  143.8142168521881   5088090000000.0    0.0  6.207727e-12  9.424205e-12   18.456875 ...           0.0   -2117828100000.0 -0.40915542922880455     1.1479963851393629 67716650.0 266.51613684405095,-28.762696248397624
 3.273825764656067 154.50857508182526   5313295000000.0    0.0  9.482968e-12 1.0564544e-11   20.594322 ... 6.1942395e-13   -1804418400000.0 -0.03846454776117885    -1.3845508919400695 67716650.0    266.5163501986976,-28.7627043061389
 5.908046193420887  44.41884535551071 143118180000000.0    0.0  1.194836e-13  2.584414e-13   14.043365 ...           0.0 -563289900000000.0 -0.20898381328605328   -0.09889471523435388 67716650.0   266.5141551667673,-28.76268980490588
 5.343937045670504  64.24529383204028 146644500000000.0    0.0  1.548175e-13 2.9147596e-13   15.726514 ...           0.0 -458500480000000.0  0.13061350976872055    0.09912904750373215 67716650.0  266.5145505070667,-28.762693986368582
5.6917260307742215 1430.0166215533839      2794872800.0    0.0 6.4634645e-11  7.527967e-11 0.101019494 ...           0.0      -2237617000.0   0.5470933590948359   0.055239958288194835 67716650.0  266.54177114762217,-28.76229424830571```
@keflavich
Copy link
Contributor Author

Ah.... this might be an indication that something went horrendously wrong. I have other catalogs with reasonable numbers in them.

@keflavich
Copy link
Contributor Author

Right, so, it was something going wrong. I tried using the 'WHT' HDU provided by JWST, and that was a mistake - it resulted in dramatically incorrect values.

I don't understand why this would happen, though, as the fluxes should be nearly independent of the weights.

@schlafly
Copy link
Owner

schlafly commented Sep 6, 2022

The fluxes are in the same units as the images. The goal was to not know about image units, but I did fail in that goal in that the choice of PSF stamp size depends on the flux at the location of the sources---we want to use larger PSF stamps for very bright sources to do a better job preventing diffraction spikes, etc., from contaminating other sources. I would need to do something more elegant there to actually make the pipeline agnostic to units.

I don't know anything about the WHT HDU provided by JWST. One possible likely source of confusion is that the 'weight' that fit_im wants is 1/sigma, rather than 1/sigma^2. I should really go through the code and replace weight -> isig everywhere.

I agree that if the weight image is close to constant that it's hard for me to see problems occurring here unless the weights are so large or small that they're leading to underflow / overflow problems. I would need more information to say something helpful.

When I want to make sure the weights aren't crazy I usually do something like verify that (image - median(sky)) * isig ~ N(0, 1), though it sounds like your images have enough exciting structure in them that that might not be adequate.

@keflavich
Copy link
Contributor Author

Oh, that definitely is a source of confusion - I had assumed inverse variance, not inverse error, weighting. Hopefully that explains why some of the faint stars were being missed.

@schlafly
Copy link
Owner

schlafly commented Sep 6, 2022

To be clear, the actual weighting is what you expect---we're minimizing chi^2. But the 'weight' argument is a ~misnomer and should be inverse sigma.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants