Action #1122
Updated by Kosack Karl almost 11 years ago
We need functionality to be able to properly calculate the effective area, RMF, exposure, etc for a GSkyRegion in the On/Off analysis.
To do that, we need to calculate the weighted average of these IRFs across the set of ON and OFF regions over the time of the run/GTI.
We should add to GCTAOnOffObservation sonething on the lines of:
@calc_distributions()@: calculates distributions of instrumental parameters (zenith, azimuth,offset) over a set of GSkyRegions (e.g. the ON or OFF regions) and over time for an observation , stored as eg. a histogram internally.
For each instrumental parameter (zenith, azimuth, and offset for example), calc_distributions pre-calculates a histogram that is the distribution over time (over the run time) and space (over the region area) of that parameter. E.g. it represenents the estimated fraction of events that should be at a specific zenith angle, in the event list.
Then one can define a series of weighting funtions (or functors), that just return interpolations of these distributions:
@
weight_zenith( zenith ): returns weight of zenith angle from distribution
weight_offset( offset ): returns weight of offset
weight_azimuth( azimuth): ...
@
Then the calculation of an average effective area for example is just:
{{latex(\langle A_{\mathrm{eff}}(E) \rangle = \int_{\Psi}\int_{\Phi}\int_{\theta} w_{\Psi}(\Psi) w_{\Phi}(\Phi) w_{\theta}(\theta) A_{\mathrm{eff}}(E,\Phi,\Psi,\theta}) {{latex(\int_{\Psi}\int_{\Phi}\int_{\theta} w_{\Psi} w_{\Phi} w_{\theta} A_{\mathrm{eff}}(\Phi,\Psi,\theta}) d\Psi d\Phi d\theta)}}
where the parameters phi, psi, and theta are the zenith angle, azimuth angle, and offset (in principle others can be added)
To break up this work, we will initially ignore @calc_distributions@ and implement the weight functions to return only delta functions, and thus the integral reduces just the average values of zenith, az, offset in a region. Later the full functionality can be added. For that a mechanism for getting the horizontal coordinates of points in a region is needed (See related sub-issues)
To do that, we need to calculate the weighted average of these IRFs across the set of ON and OFF regions over the time of the run/GTI.
We should add to GCTAOnOffObservation sonething on the lines of:
@calc_distributions()@: calculates distributions of instrumental parameters (zenith, azimuth,offset) over a set of GSkyRegions (e.g. the ON or OFF regions) and over time for an observation , stored as eg. a histogram internally.
For each instrumental parameter (zenith, azimuth, and offset for example), calc_distributions pre-calculates a histogram that is the distribution over time (over the run time) and space (over the region area) of that parameter. E.g. it represenents the estimated fraction of events that should be at a specific zenith angle, in the event list.
Then one can define a series of weighting funtions (or functors), that just return interpolations of these distributions:
@
weight_zenith( zenith ): returns weight of zenith angle from distribution
weight_offset( offset ): returns weight of offset
weight_azimuth( azimuth): ...
@
Then the calculation of an average effective area for example is just:
{{latex(\langle A_{\mathrm{eff}}(E) \rangle = \int_{\Psi}\int_{\Phi}\int_{\theta} w_{\Psi}(\Psi) w_{\Phi}(\Phi) w_{\theta}(\theta) A_{\mathrm{eff}}(E,\Phi,\Psi,\theta}) {{latex(\int_{\Psi}\int_{\Phi}\int_{\theta} w_{\Psi} w_{\Phi} w_{\theta} A_{\mathrm{eff}}(\Phi,\Psi,\theta}) d\Psi d\Phi d\theta)}}
where the parameters phi, psi, and theta are the zenith angle, azimuth angle, and offset (in principle others can be added)
To break up this work, we will initially ignore @calc_distributions@ and implement the weight functions to return only delta functions, and thus the integral reduces just the average values of zenith, az, offset in a region. Later the full functionality can be added. For that a mechanism for getting the horizontal coordinates of points in a region is needed (See related sub-issues)