Skip to content

Commit

Permalink
Merge branch 'nodding2' of https://github.com/GreenbankObservatory/dysh
Browse files Browse the repository at this point in the history
… into nodding2
  • Loading branch information
teuben committed Oct 9, 2024
2 parents 00c9f31 + 502cc49 commit f534aea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/dysh/shell/shell.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
import logging
import sys
from pathlib import Path
from typing import List, Union

Expand Down Expand Up @@ -53,6 +54,7 @@ def parse_args():
parser.add_argument("-v", "--verbosity", help="Set logging verbosity", type=int, default=2, choices=[0, 1, 2, 3])
parser.add_argument("--log", help="Specify log path", type=Path)
parser.add_argument("-q", "--quiet", help="Silence DEBUG- and INFO-level logs to stderr", action="store_true")
parser.add_argument("--version", help="Print version and exit", action="store_true")
return parser.parse_known_args()


Expand Down Expand Up @@ -91,6 +93,9 @@ def open_sdfits_files(paths: List[Path], loader_class_name="GBTFITSLoad") -> Lis

def main():
args, remaining_args = parse_args()
if args.version:
print(__version__)
sys.exit(0)
init_logging(verbosity=args.verbosity, path=args.log, quiet=args.quiet)
sdfits_files = open_sdfits_files(args.paths, args.fits_loader)
init_shell(*remaining_args, colors=args.colors, profile=args.profile, sdfits_files=sdfits_files)
Expand Down
5 changes: 0 additions & 5 deletions src/dysh/spectra/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,6 @@ def delta_freq(self):

def tpmeta(self, i):
ser = self._sdfits.index(bintable=self._bintable_index).iloc[self._scanrows[i]]
# meta = self._sdfits.index(bintable=self._bintable_index).iloc[self._scanrows[i]].dropna().to_dict()
meta = ser.dropna().to_dict()
meta["TSYS"] = self._tsys[i]
meta["EXPOSURE"] = self.exposure[i]
Expand Down Expand Up @@ -896,7 +895,6 @@ def total_power(self, i):
if not self._calibrate:
raise Exception("You must calibrate first to get a total power spectrum")
ser = self._sdfits.index(bintable=self._bintable_index).iloc[self._scanrows[i]]
# meta = self._sdfits.index(bintable=self._bintable_index).iloc[self._scanrows[i]].dropna().to_dict()
meta = ser.dropna().to_dict()
meta["TSYS"] = self._tsys[i]
meta["EXPOSURE"] = self.exposure[i]
Expand All @@ -910,8 +908,6 @@ def total_power(self, i):
restfreq = rfq.to("Hz").value
meta["RESTFRQ"] = restfreq # WCS wants no E
s = Spectrum.make_spectrum(self._data[i] * u.ct, meta, observer_location=self._observer_location)
print(f"TP {self._history =} {self._comments = }")
print(f"Spectrum history after make_spectrum {type(s._history)} : {s._history}")
s.merge_commentary(self)
return s

Expand Down Expand Up @@ -948,7 +944,6 @@ def timeaverage(self, weights="tsys"):
return self._timeaveraged


# @todo 'scans' should become 'scan'
class PSScan(ScanBase):
"""GBT specific version of Position Switch Scan. A position switch scan object has
one IF, one feed, and one or more polarizations.
Expand Down

0 comments on commit f534aea

Please sign in to comment.