Skip to content

Commit 9945a1e

Browse files
update docs
1 parent e6ac649 commit 9945a1e

File tree

2 files changed

+749
-3
lines changed

2 files changed

+749
-3
lines changed

docs/source/examples.rst

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,32 @@ Suppose you want to calculate the flux at specific time-frequency pairs (t_i, nu
9999
100100
results = model.specific_flux_series(times, bands) #times array could be random order
101101
102-
#or
103-
results = model.specific_flux_sorted_series(times, bands)# times array must be in ascending order (higher performance)
104-
105102
# the returned results is a dictionary contains arrays of the same shape as the input times and bands.
106103
104+
Calculate flux with exposure time averaging
105+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
106+
107+
For observations with finite exposure times, you can calculate time-averaged flux by sampling multiple points within each exposure:
108+
109+
.. code-block:: python
110+
111+
# Define observation times (center of exposure)
112+
times = np.logspace(2, 8, 50)
113+
114+
# Define observing frequencies (must be the same length as times)
115+
bands = np.logspace(9, 17, 50)
116+
117+
# Define exposure times for each observation (in seconds)
118+
expo_time = np.ones_like(times) * 100 # 100-second exposures
119+
120+
# Calculate time-averaged flux with 20 sample points per exposure
121+
results = model.specific_flux_series_with_expo(times, bands, expo_time, num_points=20)
122+
123+
# The returned results is a dictionary with arrays of the same shape as input times and bands
124+
# Each flux value represents the average over the corresponding exposure time
125+
126+
.. note::
127+
The function samples `num_points` evenly spaced within each exposure time and averages the computed flux. Higher `num_points` gives more accurate time averaging but increases computation time. The minimum value is 2.
107128

108129

109130
Ambient Media Models

0 commit comments

Comments
 (0)