[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
