FAQs

[1]:
from picaso import justplotit as jpi
from picaso import justdoit as jdi
import warnings
warnings.filterwarnings('ignore')
import numpy as np
#picaso
from bokeh.io import output_notebook
output_notebook()
WARNING: Failed to load Vega spectrum from /data/reference_data/picaso/ref4/stellar_grids/calspec/alpha_lyr_stis_011.fits; Functionality involving Vega will be severely limited: FileNotFoundError(2, 'No such file or directory') [stsynphot.spectrum]
Loading BokehJS ...

How do I load in target properties from Exo.Mast?

[2]:
nexsci = jdi.all_planets()
[3]:
nexsci.head()
[3]:
systemid sy_name objectid pl_name pl_letter hostid hostname hd_name hip_name tic_id ... pl_tsm_solnid pl_tsmstr pl_tsmlim pl_esm pl_esmerr1 pl_esmerr2 pl_esm_reflink pl_esm_solnid pl_esmstr pl_esmlim
0 1.539830 HD 2039 3.11204 HD 2039 b b 2.539830 HD 2039 HD 2039 HIP 1931 TIC 281461362 ... NaN NaN NaN 0.1 NaN NaN <a refstr=CALCULATED_VALUE href=/docs/pscp_cal... NaN 0.0 0.0
1 1.103446 HAT-P-8 3.11027 HAT-P-8 b b 2.103446 HAT-P-8 NaN NaN TIC 188876052 ... NaN 109.0 0.0 120.0 NaN NaN <a refstr=CALCULATED_VALUE href=/docs/pscp_cal... NaN 120.0 0.0
2 1.643080 K2-43 3.88640 K2-43 b b 2.643080 K2-43 NaN NaN TIC 443616612 ... NaN 60.0 0.0 14.5 NaN NaN <a refstr=CALCULATED_VALUE href=/docs/pscp_cal... NaN 15.0 0.0
3 1.567687 Kepler-1753 3.15620 Kepler-1753 b b 2.567687 Kepler-1753 NaN NaN TIC 158664331 ... NaN 4.0 0.0 0.1 NaN NaN <a refstr=CALCULATED_VALUE href=/docs/pscp_cal... NaN 0.0 0.0
4 1.544946 Kepler-1176 3.24120 Kepler-1176 b b 2.544946 Kepler-1176 NaN NaN TIC 273582656 ... NaN 3.0 0.0 0.1 NaN NaN <a refstr=CALCULATED_VALUE href=/docs/pscp_cal... NaN 0.0 0.0

5 rows × 703 columns

[4]:
nexsci.loc[nexsci['hostname']=='HAT-P-26']
[4]:
systemid sy_name objectid pl_name pl_letter hostid hostname hd_name hip_name tic_id ... pl_tsm_solnid pl_tsmstr pl_tsmlim pl_esm pl_esmerr1 pl_esmerr2 pl_esm_reflink pl_esm_solnid pl_esmstr pl_esmlim
288 1.103496 HAT-P-26 3.1101 HAT-P-26 b b 2.103496 HAT-P-26 NaN NaN TIC 420779000 ... NaN 250.0 0.0 32.8 NaN NaN <a refstr=CALCULATED_VALUE href=/docs/pscp_cal... NaN 33.0 0.0

1 rows × 703 columns

[5]:
#first isolate the row
hatp26_row = nexsci.loc[nexsci['hostname']=='HAT-P-26']

#add it to load planet function with opacity
opa = jdi.opannection(wave_range=[1,5])
hatp26 = jdi.load_planet(hatp26_row,opa , st_metfe=0)#hatp26 is misst st_metfe so we must add it as a keyword

Load planet function adds in: - planet properties and stellar properties - parameterized PT profile

That means you still need to add in the chemistry and cloud parameters

[6]:
absolute_co=0.55#solar
logfeh = 1.5 #10^1.5 ~ 30x solar
hatp26.chemeq_visscher_2121(absolute_co,logfeh) #adds in template chemistry from sonora
df = hatp26.spectrum(opa, calculation='transmission+thermal')
[7]:
x,y = jdi.mean_regrid(df['wavenumber'], df['fpfs_thermal'],R=150)
plot = [jpi.spectrum(x,y,plot_width=400, y_axis_type='log',y_axis_label='FpFs')]
x,y = jdi.mean_regrid(df['wavenumber'], df['transit_depth'],R=150)
plot += [jpi.spectrum(x,y,plot_width=400,y_axis_label='(Rp/Rs)^2')]

jpi.show(jpi.row(plot))

How do I access the pressure-temperature profile parameterizations?

[8]:
#start by loading in some template properties
opa = jdi.opannection(wave_range=[1,5])
hatp26_row = nexsci.loc[nexsci['hostname']=='HAT-P-26']
hatp26 = jdi.load_planet(hatp26_row,opa, st_metfe=0)

How do the input parameters effect the parameterization?

