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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,7 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Data files and pipeline output
*.bin
*.h5
6 changes: 3 additions & 3 deletions mkidpipeline/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,11 @@ def _metadata(self):
try:
d.update(dict(E_CXREFX=self.wcscal.conex_ref[0], E_CXREFY=self.wcscal.conex_ref[1],
E_PREFX=self.wcscal.pixel_ref[0], E_PREFY=self.wcscal.pixel_ref[1],
E_PLTSCL=self.wcscal.platescale if self.wcscal.platescale else self.photontable.query_header(
E_PLTSCL=self.wcscal.platescale if self.wcscal.platescale is not None else self.photontable.query_header(
'E_PLTSCL'),
E_DPDCX=self.wcscal.dp_dcx if self.wcscal.dp_dcx else self.photontable.query_header(
E_DPDCX=self.wcscal.dp_dcx if self.wcscal.dp_dcx is not None else self.photontable.query_header(
'E_DPDCX'),
E_DPDCY=self.wcscal.dp_dcy if self.wcscal.dp_dcy else self.photontable.query_header(
E_DPDCY=self.wcscal.dp_dcy if self.wcscal.dp_dcy is not None else self.photontable.query_header(
'E_DPDCY')))
except (AttributeError, KeyError) as error:
pass
Expand Down
12 changes: 10 additions & 2 deletions mkidpipeline/utils/wavecal_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,16 @@ def fit(self, guess):
weights=1 / np.sqrt(variance), scale_covar=False,
nan_policy='propagate')
# find the linear amplitude coefficients
amplitudes = self._reduced_model.eval(fit_result.params, x=x, y=y, variance=variance,
return_amplitudes=True)
amplitudes = self._reduced_model.func(
**self._reduced_model.make_funcargs(
fit_result.params, {
'x': x,
'y': y,
'variance': variance,
'return_amplitudes': True
}
)
)
# set the minimum amplitude to be 0 for the full fit
for amplitude in amplitudes.values():
amplitude.set(min=0)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
2020-10-06 19:32:36,481 Dither Path: (0.1, -0.4) --> (-0.3, 0.2), 6 steps 25.0 seconds
starts=[1602047817.008426, 1602047843.0487542, 1602047869.057722, 1602047895.0989745, 1602047921.027141, 1602047946.9576638, 1602047973.1737182, 1602047999.326166, 1602048025.351133, 1602048051.327375, 1602048077.3532414, 1602048103.32894, 1602048129.8022091, 1602048155.7942092, 1602048181.819404, 1602048207.8119497, 1602048233.7745168, 1602048259.7029226, 1602048285.9824896, 1602048312.0880666, 1602048338.447823, 1602048364.5527227, 1602048390.5130281, 1602048416.5059514, 1602048442.7548149, 1602048468.7794, 1602048494.8036757, 1602048520.7800586, 1602048546.7407908, 1602048572.7495456, 1602048598.9976673, 1602048625.0391998, 1602048651.0160012, 1602048676.9604523, 1602048702.9853165, 1602048729.026347]
ends=[1602047842.0098252, 1602047868.0501366, 1602047894.059312, 1602047920.099934, 1602047946.0284781, 1602047971.958183, 1602047998.174311, 1602048024.327056, 1602048050.3521876, 1602048076.3278682, 1602048102.3537316, 1602048128.3302114, 1602048154.8035254, 1602048180.7953146, 1602048206.8207395, 1602048232.8132064, 1602048258.777208, 1602048284.7035637, 1602048310.9838514, 1602048337.088304, 1602048363.4486434, 1602048389.5543034, 1602048415.5146558, 1602048441.5078225, 1602048467.7558453, 1602048493.7809784, 1602048519.8052933, 1602048545.782158, 1602048571.7416408, 1602048597.7514176, 1602048623.9986145, 1602048650.0410624, 1602048676.0174, 1602048701.9615557, 1602048727.9862337, 1602048754.0277302]
path=[(0.1, -0.4), (0.1, -0.28), (0.1, -0.16), (0.1, -0.04), (0.1, 0.08), (0.1, 0.2), (0.02, -0.4), (0.02, -0.28), (0.02, -0.16), (0.02, -0.04), (0.02, 0.08), (0.02, 0.2), (-0.06, -0.4), (-0.06, -0.28), (-0.06, -0.16), (-0.06, -0.04), (-0.06, 0.08), (-0.06, 0.2), (-0.14, -0.4), (-0.14, -0.28), (-0.14, -0.16), (-0.14, -0.04), (-0.14, 0.08), (-0.14, 0.2), (-0.22, -0.4), (-0.22, -0.28), (-0.22, -0.16), (-0.22, -0.04), (-0.22, 0.08), (-0.22, 0.2), (-0.3, -0.4), (-0.3, -0.28), (-0.3, -0.16), (-0.3, -0.04), (-0.3, 0.08), (-0.3, 0.2)]

64 changes: 64 additions & 0 deletions tests/data/hip109427-subset/20201006/logs/obslog_202010070311.json

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions tests/data/hip109427-subset/data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
- !MKIDWavecal
name: wavecal0 # A name
data: # List of MKIDTimerange named like 950 nm
- !MKIDTimerange
name: 850.0 nm # A name
start: 1602040829.0 # The start unix time, float ok, rounded down for H5 creation.
stop: 1602040834.0 # A stop unit time, float ok. If not specified duration must be
header: # A dictionary of fits header key overrides.
laser: on # !UNKNOWN MEC HEADER KEY!
other: fits_key # !UNKNOWN MEC HEADER KEY!
- !MKIDTimerange
name: 1.1 um # A name
start: 1602040979.0 # The start unix time, float ok, rounded down for H5 creation.
stop: 1602041084.0 # A stop unit time, float ok. If not specified duration must be
header: {} # A dictionary of fits header key overrides.
- !MKIDTimerange
name: 13750.0 Angstrom # A name
start: 1602041119.0 # The start unix time, float ok, rounded down for H5 creation.
stop: 1602041124.0 # A stop unit time, float ok. If not specified duration must be
header: {} # A dictionary of fits header key overrides.
- !MKIDFlatcal
name: flatcal0 # A name
data: wavecal0 # An MKIDObservation (for a whitelight flat) or an MKIDWavedata (or name) for a lasercal flat
wavecal_duration: 3.0 # Number of seconds of the wavecal to use, float ok. Required if using wavecal
wavecal_offset: 1.1 # An offset in seconds (>=1) from the start of the wavecal timerange. Required if not ob
lincal: false # Apply lincal to h5s
pixcal: true # Apply pixcal to data
cosmiccal: false # Apply cosmiccal to data
- !MKIDWCSCal
name: wcscal0 # A name
data: 10.4 mas # MKIDObservation, MKIDDither, or platescale (e.g. 10 mas)
pixel_ref: # The pixel position of the target centroid when on axis and the conex is at conex_ref
- 107
- 46
conex_ref: # The conex (x,y) position, [0, 1.0], when the target is at pixel_ref
- -0.16
- -0.4
source_locs: [] # The RA/DEC coordinates of the sources in the image
- !MKIDDither
name: dither0 # A name
data: 1602047815.0 # A list of !sob composing the dither, a unix time that falls within the range of a dither log in paths.data, or a fully qualified legacy (starttimes, endtimes, xpos,ypos) dither file.
wavecal: wavecal0 # A MKIDWavedata or name of the same
flatcal: flatcal0 # A MKIDFlatdata or name of the same
wcscal: wcscal0 # A MKIDWCSCal or name of the same
speccal: '' # A MKIDSpecdata or name of the same
use: [] # Specify which dither obs to use, list or range specification string e.g. #,#-#,#,#
header: # A dictionary of fits header key overrides, to be applied to the observations
OBJECT: HIP 109427 # Object
Loading