Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to generate DESI-Y3 Lya mocks #581

Merged
merged 5 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions py/desisim/scripts/gen_qso_catalog.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HiramHerrera - I'm not super familiar with this script, but the changes look good.

In a couple of years from now, when we want to make Y5 mocks, it will be confusing to have release="Y5" to refer to the forecasted final DESI instead of referring to the actual Y5 release, although I guess we could use either DR3 or whatever mountain is used to generate the Y5 release

Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ def main():
help="Input Master catalog")

parser.add_argument("--input-data", type=str, required=False,
default=str(
'/global/cfs/cdirs/desi/science/lya/y1-kp6/iron-tests/catalogs/'
'QSO_cat_iron_main_dark_healpix_zlya-altbal_zwarn_cut_20230918.fits'
),
help="Input Iron catalog")
default=None, help="Input observed data catalog")

parser.add_argument("-o", "--output", type=str, required=True,
help="Path of output catalog")
Expand All @@ -29,28 +25,36 @@ def main():
parser.add_argument("--exptime", type=float, default=None, required=False,
help='Exposure time to assign to all targets in the mock catalog')

parser.add_argument("--release", type=str, default='iron', choices=['iron','Y5'], required=False,
parser.add_argument("--release", type=str, default='jura', choices=['iron','jura','Y5'], required=False,
help='DESI survey release to reproduce')

parser.add_argument("--include-nonqso-targets", action='store_true', default=False,
help='Include nonqso targets on observed data catalog in the redshift and magnitude distributions.')

parser.add_argument("--tiles-file", type=str, default=None, required=False,
help='Input tile file to mimic. Overrides the default tile file for the release given by --release')

parser.add_argument("--overwrite", action='store_true', default=False,
help='Overwrite output file if it exists')

args = parser.parse_args()

survey = SurveyRelease(mastercatalog=args.input_master,seed=args.seed, qso_only=True, data_file=args.input_data,invert=args.invert)
survey = SurveyRelease(mastercatalog=args.input_master,seed=args.seed,
include_nonqso_targets=args.include_nonqso_targets,
data_file=args.input_data,invert=args.invert)

# Apply redshift distribution
# Note: For Y1 mocks (and probably Y5 too) the target selection redshift distribution
# Note: For Y1 and Y3 mocks (and probably Y5 too) the target selection redshift distribution
# from Chaussidon et al. 2022 works better to match QSO targets Iron catalog.
# The option distribution='from_data' should be a better option once I finish implementing it.
survey.apply_redshift_dist(distribution='target_selection', zmin=1.8)

# Apply NPASS geometry:
survey.apply_data_geometry(release=args.release) # Pass release = None for Y5 mocks.
# Apply NPASS geometry either from a release or a custom tiles file.
survey.apply_data_geometry(release=args.release, tilefile=args.tiles_file)

# Assign magnitudes
# Pass from_data = False for Y5 mocks. Unless you want to use the Y1 magnitude distributions.
survey.assign_rband_magnitude(from_data=True)
# Passes from_data = False for Y5 mocks. And from_data=True otherwise.
survey.assign_rband_magnitude(from_data=(args.release!='Y5'))

# Assign exposures
if args.release=='Y5' and args.exptime!=4000:
Expand Down
Loading
Loading