Closed benopp99 closed 2 years ago
Hi @benopp99,
For future reference, you can enclose a code block in two ``` pieces. I did that for your above example--but make sure to do it in the future.
See also here:
Hi John- Yes, I did that submission rather fast and didn't look up those quotes.
Is such an issue worth putting on the github, or should I just e-mail you directly?
Thanks, Ben
On Fri, Jan 14, 2022 at 11:50 AM John ZuHone @.***> wrote:
Hi @benopp99 https://github.com/benopp99,
For future reference, you can enclose a code block in two ``` pieces. I did that for your above example--but make sure to do it in the future.
See also here:
— Reply to this email directly, view it on GitHub https://github.com/lynx-x-ray-observatory/soxs/issues/7#issuecomment-1013372600, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMEF72LFW42KMD3W7RRWGELUWBV6XANCNFSM5L5KFOBQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID: @.***>
@benopp99 github is better.
Your problem is here:
cxb_src = soxs.make_point_sources_file(cxb_simput, "pt_src", t_exp,
fov, sky_center, nH=nH,
area=area, prng=int(haloid), overwrite=True)
The returned object here is a SimputCatalog
, not a SimputSource
, so you can't append it later like you are trying to do. If you want to append the point sources to the catalog in simput_file
, do this:
###########
import soxs
from soxs.background.foreground import hm_astro_bkgnd
import os
import sys
# change these as needed, this needs to be the SIMPUT file
# which links to the phlist file for your source
simput_prefix = "my_galaxy"
simput_file = sys.argv[1]
haloid = sys.argv[2]
exp_ksec = sys.argv[3]
# change these as needed
nH = 0.02
area = 3000.0
t_exp = (float(exp_ksec), "ks")
fov = (66.0, "arcmin") # a bit bigger than 1 degree
sky_center = [0.0, 0.0]
cxb_simput = "hold_cxb_simput.fits"
Galfrgd_simput = "hold_Galfrgd_simput.fits"
#Make the point sources
simput = soxs.make_point_sources_file(simput_file, "pt_src", t_exp,
fov, sky_center, nH=nH, append=True, src_filename=cxb_simput,
area=area, prng=int(haloid), overwrite=True)
print("Done make_point_sources_file")
# Make the galactic foreground
frgnd = hm_astro_bkgnd.to_spectrum(fov)
square1deg = soxs.FillFOVModel(sky_center[0], sky_center[1], fov)
Galfgrd_src = soxs.SimputPhotonList.from_models("frgnd", frgnd, square1deg,
t_exp, area)
print("Done make foreground file")
simput.append(Galfrgd_src,src_filename=Galfrgd_simput,overwrite=True)
print("Finished appending background")
###########
Okay, got it. Thanks.
-Ben
On Fri, Jan 14, 2022 at 12:28 PM John ZuHone @.***> wrote:
@benopp99 https://github.com/benopp99 github is better.
Your problem is here:
cxb_src = soxs.make_point_sources_file(cxb_simput, "pt_src", t_exp, fov, sky_center, nH=nH, area=area, prng=int(haloid), overwrite=True)
The returned object here is a SimputCatalog, not a SimputSource, so you can't append it later like you are trying to do. If you want to append the point sources to the catalog in simput_file, do this:
########### import soxs from soxs.background.foreground import hm_astro_bkgnd import os import sys
change these as needed, this needs to be the SIMPUT file
which links to the phlist file for your source
simput_prefix = "my_galaxy"
simput_file = sys.argv[1] haloid = sys.argv[2] exp_ksec = sys.argv[3]
change these as needed
nH = 0.02 area = 3000.0 t_exp = (float(exp_ksec), "ks") fov = (66.0, "arcmin") # a bit bigger than 1 degree sky_center = [0.0, 0.0]
cxb_simput = "hold_cxb_simput.fits" Galfrgd_simput = "hold_Galfrgd_simput.fits"
Make the point sources
simput = soxs.make_point_sources_file(simput_file, "pt_src", t_exp, fov, sky_center, nH=nH, append=True, src_filename=cxb_simput, area=area, prng=int(haloid), overwrite=True)
print("Done make_point_sources_file")
Make the galactic foreground
frgnd = hm_astro_bkgnd.to_spectrum(fov) square1deg = soxs.FillFOVModel(sky_center[0], sky_center[1], fov)
Galfgrd_src = soxs.SimputPhotonList.from_models("frgnd", frgnd, square1deg, t_exp, area)
print("Done make foreground file")
simput.append(Galfrgd_src,src_filename=Galfrgd_simput,overwrite=True)
print("Finished appending background") ###########
— Reply to this email directly, view it on GitHub https://github.com/lynx-x-ray-observatory/soxs/issues/7#issuecomment-1013397288, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMEF72MLNQNYONBZSQBYCSDUWB2MFANCNFSM5L5KFOBQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID: @.***>
Hi John- I'm trying to make a simput catalogue file that holds separate photon lists for CXB and Galforeground, like I used to do with the older SOXS (see example below).
I think the new SOXS works with SIMPUT catalogue objects, and I'm generating separate simput files for the 2 background, but I can't seem to do the appending to simput file that I wish to hold 3 phlists (2 in addition to the original one).
I get the following error:
I've tried several permutations of this and I get this confusing error. I attach the code. Below is what old simput files with bkgdadded look like. I guess I have to attach my script file directly in the text here:
Thanks as always, Ben