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

Does the effstim method take into account filter bandwidth? #369

Open
dan-adi opened this issue Dec 17, 2023 · 1 comment
Open

Does the effstim method take into account filter bandwidth? #369

dan-adi opened this issue Dec 17, 2023 · 1 comment

Comments

@dan-adi
Copy link

dan-adi commented Dec 17, 2023

Description

I am computing the counts from an extended source and the general equation includes the filter bandwidth. I don't know if the effstim method in Observation Class already includes the filter bandwidth when computing flux. Need to know so I don't apply the same operation twice.

Here is a test example:

# get zero point for V filter and peakLambda for V filter
def zeroPoint_V():
    vegaSpectra = SourceSpectrum.from_vega()
    Vfilter = SpectralElement.from_filter('johnson_v')
    peakLambda = Vfilter.wpeak()
    obs = Observation(vegaSpectra, Vfilter)
    zero_point_flux_V = obs.effstim(flux_unit='flam')

    return zero_point_flux_V, peakLambda

# get flux from mag
def starflux(mag, zeroPointFlux):
    
    f = zeroPointFlux * 10 ** (-.4 * mag)
    
    return f.to(u.W / (u.m**2 * u.nm))

# get photon energy at peakLambda
def photonEnergy(peakLambda):
    h = const.h
    c = const.c
    E = (h * c) / peakLambda.to(u.meter)
    E_convert = E.to(u.watt * u.s)
    
    return E_convert

# counts for extended object
def counts(flux, photonE, filterBandwidth,aperture,pixelSurface, QE):
    
    targetPhotons = QE * flux/photonE * filterBandwidth * aperture * pixelSurface
    return targetPhotons

parameters

zp = zeroPoint_V()[0]
flux = starflux(22.9, zp)
pe = photonEnergy(zeroPoint_V()[1])
filterBandwidth = 80.7 * u.nm
QE = 0.8
aperture = 2 * u.m**2
pixelSurface =  0.3 # is image scale**2, where image scale = 0.15 arcsec/pixel
c = counts(flux, pe, filterBandwidth,aperture,pixelSurface, QE)
print(np.round(c,0))

Thank you

System Details (optional)

@pllim
Copy link
Contributor

pllim commented Dec 18, 2023

I think so? You can look at the actual implementation here:

def effstim(self, flux_unit=None, wavelengths=None, area=None,

Not sure what all your code is doing there. Theoretically, you can normalize your source first if you want, pass that and the bandpass into Observation, and it should give you count rate, so all that extra conversion seems unnecessary.

Hopefully these help:

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

No branches or pull requests

2 participants