[9]:
fig = [jpi.figure(width=300, height=300, y_axis_type='log', y_range=[100,1e-6],x_range=[400,1700],
                  y_axis_label='Pressure(bars)',x_axis_label='Temperature (K)',
                 title='Effect of logg1')]
colors = jpi.pals.magma(10)
for i, logg1 in enumerate(np.linspace(-2,2,10)):
    hatp26.guillot_pt(576.17, T_int=100, logg1=logg1, logKir=-1.5)
    fig[0].line(hatp26.inputs['atmosphere']['profile']['temperature'],
            hatp26.inputs['atmosphere']['profile']['pressure'],color=colors[i])

fig += [jpi.figure(width=300, height=300, y_axis_type='log', y_range=[100,1e-6],x_range=[400,1700],
                 x_axis_label='Temperature (K)',title='Effect of LogKir')]
for i,logKir in enumerate(np.linspace(-2,2,10)):
    hatp26.guillot_pt(576.17, T_int=100, logg1=-2, logKir=logKir)
    fig[1].line(hatp26.inputs['atmosphere']['profile']['temperature'],
            hatp26.inputs['atmosphere']['profile']['pressure'], color=colors[i])

fig += [jpi.figure(width=300, height=300, y_axis_type='log', y_range=[100,1e-6],x_range=[400,1700],
                 x_axis_label='Temperature (K)',title='Effect of Tint')]
for i,T_int in enumerate(np.linspace(50,300,10)):
    hatp26.guillot_pt(576.17, T_int=T_int, logg1=-2, logKir=-2)
    fig[2].line(hatp26.inputs['atmosphere']['profile']['temperature'],
            hatp26.inputs['atmosphere']['profile']['pressure'], color=colors[i])

jpi.show(jpi.row(fig))

How do I return the output from photon attenuation plot?

[10]:
#first isolate the row
hatp26_row = nexsci.loc[nexsci['hostname']=='HAT-P-26']

#add it to load planet function with opacity
opa = jdi.opannection(wave_range=[0.3,1])
hatp26 = jdi.load_planet(hatp26_row,opa ,st_metfe=0)
co_absolute = 0.55
logfeh=2
hatp26.chemeq_visscher_2121(co_absolute,logfeh)
df = hatp26.spectrum(opa, calculation='reflected',full_output=True)
[11]:
plot,wave,at_pressures_gas,at_pressures_cld,at_pressures_ray = jpi.photon_attenuation(df['full_output'],
                                                                                     return_output=True)
[12]:
#now you can make your own plot!
fig = jpi.figure(y_axis_type='log',y_range=[10,1e-3],height=250, width=500)
for i,iy,ilab in zip([0,1],[at_pressures_gas,at_pressures_ray ], ['Molecular','Rayleigh']):
    x,y = jpi.mean_regrid(1e4/wave,iy, R=150)
    fig.line(1e4/x,y,legend_label=ilab, line_width=4, color=jpi.Colorblind8[i])
jpi.show(fig)

Can I use the phase angle function to specify a non-zero phase for thermal emission?

The phase angle function computes the incoming and outgoing angles. However, non-zero phase functionality is specific to reflected light observations only. This might be confusing because of course it is possible to observe thermal emission of planet at non-zero phase. However, unlike reflected light, thermal emission radiates from the planet in all directions (regardless of phase angle).

Do not force the code to run at non-zero phase angles for thermal emission.

I’m confused about what opacity file to use

Question: I’m confused about the opacity files. Version 1.0 (opacity.db) is the low res version that covers the “useful” wavelengths (0.3 to 14 micron) while version 2.0 has two files that cover the 0.6-6 micron at higher resolution and 4.8-15 micron. What should I download? And once I download it, where do I put them? If it’s just the one file that seems straightforward in terms of where to put it but what happens when there are two files (or all 3) in the same folder?

Answer:

What do I download?

The low sampled files across a large wavelength range, which is on Zenodo as V1 is great for quick calculations that don’t necessarily need to be accurate. For example: proposals, example models, any testing, retrievals on fake data.

However, when comparing to real data, it’s important to use higher sampling. This tutorial shows users estimated sampling errors. Therefore, it is important to have higher sampling files as well. The higher sampling files are located here under V2.

So depending on your use case, the answer might be: download both!

Where do I put all the files?

PICASO uses the function `justdoit.opannection <https://natashabatalha.github.io/picaso/picaso.html#picaso.justdoit.opannection>`__ to grab the opacity file located in the reference directory `opacities <https://github.com/natashabatalha/picaso/tree/master/reference/opacities>`__. In the installation instructions you will notice there is a step to place the zenodo file here. Just for completeness, internally, we specify the name of this file here.

The general recommendation is to keep one “default” file in your reference/opacities folder so that you do not need to worry about always specifying a file when running the code. Then assign one place, easy to locate, where you include the rest of the files. In order to access these will need to point to this file path using the filename_db keyword in opannection.

Has your question not been answered? Feel free to contact us!

Submit an issue on Github: https://github.com/natashabatalha/picaso/issues

[ ]: