Commit 74a006e0 authored by Akke Esa Tapio Viitanen's avatar Akke Esa Tapio Viitanen
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+14 −0
Original line number Diff line number Diff line
# Large files
data/catalog
data/baseline*

# Cached files
data/smf/bongiorno2016
data/xlf/bongiorno2016

# vim
*~
*.swp

# External libraries
opt/*

README.md

0 → 100644
+38 −0
Original line number Diff line number Diff line
# AGILE: AGN In the LSST Era

This repository contains the sources code for the LSST INAF in-kind
contribution for creating a photometric AGN, galaxy and star catalog

# Main authors and contact

The code has been developed in INAF-OAR with significant contributions from the
following people:

	+ Akke Viitanen (akke.viitanen@inaf.it)
	+ Angela Bongiorno 
	+ Ivano Saccheo 
	+ Andrea Grazian 

# Installation

The code builds on top of several external software. Namely:

	+ egg: https://cschreib.github.io/egg/
	+ LSST Science Pipelines: https://pipelines.lsst.io/
	+ DESC imSim: http://lsstdesc.org/imSim/
	+ quasarlf: https://ui.adsabs.harvard.edu/abs/2020MNRAS.495.3252S/abstract
	+ QSOGEN: https://ui.adsabs.harvard.edu/abs/2022ascl.soft05003T/abstract
	+ AGN_lightcurve_simulations: INAF-OAC, Petrecca, Paolillo+, in prep.
	+ GrowBHs: University of Southampton: Roberts, Shankar+ in prep.

For retrieving the extenal

# Running the code

Running the command

	$ sh run.sh

Will create a small EGG galaxy catalog, an AGN catalog on top of the EGG catalog, and a stellar catalog. Then, it creates 6 instance catalogs (one per each filter in ugrizy), which can be simulated using imSim. Finally, it will create validation plots based on the products.

See the file 'config.ini' on the available options for modifying the behavior of the code.

config.ini

0 → 100644
+216 −0
Original line number Diff line number Diff line
[common]

# The simulated survey area in square degrees. Note that the area is used
# to set the directory name for many of the outputs. Look for ${area} entries

#save_sed: 0
save_sed: 1

area: 0.01
#area: 0.10
#area: 0.04
#area: 0.10
#area: 0.50
#area: 1.00
#area: 2.00
#area: 12.00
#area: 15.00
#area: 18.00
#area: 24.00
#area: 100.00

zmin: 0.21
zmax: 5.49

dirname_prefix: data/catalog/${area}deg2_${zmin}_z_${zmax}_ra_${egg:ra0}_dec_${egg:dec0}
seds_file: ${common:dirname_prefix}/seds

#bands:   [lsst-u,lsst-g,lsst-r,lsst-i,lsst-z,lsst-y,euclid-nisp-Y,euclid-nisp-J,euclid-nisp-H]
#rfbands: [lsst-u,lsst-g,lsst-r,lsst-i,lsst-z,lsst-y,euclid-nisp-Y,euclid-nisp-J,euclid-nisp-H]
bands:   [lsst-u,johnson-B,lsst-g,lsst-r,lsst-i,lsst-z,lsst-y,euclid-nisp-Y,euclid-nisp-J,euclid-nisp-H,spitzer-irac1,spitzer-irac2,spitzer-irac3,spitzer-irac4,wise-w1,wise-w2,wise-w3,wise-w4,mock-1000-4000,mock-1450,mock-4400,mock-5007,mock-15um,vista-Y,vista-J,vista-H,vista-Ks]
rfbands: ${common:bands}

[egg]

# EGG filename
out: ${common:dirname_prefix}/egg.fits

# NOTE: these arguments are fed verbatim to the egg. See egg-gencat help for
# more information
area: ${common:area}
verbose: 1
mass_func: opt/egg/share/mass_func_cosmos2020_agn.fits

# NOTE: COSMOS r-band 10yr limiting magnitude is 28.55 (baseline v3.4, http://astro-lsst-01.astro.washington.edu:8080/summaryStats?runId=4)
# Simulating 1.5mag deeper should be sufficient
maglim: 30
selection_band: lsst-r

zmin: ${common:zmin}
zmax: ${common:zmax}
#zmin: 0.40
#zmax: 0.60

#mmin: 8.50
mmin: 9.00
#mmin: 9.50
#mmin: 10.50

dz: 0.05

# NOTE: 0.30 deg should cover most cases i.e. r~0-200 Mpc/h at z~0.20-5.50
clust_r0: 0.30
clust_fclust_him: 0.40
clust_fclust_lom: 0.20

bands: ${common:bands}
rfbands: ${common:bands}
ra0: +150.11916667
dec0: +2.20583333
save_sed: ${common:save_sed}
seed: 20230412
no_flux: 0

[combined]

# Filename of the combined output catalog
filename_catalog: ${common:dirname_prefix}/catalog.fits

# Filename of the AGN catalog
filename_agn: ${common:dirname_prefix}/agn.fits

# Filename of the stars catalog
filename_stars: ${common:dirname_prefix}/stars.fits

# Filename of the binary star catalog
filename_binaries: ${common:dirname_prefix}/binaries.fits

# Directory to save the SEDs in
seds_file: ${common:seds_file}

# Plambda to use
type_plambda: bongiorno+2016
#type_plambda: zou+2024

# Whether to use classification or no
no_classification: 1

# delta mass for grid in stellar mass
dm: 0.10

# delta redshift for grid in redshift
dz: 0.10

# delta LX for grid in luminosity
dl: 0.10

# Save AGN SEDs or no
save_sed: ${common:save_sed}

# Random seed
seed: 20240326

# Fetch stars or no
fetch_stars: 1
#fetch_stars: 0

# Parameters for Merloni+2014 optical type assignment
merloni2014_interpolate: 0
merloni2014_extrapolate: 0
merloni2014_f_obs_minimum: 0.00
merloni2014_f_obs_maximum: 1.00

[reference_catalog]

# Filename of the reference catalog
filename: ${common:dirname_prefix}/reference_catalog.csv

# Magnitude limit for the reference catalog
maglim: 24

# Selection band for the magnitude limit
selection_band: lsst-r

[imsim]

###############################################################################
# SQL query for the cadence database to define observationIds for running
###############################################################################

# NOTE: all COSMOS
#query: SELECT * FROM observations WHERE note="DD:COSMOS"

## NOTE: r-band observations
#query: SELECT * FROM observations WHERE (filter='r' AND note="DD:COSMOS" AND observationId=29551)
##query: SELECT * FROM observations WHERE (filter='r' AND note="DD:COSMOS")

## NOTE: first 20 COSMOS r-band observations
#query: SELECT * FROM observations WHERE ((observationId>=29551 AND observationID<29554) OR (observationId>=30175 AND observationId<30192))

## NOTE: 20point r-band cadence
#query: SELECT * FROM observations WHERE (observationId=29551 OR observationId=30175 OR observationId=44921 OR observationId=45407 OR observationId=59084 OR observationId=72699 OR observationId=88519 OR observationId=103589 OR observationId=118569 OR observationId=145140 OR observationId=157286 OR observationId=234484 OR observationId=235890 OR observationId=236499 OR observationId=241887 OR observationId=242456 OR observationId=243196 OR observationId=243272 OR observationId=243862 OR observationId=243950)

# NOTE: first observation in each band. The order of the first sequence is giruyz
query: SELECT * FROM observations WHERE (observationId=29521 OR observationId=29531 OR observationId=29551 OR observationId=30192 OR observationId=30200 OR observationId=59122)

## NOTE: first observation of gri bands
#query: SELECT * FROM observations WHERE (observationId=29521 OR observationId=29531 OR observationId=29551)

## NOTE: first six of each sequence
#query: SELECT * FROM observations WHERE (observationId=30192 OR observationId=45409 OR observationId=88539 OR observationId=103609 OR observationId=157306 OR observationId=242461 OR observationId=29521 OR observationId=44891 OR observationId=59054 OR observationId=72669 OR observationId=88489 OR observationId=103559 OR observationId=29551 OR observationId=44921 OR observationId=59084 OR observationId=72699 OR observationId=88519 OR observationId=103589 OR observationId=29531 OR observationId=44901 OR observationId=59064 OR observationId=72679 OR observationId=88499 OR observationId=103569 OR observationId=59122 OR observationId=72737 OR observationId=118607 OR observationId=145178 OR observationId=235928 OR observationId=236537 OR observationId=30200 OR observationId=45417 OR observationId=59104 OR observationId=72719 OR observationId=88547 OR observationId=103617)

# Magnitude limit for the instance catalog
maglim: 30
#maglim: 24

# Selection band for the magnitude limit
selection_band: lsst-r

# List of detectors to simulate. Number ordering follows the scheme here:
# 	https://lsstdesc.org/imSim/lsst-camera.html#specifying-which-sensors-to-simulate
#det_list: 51 52 53 83 86 89 90 91 92 93 94 95 96 97 98 99 102 105 135 136 137
det_list: 94
#det_list: 90 91 92 93 94 95 96 97 98

# Based directory name for the imsim output products
dirname: ${common:dirname_prefix}/imsim
#dirname: data/2.00deg2/imsim_test_exptime/30s
#dirname: data/2.00deg2/imsim_test_exptime/seq
#dirname: data/2.00deg2/imsim_test_exptime/30s_fixed
#dirname: ${common:dirname_prefix}/imsim_ugrizy_21det
#dirname: ${common:dirname_prefix}/imsim_20_rband_maglim_24

# Visits definition file
filename_visits: /staff2/viitanen/lsst_galaxy_agn_mock/data/baseline_v3.0_10yrs.db

# White-space separated list of exptimes for ugrizy, in sequence. 30s is the standard single visit
# exposure time. The second option simulates the whole single visit DDF
# sequence (ugrizy): (8, 10, 20, 20, 24, 18) exposures.
exptime: 30 30 30 30 30 30
#exptime: 240 300 600 600 720 540

# Whether to estimate AGN lightcurves or not
do_lightcurve: 1
#do_lightcurve: 0

# Whether to run galsim
#run_galsim: 1
run_galsim: 0

# Turn on AGN host galaxies?
write_agn_host_galaxy: 1
#write_agn_host_galaxy: 0

###############################################################################
# NOTE: the following will override default options from the simulation
###############################################################################

# Override ra pointing
ra: 150.11916667

# Override dec pointing
dec: 2.20583333

[figure]

dirname: ${common:dirname_prefix}/figure
+91 −0
Original line number Diff line number Diff line
## Measurements of the AGN duty cycle as a function of stellar mass and redshift for all, star-forming and quiescent galaxies
## Taken from Aird et al. 2017b, MNRAS(in press), arXiv:1705.01132 (see Figure 6)
## Column description:
## Class - All, SF (star-forming), or Qu (Quiescent) galaxies
## zbinlo, zbinhi  - lower and upper limit of redshift bin
## mbinlo, mbinhi - lower and	upper limit of stellar mass bin	in log (Mstel/Msun)
## fduty(%) - fraction of galaxies (as a %) in mass+redshift bin with an AGN accreting above a specific black hole accretion rate limit of 0.01.
##            See Equation 3 of Aird+17b.
## fduty_error_lo(68%), fduty_error_hi(68%) - lower and upper 1 sigma equivalent errors on the duty cycle (as a %)
##
# Class  zbinlo  zbinhi  mbinlo  mbinhi   fduty(%)  fduty_error_lo(68%)   fduty_error_hi(68%)
 All   0.10   0.50   8.50   9.00     0.420     0.119     0.159
 All   0.50   1.00   8.50   9.00     0.208     0.095     0.144
 All   0.10   0.50   9.00   9.50     0.714     0.152     0.172
 All   0.50   1.00   9.00   9.50     0.337     0.098     0.130
 All   1.00   1.50   9.00   9.50     0.229     0.134     0.239
 All   0.10   0.50   9.50  10.00     0.411     0.102     0.132
 All   0.50   1.00   9.50  10.00     0.877     0.156     0.177
 All   1.00   1.50   9.50  10.00     1.598     0.303     0.407
 All   1.50   2.00   9.50  10.00     0.548     0.237     0.332
 All   0.10   0.50  10.00  10.50     0.805     0.141     0.179
 All   0.50   1.00  10.00  10.50     2.701     0.186     0.206
 All   1.00   1.50  10.00  10.50     4.969     0.399     0.425
 All   1.50   2.00  10.00  10.50     6.354     0.571     0.715
 All   2.00   2.50  10.00  10.50     5.340     0.982     1.181
 All   2.50   3.00  10.00  10.50     6.072     1.344     1.460
 All   3.00   4.00  10.00  10.50     2.365     1.186     1.826
 All   0.10   0.50  10.50  11.00     1.425     0.236     0.258
 All   0.50   1.00  10.50  11.00     4.862     0.268     0.271
 All   1.00   1.50  10.50  11.00     8.485     0.411     0.482
 All   1.50   2.00  10.50  11.00    12.211     0.768     0.819
 All   2.00   2.50  10.50  11.00    18.025     1.589     1.527
 All   2.50   3.00  10.50  11.00    16.856     2.728     2.988
 All   3.00   4.00  10.50  11.00     8.802     2.565     3.120
 All   0.10   0.50  11.00  11.50     0.713     0.245     0.349
 All   0.50   1.00  11.00  11.50     3.550     0.435     0.477
 All   1.00   1.50  11.00  11.50     7.066     0.772     0.830
 All   1.50   2.00  11.00  11.50    11.628     1.231     1.331
 All   2.00   2.50  11.00  11.50    23.874     2.463     2.621
 All   2.50   3.00  11.00  11.50    18.313     3.926     3.908
 All   3.00   4.00  11.00  11.50    19.857     4.143     4.383
  SF   0.10   0.50   8.50   9.00     0.302     0.099     0.134
  SF   0.50   1.00   8.50   9.00     0.171     0.090     0.149
  SF   0.10   0.50   9.00   9.50     0.412     0.125     0.160
  SF   0.50   1.00   9.00   9.50     0.285     0.095     0.131
  SF   1.00   1.50   9.00   9.50     0.075     0.059     0.165
  SF   0.10   0.50   9.50  10.00     0.310     0.094     0.130
  SF   0.50   1.00   9.50  10.00     0.654     0.138     0.163
  SF   1.00   1.50   9.50  10.00     1.501     0.317     0.381
  SF   1.50   2.00   9.50  10.00     0.503     0.242     0.397
  SF   0.10   0.50  10.00  10.50     0.841     0.168     0.216
  SF   0.50   1.00  10.00  10.50     2.558     0.218     0.239
  SF   1.00   1.50  10.00  10.50     4.224     0.395     0.421
  SF   1.50   2.00  10.00  10.50     5.289     0.634     0.687
  SF   2.00   2.50  10.00  10.50     4.248     0.949     1.173
  SF   2.50   3.00  10.00  10.50     4.306     1.161     1.415
  SF   3.00   4.00  10.00  10.50     1.044     0.639     1.296
  SF   0.10   0.50  10.50  11.00     1.582     0.322     0.376
  SF   0.50   1.00  10.50  11.00     6.157     0.380     0.401
  SF   1.00   1.50  10.50  11.00    10.486     0.582     0.600
  SF   1.50   2.00  10.50  11.00    13.897     1.019     0.969
  SF   2.00   2.50  10.50  11.00    18.296     1.696     1.699
  SF   2.50   3.00  10.50  11.00    14.702     2.801     3.157
  SF   3.00   4.00  10.50  11.00     6.502     2.308     2.744
  SF   0.10   0.50  11.00  11.50     1.151     0.462     0.735
  SF   0.50   1.00  11.00  11.50     6.017     0.805     0.868
  SF   1.00   1.50  11.00  11.50    10.150     1.216     1.281
  SF   1.50   2.00  11.00  11.50    16.075     1.779     1.925
  SF   2.00   2.50  11.00  11.50    24.530     2.881     2.813
  SF   2.50   3.00  11.00  11.50    15.663     3.873     4.372
  SF   3.00   4.00  11.00  11.50    14.799     3.866     4.671
  Qu   0.10   0.50  10.00  10.50     0.156     0.086     0.168
  Qu   0.50   1.00  10.00  10.50     1.581     0.299     0.361
  Qu   1.00   1.50  10.00  10.50     4.500     0.939     1.076
  Qu   1.50   2.00  10.00  10.50     7.443     1.675     2.053
  Qu   2.00   2.50  10.00  10.50     9.482     4.672     6.436
  Qu   2.50   3.00  10.00  10.50     7.194     4.377     6.947
  Qu   0.10   0.50  10.50  11.00     0.519     0.185     0.251
  Qu   0.50   1.00  10.50  11.00     1.272     0.219     0.256
  Qu   1.00   1.50  10.50  11.00     3.836     0.536     0.590
  Qu   1.50   2.00  10.50  11.00     7.130     1.119     1.171
  Qu   2.00   2.50  10.50  11.00    10.398     2.389     2.862
  Qu   2.50   3.00  10.50  11.00    16.454     5.381     5.471
  Qu   3.00   4.00  10.50  11.00     2.042     1.722     5.050
  Qu   0.10   0.50  11.00  11.50     0.105     0.075     0.222
  Qu   0.50   1.00  11.00  11.50     0.180     0.094     0.175
  Qu   1.00   1.50  11.00  11.50     1.161     0.424     0.617
  Qu   1.50   2.00  11.00  11.50     3.488     1.027     1.275
  Qu   2.00   2.50  11.00  11.50    15.713     3.712     4.531
  Qu   2.50   3.00  11.00  11.50    22.954     7.284     7.539
  Qu   3.00   4.00  11.00  11.50     2.601     2.308     8.979
+0 −0

File added.

Preview size limit exceeded, changes collapsed.