Skip to content
Merged
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Read documentation on ReadTheDocs: [latest](https://ghosts.readthedocs.io/en/lat
## Install
### conda, then pip
```
> git clone https://github.com/bregeon/ghosts.git
> git clone https://github.com/lsst-camera-dh/ghosts.git
or
> git clone git@github.com:bregeon/ghosts.git
> git clone git@github.com:lsst-camera-dh/ghosts.git
> cd ghosts
> conda env create -f environment.yml
> conda activate ghosts
Expand All @@ -20,9 +20,9 @@ or
### pip only
```
> conda create -n my_ghosts_env python=3.9
> git clone https://github.com/bregeon/ghosts.git
> git clone https://github.com/lsst-camera-dh/ghosts.git
or
> git clone git@github.com:bregeon/ghosts.git
> git clone git@github.com:lsst-camera-dh/ghosts.git
> cd ghosts
> pip install -r requirements.txt
> pip install -e .
Expand Down
2,268 changes: 2,268 additions & 0 deletions data/13579_hdr_kvals.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/LSST_CCOB_r.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ opticalSystem:
inner: 1.5
outer: 1.4
coordSys:
z: 3.195712 # CCOB Head is at L1S1 3.395712 - 0.200
z: 3.06805 # Used to be 3.195712 # but CCOB Head is at L1S1 3.395712 - 0.327662
-
type: CompoundOptic
name: LSSTCamera
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ channels:
- conda-forge
dependencies:
- python=3.11
- pip
- matplotlib
- numpy
- scipy
Expand Down
2 changes: 1 addition & 1 deletion ghosts/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def compute_distance_spot_to_spot(df_slice_1, df_slice_2, radius_scale_factor=10
dist_3d_err : `float`
the error on that distance from the std error on the position centers and radius for the 3D distance
"""
dist_2d = math.dist([df_slice_1['pos_x'], df_slice_1['pos_y']],
dist_2d = math.dist([df_slice _1['pos_x'], df_slice_1['pos_y']],
[df_slice_2['pos_x'], df_slice_2['pos_y']])
d1_2d_sq = df_slice_1['std_x'] * df_slice_1['std_x'] + df_slice_1['std_y'] * df_slice_1['std_y']
d2_2d_sq = df_slice_2['std_x'] * df_slice_2['std_x'] + df_slice_2['std_y'] * df_slice_2['std_y']
Expand Down
6 changes: 3 additions & 3 deletions ghosts/beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
This module provides tools to manipulate beam geometries,
and generate light rays as `batoid.RayVector`
"""

# Beam intensity, photon energy and number of photons
import math
import numpy as np
from scipy.constants import Planck, lambda2nu
from scipy.spatial.transform import Rotation as transform_rotation
Expand Down Expand Up @@ -355,8 +355,8 @@ def rotate_config_to_ub(beam_config, u, b):
rot = transform_rotation.from_euler('zxy', [u, 0., b], degrees=True)
euler_angles = rot.as_euler('ZXY', degrees=True)
new_beam['z_euler'] = euler_angles[0]
new_beam['x_euler'] = euler_angles[1]
new_beam['y_euler'] = euler_angles[2]
new_beam['x_euler'] = -euler_angles[2] - math.sin(math.radians(new_beam['z_euler']))*0.7
new_beam['y_euler'] = -euler_angles[1] + math.cos(math.radians(new_beam['z_euler']))*0.7
return new_beam


Expand Down
1 change: 1 addition & 0 deletions ghosts/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from matplotlib.collections import PatchCollection
from ghosts.constants import LSST_CAMERA_AMP_DX, LSST_CAMERA_AMP_DY, LSST_CAMERA_CCD_DX, LSST_CAMERA_RAFT_DX


def make_amp(x, y):
""" Build an amplifier rectangle

Expand Down
2 changes: 1 addition & 1 deletion ghosts/ghosts_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def compute_distance_for_fit(self, geom_params_array):
ordered_fit_df.append(merged_fit_df.loc[merged_fit_df['beam_id'] == df['beam_id'][0]])

# compute distance between the 2 list of ghosts catalogs
uber_dist = compute_uber_distance_2d(ordered_fit_df, fit_spots_df_list)
uber_dist = compute_uber_distance_2d(ordered_fit_df, self.spots_df_list)

# Log debug info - Minuit can actually take a callback function
if not np.random.randint(10) % 9:
Expand Down
5 changes: 5 additions & 0 deletions ghosts/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,15 @@ def plot_spots(data_frame_list, spot_size_scaling=10, range_x=(-0.35, 0.35), ran
fig, ax = plt.subplots(1, 1)
colors = ['black', 'r', 'b', 'g', 'c', 'm', 'y', 'k']
for df, color in zip(data_frame_list, colors):
# plot all spots
spots_x = df['pos_x']
spots_y = df['pos_y']
spots_size = ((df['radius'] * 1000) ** 2) * spot_size_scaling
ax.scatter(spots_x, spots_y, s=spots_size, facecolors='none', edgecolors=color)
# plot main beam
imp = df.loc[df["flux"].idxmax()]
ax.scatter(imp.pos_x, imp.pos_y, marker='+')

ax.set_xlim(range_x)
ax.set_ylim(range_y)
return fig, ax
Expand Down
Loading
Loading