-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from GreenBankObservatory/pedro-devel
Adds GB 20m module and updates the docs
- Loading branch information
Showing
13 changed files
with
261 additions
and
104 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
"""Classes and functions for importing SDFITS files""" | ||
__all__ = [ "gbtfitsload", "sdfitsload" ] | ||
__all__ = [ "gbtfitsload", "sdfitsload", "gb20mfitsload" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""Load SDFITS files produced for GBO's 20m telescope """ | ||
|
||
from dysh.fits.sdfitsload import SDFITSLoad | ||
|
||
|
||
class GB20MFITSLoad(SDFITSLoad): | ||
|
||
def __init__(self, filename, source=None, hdu=None, **kwargs): | ||
SDFITSLoad.__init__(self, filename, source, hdu) | ||
self._fix_columns() | ||
|
||
|
||
def _str_idx(self, text, bad_char="\x00"): | ||
""" | ||
""" | ||
try: | ||
idx = text.index(bad_char) | ||
except ValueError: | ||
idx = None | ||
return idx | ||
|
||
|
||
def _fix_columns(self): | ||
""" | ||
""" | ||
|
||
bad_char="\x00" | ||
|
||
for i in range(len(self._bintable)): | ||
for j in range(self._binheader[i]["NAXIS2"]): | ||
text = self._bintable[i].data[j]["OBJECT"] | ||
idx = self._str_idx(text, bad_char="\x00") | ||
self._bintable[i].data[j]["OBJECT"] = text[:idx] | ||
text = self._bintable[i].data[j]["OBSERVER"] | ||
idx = self._str_idx(text, bad_char="\x00") | ||
self._bintable[i].data[j]["OBSERVER"] = text[:idx] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.