Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
10 changes: 5 additions & 5 deletions DREAMS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ effects:
kwargs :
filename: "TER_atmosphere.dat"
rescale_emission:
filter_name: "!OBS.sky.filter_name"
filename_format: "filters/{}.dat"
value: "!OBS.sky.bg_mag"
unit: mag
filter_name: "!OBS.sky.filter_name"
filename_format: "filters/J.dat"
Copy link
Author

Choose a reason for hiding this comment

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

Could you please put the file J.dat in the repository? In the directory filters. I do not have J.dat, so I cannot run the code with the J filter specified. That's why I used I.

value: "!OBS.sky.bg_mag"
unit: mag
- name: dreams_static_surfaces
description : telescope and camera optical surfaces
class: SurfaceList
Expand All @@ -44,4 +44,4 @@ effects:
filename_format: "filters/{}.dat"
minimum_throughput: !!float 1.01E-4
outer: 0.05088
outer_unit: "m"
outer_unit: "m"
6 changes: 3 additions & 3 deletions DREAMS_InGaAs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name : DREAMS_InGaAs_detector
description : base configuration for LFOA SBIG camera

properties:
mage_plane_id : 0
image_plane_id : 0
temperature : -60
dit : "!OBS.dit"
ndit : "!OBS.ndit"
Expand Down Expand Up @@ -37,7 +37,7 @@ effects:
description : SBIG dark current
class: DarkCurrent
kwargs:
value: 67
value: 67.

- name: shot_noise
description : apply Poisson shot noise to images
Expand All @@ -59,4 +59,4 @@ effects:
description : Binning the detector frames
class : BinnedImage
kwargs :
bin_size : "!DET.bin_size"
bin_size : "!DET.bin_size"
2 changes: 1 addition & 1 deletion LIST_DREAMS_mirrors_static.dat
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
# description : A list of optical surfaces in the telescope and camera. M[1-2] are the telescope mirrors.
#
name outer inner angle temperature action filename
M1 0.5 0.5 0 -40 reflection TER_mirror.dat
M1 0.5 0.0 0 -40 reflection TER_mirror.dat
M2 0.5 0.0 0 -40 reflection TER_mirror.dat
3 changes: 3 additions & 0 deletions TER_atmosphere.dat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# date_created : 2023-03-21
# location : Sidling spring
# wavelength_unit : nm
# emission_unit : ph s-1 m-2 um-1 arcsec-2
# action : transmission
#
# Details : http://www.gemini.edu/sciops/ObsProcess/obsConstraints/ocTransSpectra.html
#
Expand Down Expand Up @@ -293,3 +295,4 @@ wavelength transmission emission
1.0405 0.999979 0.1
1.041 0.999993 0.1
1.0415 0.999999 0.1
1100 0.8745 0.1
3 changes: 2 additions & 1 deletion default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ properties :
bg_mag : 14.9
filter_name : J

---

### default simulation parameters needed for DREAMS simulation
object : simulation
Expand All @@ -36,7 +37,7 @@ properties :
seed : 9001

spectral :
wave_min : 1.17
wave_min : 0.3
wave_mid : 1.25
wave_max : 1.33

Expand Down
27 changes: 27 additions & 0 deletions filters/I.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# source : Generic_Bessell.I SVO
# wavelength_unit : angstrom
# download_date : 2020-05-23
wavelength transmission
7000.0 0.0000000000
7100.0 0.0240000000
7200.0 0.2320000000
7300.0 0.5550000000
7400.0 0.7850000000
7500.0 0.9100000000
7600.0 0.9650000000
7700.0 0.9850000000
7800.0 0.9900000000
7900.0 0.9950000000
8000.0 1.0000000000
8100.0 1.0000000000
8200.0 0.9900000000
8300.0 0.9800000000
8400.0 0.9500000000
8500.0 0.9100000000
8600.0 0.8600000000
8700.0 0.7500000000
8800.0 0.5600000000
8900.0 0.3300000000
9000.0 0.1500000000
9100.0 0.0300000000
9200.0 0.0000000000
19 changes: 10 additions & 9 deletions gn.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ def __init__(self):

def test_load_lfao(self):
cmd = scopesim.UserCommands(use_instrument="DREAMS",
properties={"!OBS.filter_name": "J",
properties={"!OBS.filter_name": "I",
"!OBS.dit": 10,
"!DET.bin_size": 1,
"!OBS.sky.bg_mag": 14.9,
"!OBS.sky.filter_name": "J"})
"!OBS.sky.filter_name": "I"})
opt = scopesim.OpticalTrain(cmd)
opt["detector_linearity"].include = False
assert isinstance(opt, scopesim.OpticalTrain)
Expand All @@ -61,17 +61,18 @@ def test_load_lfao(self):

def plot_data(self):
if self.hdu_list is not None:
plt.imshow(self.hdu_list[1].data, norm=LogNorm())
plt.colorbar() # Add a colorbar to the plot
plt.title("Observed Star Field") # Add a title to the plot
plt.xlabel("X Pixels") # Add an x-axis label
plt.ylabel("Y Pixels") # Add a y-axis label
plt.show()
for my_hdu in self.hdu_list[1:]:
plt.imshow(my_hdu.data, norm=LogNorm())
plt.colorbar() # Add a colorbar to the plot
plt.title("Observed Star Field") # Add a title to the plot
plt.xlabel("X Pixels") # Add an x-axis label
plt.ylabel("Y Pixels") # Add a y-axis label
plt.show()

def run_test_and_plot():
test_optical_train = TestMakeOpticalTrain()
test_optical_train.test_load_lfao()
test_optical_train.plot_data()
# test_optical_train.plot_data()

# Run the test and plot as soon as the module is imported
run_test_and_plot()