AbsorptionCuda
¶
Bases: CudaContribution
Computes the contribution to the optical depth occuring from molecular absorption.
Source code in src\taurex_cupy\contributions\absorption.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
prepare_each(model, wngrid)
¶
Prepares each molecular opacity by weighting them by their mixing ratio in the atmosphere
Parameters¶
model: :class:~taurex.model.model.ForwardModel
Forward model
:obj:array
Wavenumber grid
Yields¶
component: :obj:tuple of type (str, :obj:array)
Name of molecule and weighted opacity
Source code in src\taurex_cupy\contributions\absorption.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
CIACuda
¶
Bases: CudaContribution
Source code in src\taurex_cupy\contributions\cia.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
contribute(model, start_layer, end_layer, density_offset, layer, density, tau, path_length=None, with_layer_offset=False)
¶
Computes an integral for a single layer for the optical depth.
Parameters¶
model: :class:~taurex.model.model.ForwardModel
A forward model
int
Lowest layer limit for integration
int
Upper layer limit of integration
int
offset in density layer
int
atmospheric layer being computed
:obj:array
density profile of atmosphere
:obj:array
optical depth to store result
:obj:array
integration length
Source code in src\taurex_cupy\contributions\cia.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
prepare_each(model, wngrid)
¶
Prepares each molecular opacity by weighting them by their mixing ratio in the atmosphere
Parameters¶
model: :class:~taurex.model.model.ForwardModel
Forward model
:obj:array
Wavenumber grid
Yields¶
component: :obj:tuple of type (str, :obj:array)
Name of molecule and weighted opacity
Source code in src\taurex_cupy\contributions\cia.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
CudaContribution
¶
Bases: Contribution
Source code in src\taurex_cupy\contributions\cudacontrib.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
contribute(model, start_layer, end_layer, density_offset, layer, density, tau, path_length=None, with_layer_offset=True)
¶
Computes an integral for a single layer for the optical depth.
Parameters¶
model: :class:~taurex.model.model.ForwardModel
A forward model
int
Lowest layer limit for integration
int
Upper layer limit of integration
int
offset in density layer
int
atmospheric layer being computed
:obj:array
density profile of atmosphere
:obj:array
optical depth to store result
:obj:array
integration length
Source code in src\taurex_cupy\contributions\cudacontrib.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
prepare(model, wngrid)
¶
Used to prepare the contribution for the calculation.
Called before the forward model performs the main optical depth
calculation. Default behaviour is to loop through :func:prepare_each
and sum all results into a single cross-section.
Parameters¶
model: :class:~taurex.model.model.ForwardModel
Forward model
:obj:array
Wavenumber grid
Source code in src\taurex_cupy\contributions\cudacontrib.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
DirectImageCudaModel
¶
Bases: EmissionCudaModel
A forward model for direct imaging of exo-planets.
Source code in src\taurex_cupy\model\directimage.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
compute_final_flux(f_total)
¶
Compute the final flux.
This is the emission flux that is observed at the telescope directly from an exo-planet.
Source code in src\taurex_cupy\model\directimage.py
13 14 15 16 17 18 19 20 | |
input_keywords()
classmethod
¶
Input keywords for this class.
Source code in src\taurex_cupy\model\directimage.py
22 23 24 25 26 27 28 | |
EmissionCudaModel
¶
Bases: SimpleForwardModel
A forward model for eclipse models using CUDA
Parameters¶
:class:~taurex.data.planet.Planet, optional
Planet model, default planet is Jupiter
:class:~taurex.data.stellar.star.Star, optional
Star model, default star is Sun-like
:class:~taurex.data.profiles.pressure.pressureprofile.PressureProfile, optional
Pressure model, alternative is to set nlayers, atm_min_pressure
and atm_max_pressure
:class:~taurex.data.profiles.temperature.tprofile.TemperatureProfile, optional
Temperature model, default is an :class:~taurex.data.profiles.temperature.isothermal.Isothermal
profile at 1500 K
:class:~taurex.data.profiles.chemistry.chemistry.Chemistry, optional
Chemistry model, default is
:class:~taurex.data.profiles.chemistry.taurexchemistry.TaurexChemistry with
H2O and CH4
int, optional
Number of layers. Used if pressure_profile is not defined.
float, optional
Pressure at TOA. Used if pressure_profile is not defined.
float, optional
Pressure at BOA. Used if pressure_profile is not defined.
int, optional
Number of Gaussian quadrature points. Default is 4
Source code in src\taurex_cupy\model\eclipse.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | |
FlatMieCuda
¶
Bases: CudaContribution
Computes a flat (gray) absorption contribution.
Absorption is computed as a flat value between two pressures across all wavenumbers.
Parameters¶
float
Opacity value
float
Bottom of absorbing region in Pa
float
Top of absorbing region in Pa
Source code in src\taurex_cupy\contributions\flatmie.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
input_keywords()
classmethod
¶
Return input keywords for the contribution.
Source code in src\taurex_cupy\contributions\flatmie.py
169 170 171 172 | |
prepare_each(model, wngrid)
¶
Computes and flat absorbing opacity for the pressure regions given.
Parameters¶
model: :class:~taurex.model.model.ForwardModel
Forward model
:obj:array
Wavenumber grid
Yields¶
component: :obj:tuple of type (str, :obj:array)
Flat and the weighted mie opacity.
Source code in src\taurex_cupy\contributions\flatmie.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
write(output)
¶
Write contribution to output.
Parameters¶
output: :class:~taurex.output.output.Output
Output object to write to
Returns¶
output: :class:~taurex.output.output.Output
Output object that was written to
Source code in src\taurex_cupy\contributions\flatmie.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
LeeMieCuda
¶
Bases: CudaContribution
Computes Mie scattering contribution to optica depth.
Formalism taken from: Lee et al. 2013, ApJ, 778, 97
Parameters¶
float
Particle radius in um
float
Extinction coefficient
float
Mixing ratio in atmosphere
float
Bottom of cloud deck in Pa
float
Top of cloud deck in Pa
Source code in src\taurex_cupy\contributions\leemie.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
input_keywords()
classmethod
¶
Input keywords.
Source code in src\taurex_cupy\contributions\leemie.py
210 211 212 213 | |
mieBottomPressure(value)
¶
Pressure at bottom of cloud deck in Pa.
Source code in src\taurex_cupy\contributions\leemie.py
114 115 116 117 | |
mieMixing(value)
¶
Mixing ratio in atmosphere.
Source code in src\taurex_cupy\contributions\leemie.py
130 131 132 133 | |
mieRadius(value)
¶
Particle radius in um.
Source code in src\taurex_cupy\contributions\leemie.py
68 69 70 71 | |
mieTopPressure(value)
¶
Pressure at top of cloud deck in Pa.
Source code in src\taurex_cupy\contributions\leemie.py
98 99 100 101 | |
prepare_each(model, wngrid)
¶
Compute and weights the mie opacity for the pressure regions given.
Parameters¶
model: :class:~taurex.model.model.ForwardModel
Forward model
:obj:array
Wavenumber grid
Yields¶
component: :obj:tuple of type (str, :obj:array)
Lee and the weighted mie opacity.
Source code in src\taurex_cupy\contributions\leemie.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
write(output)
¶
Write output group.
Source code in src\taurex_cupy\contributions\leemie.py
200 201 202 203 204 205 206 207 208 | |
RayleighCuda
¶
Bases: CudaContribution
Computes the contribution to the optical depth occuring from molecular Rayleigh.
Source code in src\taurex_cupy\contributions\rayleigh.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
prepare_each(model, wngrid)
¶
Prepares each molecular opacity by weighting them by their mixing ratio in the atmosphere
Parameters¶
model: :class:~taurex.model.model.ForwardModel
Forward model
:obj:array
Wavenumber grid
Yields¶
component: :obj:tuple of type (str, :obj:array)
Name of molecule and weighted opacity
Source code in src\taurex_cupy\contributions\rayleigh.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
SimpleCloudsCuda
¶
Bases: CudaContribution
Optically thick cloud deck up to a certain height
These have the form:
.. math:: \tau(\lambda,z) = \begin{cases} \infty & \quad \text{if } P(z) >= P_{0}\ 0 & \quad \text{if } P(z) < P_{0} \end{cases}
Where :math:P_{0} is the pressure at the top of the cloud-deck.
Source code in src\taurex_cupy\contributions\simpleclouds.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
__init__(clouds_pressure=1000.0)
¶
Initialize the cloud model.
Parameters¶
clouds_pressure : float, optional Pressure at top of cloud deck, by default 1e3
Source code in src\taurex_cupy\contributions\simpleclouds.py
33 34 35 36 37 38 39 40 41 42 43 44 | |
cloudsPressure(value)
¶
Cloud top pressure in Pascal.
Source code in src\taurex_cupy\contributions\simpleclouds.py
110 111 112 113 | |
contribute(model, start_layer, end_layer, density_offset, layer, density, tau, path_length=None)
¶
Contribute the cloud opacity to the optical depth.
Source code in src\taurex_cupy\contributions\simpleclouds.py
50 51 52 53 54 55 56 57 58 59 60 61 62 | |
prepare_each(model, wngrid)
¶
Compute cross-section that is infinitely absorbing.
Absorption occurs up to a certain height.
Parameters¶
model: :class:~taurex.model.model.ForwardModel
Forward model
:obj:array
Wavenumber grid
Yields¶
component: :obj:tuple of type (str, :obj:array)
Clouds and opacity array.
Source code in src\taurex_cupy\contributions\simpleclouds.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
write(output)
¶
Write the cloud pressure to the output.
Source code in src\taurex_cupy\contributions\simpleclouds.py
115 116 117 118 119 | |
TransmissionCudaModel
¶
Bases: OneDForwardModel
A forward model for transits using GPU acceleration.
Source code in src\taurex_cupy\model\transit.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | |
cuda_contributions
property
¶
Get contributions that use cuda.
non_cuda_contributions
property
¶
Get contributions that do not use cuda.
__init__(planet=None, star=None, pressure_profile=None, temperature_profile=None, chemistry=None, nlayers=100, atm_min_pressure=0.0001, atm_max_pressure=1000000.0, contributions=None)
¶
Initialise the model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planet
|
Optional[Planet]
|
Planet object |
None
|
star
|
Optional[Star]
|
Star object |
None
|
pressure_profile
|
Optional[PressureProfile]
|
Pressure profile for the atmosphere |
None
|
temperature_profile
|
Optional[TemperatureProfile]
|
Temperature profile for the atmosphere |
None
|
chemistry
|
Optional[Chemistry]
|
Chemical model |
None
|
nlayers
|
Optional[int]
|
Number of layers |
100
|
atm_min_pressure
|
Optional[float]
|
Minimum pressure (If pressure profile is not set) |
0.0001
|
atm_max_pressure
|
Optional[float]
|
Maximum pressure (If pressure profile is not set) |
1000000.0
|
contributions
|
Optional[list[Contribution | CudaContribution]]
|
List of contributions |
None
|
Source code in src\taurex_cupy\model\transit.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
build()
¶
Build the model.
Source code in src\taurex_cupy\model\transit.py
100 101 102 103 104 105 106 107 | |
compute_absorption(tau, dz)
¶
Compute the absorption.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tau
|
ndarray
|
Tau |
required |
dz
|
ndarray
|
\(\Delta z\) of the layer (altitude) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple[ndarray, ndarray]
|
\((R_p/R_s)^2\) and tau |
Source code in src\taurex_cupy\model\transit.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
compute_path_length(dz)
¶
Compute path length for each layer, new method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dz
|
NDArray[floating]
|
\(\Delta z\) of the layer (altitude) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
list[NDArray[float64]]
|
Path length for each layer |
Source code in src\taurex_cupy\model\transit.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
fallback_noncuda(total_layers, path_length, density_profile, dz)
¶
Fallback for non-cuda contributions.
This will compute them on the CPU before copying them to the GPU.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
total_layers
|
int
|
Total layers |
required |
path_length
|
NDArray[floating]
|
Path length |
required |
density_profile
|
NDArray[floating]
|
Density profile |
required |
dz
|
NDArray[floating]
|
Delta altitude of the layer |
required |
Returns:
| Type | Description |
|---|---|
NDArray[floating]
|
Optical depth |
Source code in src\taurex_cupy\model\transit.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
path_integral(wngrid, return_contrib)
¶
Compute the path integral for the model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wngrid
|
NDArray[floating]
|
Wavenumber grid |
required |
return_contrib
|
bool
|
Return contributions |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple[NDArray[floating], NDArray[floating]]
|
\((R_p/R_s)^2\) and optical depth |
Source code in src\taurex_cupy\model\transit.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
Spectral module¶
Spectral functions for CUDA
cuda_blackbody(lamb, temperature)
¶
Compute blackbody spectrum using cuda.
This will compute the blackbody spectrum using the formula:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lamb
|
NDArray[floating]
|
Wavelength grid |
required |
temperature
|
NDArray[floating]
|
Temperature grid |
required |
Returns:
| Type | Description |
|---|---|
NDArray[floating]
|
Blackbody spectrum in W/m\(^2\)/micron/sr |
Source code in src\taurex_cupy\spectral.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
Utility functions¶
utility functions for taurex-cupy
FakeCIA
¶
Bases: CIA
Fake opacity for testing purposes.
Source code in src\taurex_cupy\util.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
moleculeName
property
¶
Name of molecule.
temperatureGrid
property
¶
Temperature grid.
wavenumberGrid
property
¶
Wavenumber grid.
xsecGrid
property
¶
Opacity grid.
__init__(molecule_pair, num_t=27, wn_res=15000, wn_size=(300, 30000))
¶
Create the fake opacity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
molecule_pair
|
tuple[str, str]
|
The pair of molecules. |
required |
num_t
|
int
|
The number of temperature points. |
27
|
wn_res
|
int
|
The resolution of the wavenumber grid. |
15000
|
wn_size
|
tuple[float, float]
|
The size of the wavenumber grid. |
(300, 30000)
|
Source code in src\taurex_cupy\util.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
compute_cia(temperature)
¶
Computes the collisionally induced absorption cross-section.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temperature
|
float
|
The temperature to compute the opacity at. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
npt.NDArray[np.float64]: The opacity. |
Source code in src\taurex_cupy\util.py
127 128 129 130 131 132 133 134 135 136 137 138 | |
find_closest_temperature_index(temperature)
¶
Finds the nearest indices for a particular temperature
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temperature
|
float
|
The temperature to search for. |
required |
Returns:
| Type | Description |
|---|---|
tuple[int, int]
|
tuple[int, int]: The indices of the closest temperatures. |
Source code in src\taurex_cupy\util.py
87 88 89 90 91 92 93 94 95 96 97 98 99 | |
interp_linear_grid(temperature, t_idx_min, t_idx_max)
¶
Linear interpolate the CIA opacity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temperature
|
float
|
The temperature to interpolate. |
required |
t_idx_min
|
int
|
The minimum temperature index. |
required |
t_idx_max
|
int
|
The maximum temperature index. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
The interpolated opacity. |
Source code in src\taurex_cupy\util.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
cuda_find_closest_pair(arr, values)
¶
Find the closest pair of values in an array
Parameters¶
arr : cp.ndarray The array to search values : cp.ndarray The values to search for
Returns¶
cp.ndarray The indices of the closest pair
Source code in src\taurex_cupy\util.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
determine_grid_slice(dest_wngrid, src_wngrid)
¶
Determine the grid length of the destination grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dest_wngrid
|
NDArray[float64]
|
The destination wavenumber grid. |
required |
src_wngrid
|
NDArray[float64]
|
The source wavenumber grid. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
slice |
slice
|
The slice of the destination grid. |
Source code in src\taurex_cupy\util.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |