Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
username
Browse files Browse the repository at this point in the history
Signed-off-by: Nathaniel Starkman (@nstarman) <[email protected]>
  • Loading branch information
nstarman committed Oct 9, 2021
1 parent 22a6989 commit 6a06ce1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
5 changes: 3 additions & 2 deletions discO/data/err_field/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,9 @@ def make_parser(*, inheritable: bool = False) -> argparse.ArgumentParser:
help="number of computer cores to use, if parallelizing",
)

# local query for background
parser.add_argument("--use_local", default=True, type=bool, help="local query or not")
# gaia_tools
parser.add_argument("--use_local", default=True, type=bool, help="gaia_tools local query")
parser.add_argument("--username", default=None, type=str, help="gaia_tools query username")

return parser

Expand Down
17 changes: 12 additions & 5 deletions discO/data/err_field/sky_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@


def query_sky_distribution(
order: int = 6, random_index: T.Optional[int] = None, *, plot: bool = True, use_local: bool = True
order: int = 6,
random_index: T.Optional[int] = None,
*,
plot: bool = True,
use_local: bool = True,
user: T.Optional[str] = None,
) -> None:
"""Query Sky and save number count.
Expand Down Expand Up @@ -112,7 +117,7 @@ def query_sky_distribution(
result = table.QTable.read(DATA_DIR)
except Exception as e:
print(e)
result = do_query(adql_query, local=use_local, use_cache=False)
result = do_query(adql_query, local=use_local, use_cache=False, user=user)
result.write(DATA_DIR)

# group by healpix index
Expand Down Expand Up @@ -220,8 +225,9 @@ def make_parser(*, inheritable: bool = False) -> argparse.ArgumentParser:
# plot or not
parser.add_argument("--plot", default=True, type=bool, help="make plots or not")

# local query
parser.add_argument("--use_local", default=True, type=bool, help="local query or not")
# gaia_tools
parser.add_argument("--use_local", default=True, type=bool, help="gaia_tools local query")
parser.add_argument("--username", default=None, type=str, help="gaia_tools query username")

return parser

Expand Down Expand Up @@ -261,7 +267,8 @@ def main(
# /if

sky = query_sky_distribution(
order=ns.order, random_index=ns.random_index, plot=ns.plot, use_local=ns.use_local
order=ns.order, random_index=ns.random_index, plot=ns.plot, use_local=ns.use_local,
user=ns.username
)

return sky
Expand Down

0 comments on commit 6a06ce1

Please sign in to comment.