Unverified Commit 4f3934cd authored by Akke Viitanen's avatar Akke Viitanen
Browse files

add mock_catalog_SED for real this time

parent 4e4f617a
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ repos:
      - id: check-added-large-files
        name: Check for large files
        description: Prevent the user from committing very large files.
        args: ['--maxkb=500']
        args: ['--maxkb=3000']
    # Verify that pyproject.toml is well formed
  - repo: https://github.com/abravalheri/validate-pyproject
    rev: v0.12.1

mock_catalog_SED @ f4aace85

Original line number Diff line number Diff line
Subproject commit f4aace852e431891ad457a87c9cf41abe3b28f55
+1 −0
Original line number Diff line number Diff line
*.pyc
+674 −0

File added.

Preview size limit exceeded, changes collapsed.

+113 −0
Original line number Diff line number Diff line
%% Cell type:code id: tags:

``` python
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
from qsogen_4_catalog.qsosed import Quasar_sed
```

%% Cell type:code id: tags:

``` python
fname = "qsogen_4_catalog/narrow_lines/NL_templates_OIII/nlr_-1.5_0.008_0.3_3.0_-1.7_800.0.dat"
```

%% Cell type:code id: tags:

``` python
dizionario_blu = {"nlr_template_idx": 5, "Av_lines": 0.0}
dizionario_rosso = {"nlr_template_idx": 5, "Av_lines": 1.1}
```

%% Cell type:code id: tags:

``` python
sed_blu = Quasar_sed(30, AGN_type=2, ebv=4, **dizionario_blu, add_NL=True)
sed_rossa = Quasar_sed(30, AGN_type=2, ebv=4, add_NL=True, **dizionario_rosso)
```

%% Cell type:code id: tags:

``` python
fig, ax = plt.subplots()
ax.plot(sed_blu.wavlen, sed_blu.lum)
ax.plot(sed_rossa.wavlen, sed_rossa.lum)
ax.set_yscale("log")
ax.set_xscale("log")
ax.set_ylim(1e40, None)
ax.set_xlim(1000, 2e4)
```

%% Cell type:code id: tags:

``` python
sed_blu.Av_lines
```

%% Cell type:code id: tags:

``` python
sed_feltre = Quasar_sed(32, AGN_type=1, ebv=0, NL_normalization="feltre")
sed_lamastra = Quasar_sed(32, AGN_type=1, ebv=0, NL_normalization="lamastra")
```

%% Cell type:code id: tags:

``` python
fig, ax = plt.subplots()
ax.loglog(sed_feltre.wavlen, sed_feltre.lum, label="Feltre")
ax.loglog(sed_lamastra.wavlen, sed_lamastra.lum, label="Lamastra+09")
ax.set_xlabel("Wavelength")
ax.legend()
```

%% Cell type:code id: tags:

``` python
fig, ax = plt.subplots()
ax.scatter(template_2[:, 0], template_2[:, 1] / template_1[:, 1])
# ax.plot(template_1[:,0], template_1[:,1])

ax.set_xscale("log")
```

%% Cell type:code id: tags:

``` python
def get_integrated_xray_luminosity(log_L_1, wavlen_1=6.2, wavlen_2=1.24, gamma=1.8):
    ###it computes the integrated luminosity between wavlen_1 and wavlen_2
    ###log_L_1 is in erg/s hz^-1
    ### L_lambda ~ lambda^gamma-3
    log_L_1_lambda = log_L_1 - np.log10(wavlen_1 * wavlen_1 / 2.998e18)
    log_norm = log_L_1_lambda - (gamma - 3) * np.log10(wavlen_1)
    if wavlen_1 >= wavlen_2:
        temp = np.log10((wavlen_1 ** (gamma - 2) - wavlen_2 ** (gamma - 2)) / (gamma - 2))

    else:
        temp = np.log10((wavlen_2 ** (gamma - 2) - wavlen_1 ** (gamma - 2)) / (gamma - 2))
    return log_norm + temp


def get_L2kev(L2500):
    ##Lusso+16
    return 0.642 * L2500 + 6.965
```

%% Cell type:code id: tags:

``` python
lx = get_L2kev(35)
```

%% Cell type:code id: tags:

``` python
get_integrated_xray_luminosity(lx)
```

%% Cell type:code id: tags:

``` python
```
Loading