SED
Sky
Bases: Spectral_Energy_Distribution
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 | |
__init__()
Initialize the Sky class.
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
503 504 505 | |
calculate_sed(moon_phase, object_wavelength)
Get the Spectral Energy Distribution of the sky.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
moon_phase |
[new, 'first quarter', 'third quarter', full]
|
The phase of the moon. |
required |
object_wavelength |
ndarray
|
The wavelength interval, in nm, of the astronomical object. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ndarray |
ndarray
|
The wavelength of the sky in nm. |
ndarray |
ndarray
|
The SED of the sky in photons/m/s. |
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 | |
Source
Bases: Spectral_Energy_Distribution
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
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 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 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | |
__init__()
Initialize the class.
Example
src = Source()
wv, sed = src.calculate_sed(calculation_method='blackbody',
magnitude=12,
wavelength_interval=(400, 1100, 100),
temperature=5700)
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
apply_Serkowski_curve(pol_BVRI, PA=0)
Apply the Serkowski curve to the SED of the star.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pol_BVRI |
dict
|
A python dictionary containing the polarization values of the filters BVRI in percentage. |
required |
PA |
float
|
Polarization angle in degrees. |
0
|
Returns:
| Type | Description |
|---|---|
ndarray
|
The SED of the star with the q and u Stokes parameters calculated according to the Serkowski curve. |
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | |
apply_circular_polarization(percent_pol=100, orientation='left')
Apply a circular polarization to the SED.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
percent_pol |
float
|
Percentage of polarization. |
100
|
orientation |
str
|
Orientation of the polarization. |
'left'
|
Returns:
| Name | Type | Description |
|---|---|---|
ndarray |
ndarray
|
Polarized SED. |
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
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 | |
apply_linear_polarization(percent_pol=100, pol_angle=0)
Apply a linear polarization to the SED.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
percent_pol |
float
|
Percentage of polarization. |
100
|
pol_angle |
float
|
Polarization angle in degrees. If the selected polarization mode were linear, the polarization angle must be provided. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
sed |
ndarray
|
Polarized SED. |
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
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 | |
apply_polarization(stokes=[])
Apply a generic polarization to the SED.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stokes |
list
|
A list of the q, u, and v Stokes parameters. |
[]
|
Returns:
| Name | Type | Description |
|---|---|---|
ndarray |
ndarray
|
polarized SED, adjusted for the provided Stokes parameters. |
Raises:
| Type | Description |
|---|---|
ValueError:
|
The variable stokes must have all the three Stokes parameters. |
ValueError:
|
The provided values must be in the interval of -1 up to 1. |
ValueError:
|
The quadratic sum of the Stokes parameters must be equal or smaller than 1. |
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
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 | |
calculate_sed_blackbody(magnitude, wavelength_interval=(), temperature=0)
Calculate the star SED based on the balckbody distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
magnitude |
int | float
|
The magnitude of the astronomical object in the V band. The magnitude is used to calculate the effective flux of the astronomical object. |
required |
wavelength_interval |
tuple
|
The wavelength interval, in nm, of the astronomical object. This parameter must be a tuple with three elements, where the first element is the initial wavelength, the second element is the final wavelength and the third element is the number of elements in the array. |
()
|
temperature |
int | float
|
The blackbody temperature of the astronomical object in Kelvin. |
0
|
Returns:
| Type | Description |
|---|---|
ndarray:
|
ndarray: The SED of the astronomical object in photons/m/s. |
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
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 | |
calculate_sed_spectral_library(magnitude, wavelength_interval=(), spectral_type='')
Calculate the star SED based on a library of spectral standard stars.
The spectral response and the wavelength of the object are obtained using a library of spectral types. These spectrums are taken from the Library of Stellar Spectrum of ESO, and they can be found at: https://www.eso.org/sci/facilities/paranal/decommissioned/isaac/tools/lib.html. The level of the spectral response is adjusted using the magnitude of the object in the V band.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
magnitude |
int | float
|
The magnitude of the astronomical object in the V band. The magnitude is used to calculate the effective flux of the astronomical object. |
required |
wavelength_interval |
tuple
|
The wavelength interval, in nm, of the astronomical object. This parameter must be a tuple with three elements, where the first element is the initial wavelength, the second element is the final wavelength and the third element is the number of elements in the array. |
()
|
spectral_type |
str
|
The spectral type of the star that will be used to calculate the SED.
This parameter is used only if the calculation_method is 'spectral_standard'.
The available spectral types can be found using
the |
''
|
Returns:
| Type | Description |
|---|---|
ndarray:
|
ndarray: The SED of the astronomical object in photons/m/s. |
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
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 | |
print_available_spectral_types()
Print the available spectral types.
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
386 387 388 389 390 391 392 | |
write_source_sed(wavelength, sed)
Write the wavelength and SED of the source.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wavelength |
ndarray
|
source wavelength interval in nm. |
required |
sed |
ndarray
|
Spectral Energy Distribution of the source. |
required |
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
Spectral_Energy_Distribution
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.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 | |
__init__()
Initialize the class.
Tips: useful links: https://www.astronomy.ohio-state.edu/martini.10/usefuldata.html https://cass.ucsd.edu/archive/physics/ph162/mags.html
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
25 26 27 28 29 30 31 32 33 | |
calculate_sed()
Calculate the Spectral Energy Distribution.
This method is an abstract method that must be implemented in the child classes.
Returns:
| Name | Type | Description |
|---|---|---|
ndarray |
ndarray
|
The Spectral Energy Distribution of the object in photons/s/m. |
Source code in AIS/Spectral_Energy_Distribution/spectral_energy_distribution.py
35 36 37 38 39 40 41 42 43 44 45 | |