Skip to content

Commit

Permalink
Added observation main_project filter to command line arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
NickSwainston committed Jan 22, 2024
1 parent 0081086 commit b470b15
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions psrdb/tables/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def download(
telescope_name=None,
project_id=None,
project_short=None,
main_project="meertime",
utcs=None,
utce=None,
obs_type='fold',
Expand Down Expand Up @@ -182,6 +183,7 @@ def download(
{"field": "telescope_Name", "value": telescope_name},
{"field": "project_Id", "value": project_id},
{"field": "project_Short", "value": project_short},
{"field": "mainProject", "value": main_project},
{"field": "utcStartGte", "value": utcs},
{"field": "utcStartLte", "value": utce},
{"field": "obsType", "value": obs_type},
Expand All @@ -196,6 +198,8 @@ def download(

# Create the output name
output_name = "observations"
if main_project:
output_name += f"_{main_project}"
if pulsar_name:
output_name += f"_{'_'.join(pulsar_name)}"
if telescope_name:
Expand Down Expand Up @@ -663,6 +667,7 @@ def process(self, args):
telescope_name=args.telescope_name,
project_id=args.project_id,
project_short=args.project_code,
main_project=args.main_project,
utcs=args.utcs,
utce=args.utce,
obs_type=args.obs_type,
Expand All @@ -676,6 +681,7 @@ def process(self, args):
telescope_name=args.telescope_name,
project_id=args.project_id,
project_short=args.project_code,
main_project=args.main_project,
utcs=args.utcs,
utce=args.utce,
obs_type=args.obs_type,
Expand Down Expand Up @@ -740,6 +746,13 @@ def configure_parsers(cls, parser):
parser_list.add_argument(
"--project_code", metavar="PROJCODE", type=str, help="list observations matching the project code [str]"
)
parser_list.add_argument(
"--main_project",
metavar="MAINPROJECT",
type=str,
default="MeerTIME",
help="list observations matching the mainproject [str]",
)
parser_list.add_argument(
"--utcs",
metavar="UTCGTE",
Expand Down Expand Up @@ -803,6 +816,13 @@ def configure_parsers(cls, parser):
parser_download.add_argument(
"--project_code", metavar="PROJCODE", type=str, help="list observations matching the project code [str]"
)
parser_download.add_argument(
"--main_project",
metavar="MAINPROJECT",
type=str,
default="MeerTIME",
help="list observations matching the mainproject [str]"
)
parser_download.add_argument(
"--utcs",
metavar="UTCGTE",
Expand Down

0 comments on commit b470b15

Please sign in to comment.