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
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
force_orphan: true
force_orphan: true
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,13 @@ Please include a self-contained example that fully demonstrates your problem or
Changelog:
==========

1.2.2dev (unreleased)
=====================
- Fixed bug in get_ffi [#19]
- Fixed missing comments in fits header [#21]

1.2.1
======
- Fixed barycentric timing correction with lkspacecraft package
- Added from_name method
- Added ability to use "TICA" FFIs. This is experimental and might be buggy.
Expand Down
6 changes: 2 additions & 4 deletions src/tesscube/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,11 @@ def get_ffi(
if time is not None:
start = Time(self.tstart + 2457000, format="jd")
end = Time(self.tstop + 2457000, format="jd")
t = Time.now()
t = Time(2459343.87182313, format="jd")
if not ((t > start).any() & (t < end).any()):
if not ((time > start).any() & (time < end).any()):
raise ValueError(
f"Input time is not during Sector {self.sector} observations."
)
ffi_name = self.ffi_names[np.where((t > start))[0][-1]]
ffi_name = self.ffi_names[np.where((time > start))[0][-1]]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This might be separate from this PR, as I think this line is reproducing the previous behavior - but are we sure that this is what we want?

This looks to me like we're grabbing the first FFI name that's in the cube that has a time after the requested time. But I think the FFI times are midpoints, so in some cases we might return the wrong exposure. We might want to find the ffi-midpoint time that's closest to our time instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this reproduces existing behavior. That is something we could do if you prefer. But that would be a separate issue.


if index is not None:
ffi_name = self.ffi_names[index]
Expand Down
2 changes: 1 addition & 1 deletion src/tesscube/fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_header_dict(cube):
hdu.data[k][0]
if isinstance(hdu.data[k][0], str)
else np.nanmedian(hdu.data[k]),
c,
c if c != "" else hdr[k],
)
if (k in hdu.data.columns.names)
else fits.Card(k, hdr[k], c)
Expand Down