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

adding in ACS SBC, WFC3 and ACS narrow, and JWST filters and enhancing the filter plotting routine #799

Merged
merged 24 commits into from
May 23, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
adding in NIRISS
  • Loading branch information
karllark committed May 14, 2024
commit cb3cfcb961472be79db10564060d15f8d12a54c0
57 changes: 57 additions & 0 deletions beast/tools/make_libfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ def make_libfile():
jwst_nircam_lw = ["f332w2", "f277w", "f356w", "f444w",
"f250m", "f300m", "f335m", "f360m", "f410m", "f430m", "f460m", "f480m",
"f323n", "f405n", "f466n", "f470n"]

jwst_niriss = ["f090w", "f115w", "f150w", "f200w", "f277w", "f356w", "f444w",
"f140m", "f158m", "f380m", "f430m", "f480m"]

jwst_miri = ["f560w", "f770w", "f1000w", "f1130w", "f1280w", "f1500w", "f1800w", "f2100w", "f2550w",
"f1065c", "f1140c", "f1550c", "f2300c"]
Expand Down Expand Up @@ -497,7 +500,61 @@ def make_libfile():
pwaves.append(newfilt.lpivot.value)
comments.append("")

for filt in jwst_niriss:
# mock configuration
conf = {
"detector": {
"nexp": 1,
"ngroup": 10,
"nint": 1,
"readout_pattern": "nis",
"subarray": "full"
},
"instrument": {
"aperture": "imager",
"disperser": "null",
"filter": filt,
"instrument": "niriss",
"mode": "imaging"
},
}

# create a configured instrument
instrument_factory = InstrumentFactory(config=conf)

# set up your wavelengths
pwave = np.logspace(np.log10(0.5), np.log10(7.0), 501) * u.micron

# get the throughput of the instrument over the desired wavelength range
eff = instrument_factory.get_total_eff(pwave.value)

# get wavelengths in Angstroms
wave = pwave.to(u.AA)

# define the filter name
filter_name = "JWST_NIRISS_" + filt.upper()

# build array of wavelength and throughput
arr = np.array(
list(zip(wave.value.astype(np.float64), eff.astype(np.float64))),
dtype=[("WAVELENGTH", "float64"), ("THROUGHPUT", "float64")],
)

# append dataset to the hdf5 filters group
f.create_dataset(filter_name, data=arr)

# generate filter instance to compute relevant info
newfilt = phot.Filter(wave, eff, name=filt.upper())

# populate contents lists with relevant information
tablenames.append(filter_name)
observatories.append("JWST")
instruments.append("NIRISS")
names.append(newfilt.name)
norms.append(newfilt.norm.value)
cwaves.append(newfilt.cl.value)
pwaves.append(newfilt.lpivot.value)
comments.append("")

for filt in jwst_miri:
# mock configuration
Expand Down