|
3 | 3 | import astropy.units as u |
4 | 4 |
|
5 | 5 | __all__ = [ |
| 6 | + "merge_gen_obsspec", |
6 | 7 | "merge_iue_obsspec", |
7 | 8 | "merge_stis_obsspec", |
8 | 9 | "merge_spex_obsspec", |
9 | | - "merge_nircam_ss_obsspec", |
10 | | - "merge_irs_obsspec", |
11 | | - "merge_miri_lrs_obsspec", |
12 | | - "merge_miri_ifu_obsspec", |
13 | 10 | ] |
14 | 11 |
|
15 | 12 | fluxunit = u.erg / (u.s * u.cm * u.cm * u.angstrom) |
16 | 13 |
|
17 | 14 |
|
| 15 | +# define the basic info for each type of spectra |
| 16 | +# info for each entry is (resolution, wavelength_range) |
| 17 | +obsspecinfo = { |
| 18 | + "wfc3_g102": (210, [0.8, 1.15] * u.micron), |
| 19 | + "wfc3_g141": (130, [1.075, 1.70] * u.micron), |
| 20 | + "niriss_soss": (700, [0.85, 2.75] * u.micron), |
| 21 | + "nircam_ss": (1600, [2.35, 5.55] * u.micron), |
| 22 | + "irs": (150, [5.0, 40.0] * u.micron), |
| 23 | + "miri_lrs": (160, [5.0, 13.0] * u.micron), |
| 24 | + "miri_ifu": (3000, [4.8, 29.0] * u.micron), |
| 25 | +} |
| 26 | + |
| 27 | + |
18 | 28 | def _wavegrid(resolution, wave_range): |
19 | 29 | """ |
20 | 30 | Define a wavelength grid at a specified resolution given |
@@ -307,142 +317,8 @@ def merge_iue_obsspec(obstables, output_resolution=1000): |
307 | 317 | wave_range = [1000.0, 3400.0] * u.angstrom |
308 | 318 |
|
309 | 319 | otable = merge_gen_obsspec( |
310 | | - obstables, wave_range, output_resolution=output_resolution, |
| 320 | + obstables, |
| 321 | + wave_range, |
| 322 | + output_resolution=output_resolution, |
311 | 323 | ) |
312 | 324 | return otable |
313 | | - |
314 | | - |
315 | | -def merge_irs_obsspec(obstables, output_resolution=150): |
316 | | - """ |
317 | | - Merge one or more Spitzer IRS 1D spectra into a single spectrum |
318 | | - on a uniform wavelength scale |
319 | | -
|
320 | | - Parameters |
321 | | - ---------- |
322 | | - obstables : list of astropy Table objects |
323 | | - list of tables containing the observed IRS spectra |
324 | | - usually the result of reading tables |
325 | | -
|
326 | | - output_resolution : float |
327 | | - output resolution of spectra |
328 | | - input spectrum assumed to be at the observed resolution |
329 | | -
|
330 | | - Returns |
331 | | - ------- |
332 | | - output_table : astropy Table object |
333 | | - merged spectrum |
334 | | - """ |
335 | | - wave_range = [5.0, 40.0] * u.micron |
336 | | - otable = merge_gen_obsspec( |
337 | | - obstables, wave_range, output_resolution=output_resolution, |
338 | | - ) |
339 | | - return otable |
340 | | - |
341 | | - |
342 | | -def merge_niriss_soss_obsspec(obstables, output_resolution=700): |
343 | | - """ |
344 | | - Merge one or more NIRCam slitless 1D spectra into a single spectrum |
345 | | - on a uniform wavelength scale |
346 | | -
|
347 | | - Parameters |
348 | | - ---------- |
349 | | - obstables : list of astropy Table objects |
350 | | - list of tables containing the observed IRS spectra |
351 | | - usually the result of reading tables |
352 | | -
|
353 | | - output_resolution : float |
354 | | - output resolution of spectra |
355 | | - input spectrum assumed to be at the observed resolution |
356 | | -
|
357 | | - Returns |
358 | | - ------- |
359 | | - output_table : astropy Table object |
360 | | - merged spectrum |
361 | | - """ |
362 | | - wave_range = [0.85, 2.75] * u.micron |
363 | | - otable = merge_gen_obsspec( |
364 | | - obstables, wave_range, output_resolution=output_resolution |
365 | | - ) |
366 | | - return otable |
367 | | - |
368 | | - |
369 | | -def merge_nircam_ss_obsspec(obstables, output_resolution=1600): |
370 | | - """ |
371 | | - Merge one or more NIRCam slitless 1D spectra into a single spectrum |
372 | | - on a uniform wavelength scale |
373 | | -
|
374 | | - Parameters |
375 | | - ---------- |
376 | | - obstables : list of astropy Table objects |
377 | | - list of tables containing the observed IRS spectra |
378 | | - usually the result of reading tables |
379 | | -
|
380 | | - output_resolution : float |
381 | | - output resolution of spectra |
382 | | - input spectrum assumed to be at the observed resolution |
383 | | -
|
384 | | - Returns |
385 | | - ------- |
386 | | - output_table : astropy Table object |
387 | | - merged spectrum |
388 | | - """ |
389 | | - wave_range = [2.35, 5.55] * u.micron |
390 | | - otable = merge_gen_obsspec( |
391 | | - obstables, wave_range, output_resolution=output_resolution |
392 | | - ) |
393 | | - return otable |
394 | | - |
395 | | - |
396 | | -def merge_miri_lrs_obsspec(obstables, output_resolution=160): |
397 | | - """ |
398 | | - Merge one or more MIRI LRS spectra into a single spectrum |
399 | | - on a uniform wavelength scale |
400 | | -
|
401 | | - Parameters |
402 | | - ---------- |
403 | | - obstables : list of astropy Table objects |
404 | | - list of tables containing the observed IRS spectra |
405 | | - usually the result of reading tables |
406 | | -
|
407 | | - output_resolution : float |
408 | | - output resolution of spectra |
409 | | - input spectrum assumed to be at the observed resolution |
410 | | -
|
411 | | - Returns |
412 | | - ------- |
413 | | - output_table : astropy Table object |
414 | | - merged spectrum |
415 | | - """ |
416 | | - wave_range = [5.0, 13.0] * u.micron |
417 | | - otable = merge_gen_obsspec( |
418 | | - obstables, wave_range, output_resolution=output_resolution, |
419 | | - ) |
420 | | - return otable |
421 | | - |
422 | | - |
423 | | -def merge_miri_ifu_obsspec(obstables, output_resolution=3000): |
424 | | - """ |
425 | | - Merge one or more MIRI IFU 1D spectra into a single spectrum |
426 | | - on a uniform wavelength scale |
427 | | -
|
428 | | - Parameters |
429 | | - ---------- |
430 | | - obstables : list of astropy Table objects |
431 | | - list of tables containing the observed IRS spectra |
432 | | - usually the result of reading tables |
433 | | -
|
434 | | - output_resolution : float |
435 | | - output resolution of spectra |
436 | | - input spectrum assumed to be at the observed resolution |
437 | | -
|
438 | | - Returns |
439 | | - ------- |
440 | | - output_table : astropy Table object |
441 | | - merged spectrum |
442 | | - """ |
443 | | - wave_range = [4.8, 29.0] * u.micron |
444 | | - otable = merge_gen_obsspec( |
445 | | - obstables, wave_range, output_resolution=output_resolution, |
446 | | - ) |
447 | | - |
448 | | - return otable |
0 commit comments