OutThere-JWST / NISPureParallel

NIRISS Pure Parallel Processing Scripts
GNU General Public License v3.0
2 stars 1 forks source link

Incorporate Automated Magnitude Limits #2

Closed TheSkyentist closed 2 weeks ago

TheSkyentist commented 5 months ago

How can we use exposure times and/or weight/depth maps to calibrate contamination modeling/extraction/redshift fitting magnitude depths?

TheSkyentist commented 3 months ago

We detect sources with direct imaging combined across all direct filters. Therefore, our detectability is related to the total direct exposure time.

We want to extract sources such that we obtain some minimum SNR in the grism. Therefore this is based on the maximum exposure time in a given filter for grism observations.

I am attempting to target a median continuum SNR of 2 for extractions.

In general, this relationship is linear (i.e. we spend as much time in the direct imaging as we do in the maximum grism).

time.pdf

Given the variety in the exposure times, background levels, exposure patterns in the grism, I don't pursue an approach where I decide the magnitude limit based purely on the exposure time of the grism.

Therefore, I do it from the imaging itself. Since the imaging and grism times almost always track, it should be a constant magnitude offset between the detection limit of the photometry, and that of the grism (with an extra term related to the relative exposure times).

Here is an example field: leo-06. Here is the histogram of detected sources:

mag.pdf

Looks like we'd expect, power law distributed with a turnover. I'm not getting too fancy here, just using KDE to find the mode of the distribution (marked in red). as the "direct imaging depth".

I then model and extract all the way down to 31st magnitude, much fainter than you would ever do in this case, since leo-06 has equal time in imaging as it does in the grism.

I compare the median pixel SNR in the 1D optimal extractions to the source magnitude:

spec_snr.pdf

As expected, the median SNR goes down with fainter sources. I plot the modal magnitude we computed before in red, along with a black line depicting SNR~2.

In general, it seems like targetting 1.5 mag brighter than the catalog depth captures the bulk of the SNR~2 population.

extract_lim.pdf

Therefore, I am now adopting the following prescription for determining extraction depths:

Estimate the peak of the photometric distribution (m_0) (roughly the catalog depth). Calculate the extra factor to appropriate scale the limit with the relative exposure time between direct imaging and the grism: m_offset = 2.5log10(sqrt(t_grism/t_direct)). Where t_direct is the total direct exposure time and t_grism is the maximum grism exposure time between the different filters. Model contamination down to m_0 + m_offset - 1.5. Refine the slopes down to m_0 + m_offset - 3.5 Extract down to m_0 + m_offset - 1.5

TheSkyentist commented 3 months ago

First attempt implemented in 7e15d99

TheSkyentist commented 3 months ago

We might require a little more delicate approach. Each grism might need its own magnitude offset and then we take the most liberal across all bands? I will investigate this further.

TheSkyentist commented 2 weeks ago

Automated magnitude limits are now included.