Archive Class

class pyneid.neid.Archive(**kwargs)[source]

‘Archive’ class provides NEID archive access functions for searching NEID data via TAP interface.

The user’s NEID credentials (given at login as a cookie file or a token string) are used to search the proprietary data.

Parameters

debugfile – a file path for the debug output

In the following examples, “neid” will represent an instance of the Archive class:

Examples

>>> import os
>>> import sys
>>> from pyneid.neid import Neid
>>> neid = Archive()
download(metapath, datalevel, format, outdir, **kwargs)[source]

The download method allows users to download FITS files shown in the retrieved metadata file. The column ‘filepath’ must be included in the metadata file columns in order to download files.

Parameters
  • metapath (string) – a full path metadata table obtained from running query methods

  • datalevel (string) – l0, l1, l2, eng, solarl0, solarl1, solarl2, solareng

  • datetime (string) – a datetime range string, see query_datetime

  • format (string) – metasata table’s format: ipac, votable, csv, or tsv.

  • outdir (string) – the directory for depositing the returned files

  • cookiepath (string) – (optional) cookie file path for downloading the proprietary NEID data.

  • token (string) – (optional) token string obtained from login.

  • start_row (integer) – (optional) starting row

  • end_row (integer) – (optional) ending row

  • calibfile (bool) – whether to download the associated calibration files (0/1); default is False.

login(**kwargs)[source]

login method validates a user has a valid NEID account; it takes two ‘keyword’ arguments: userid and password. If the inputs are not provided in the keyword, the auth method prompts for inputs.

login method returns both cookie header and a token string in the returned message file.

If cookiepath is provided, the cookie will be saved to the cookiepath.

The token string will be saved in the variable “token” in memory to be used for other Archive methods in the current session.

Parameters

userid – a valid user id in the NEID’s user table.

Examples

# without prompt >>> neid.login(userid=’xxxx’, password=’xxxxxx’, cookiepath=cookiepath) # or >>> neid.login(userid=’xxxx’, password=’xxxxxx’, token=token_string) # or # prompt for userid and password >>> neid.login(cookiepath=cookiepath) >>> neid.login()

query_adql(query, **kwargs)[source]
‘query_adql’ method receives a qualified ADQL query string from

user input.

Parameters
  • query (string) – a ADQL query

  • outpath (string) – (optional) a full output filepath of the returned metadata table

  • cookiepath (string) – (optional) a full cookie file path saved from login for querying the proprietary NEID data.

  • token (string) – (optional) a token string save in memory from login for querying the proprietary NEID data; the token is only valid for the current session.

  • format (string) –

    (optional) votable, ipac, csv, tsv (default: ipac) maxrec (integer): (optional) maximum records to be returned

    default: -1 or not specified will return all requested records

query_criteria(param, **kwargs)[source]

‘query_criteria’ method allows the search of NEID data by multiple the parameters specified in a dictionary (param).

Parameters
  • param (dict) – a dictionary containing the following keys; datalevel, datetime, position, target. See individual methods for input formating.

  • outpath (string) – (optional) a full output filepath of the returned metadata table

  • cookiepath (string) – (optional) a full cookie file path saved from login for querying the proprietary NEID data.

  • token (string) – (optional) a token string save in memory from login for querying the proprietary NEID data; the token is only valid for the current session.

  • format (string) –

    (optional) votable, ipac, csv, tsv (default: ipac) maxrec (integer): (optional) maximum records to be returned

    default: -1 or not specified will return all requested records

query_datetime(datalevel, datetime, **kwargs)[source]

‘query_datetime’ method search NEID data by ‘datetime’ range

Parameters
  • datalevel (string) – l0, l1, l2, eng, solarl0, solarl1, solarl2, solareng

  • datetime (string) – a datetime string in the format of datetime1/datetime2 where ‘/’ separates the two datetime values` of format ‘yyyy-mm-dd hh:mm:ss’

  • outpath (string) – (optional) a full output filepath of the returned metadata table

  • cookiepath (string) – (optional) a full cookie file path saved from login for querying the proprietary NEID data.

  • token (string) – (optional) a token string save in memory from login for querying the proprietary NEID data; the token is only valid for the current session.

  • format (string) – (optional) Output format: votable, ipac, csv, tsv (default: votable)

  • maxrec (integer) – (optional) maximum records to be returned default: -1 or not specified will return all requested records

Note

The following inputs are acceptable for the datetime parameter:

‘datetime1/’: will search data with datetime later than (>=) datetime1

‘/datetime2’: will search data with datetime earlier than (<=) datetime2

‘datetime1’: will search data with datetime equal to (=) datetime1 (this is not recommended)

Examples

>>> datalevel = 'l0',
>>> datetime = '2020-11-16 06:10:55/2020-11-18 00:00:00'
>>> datalevel = 'l1',
>>> datetime = '2020-11-16 06:10:55/'
>>> datalevel = 'l2',
>>> datetime = '/2020-112-18 00:00:00'
query_object(datalevel, object, **kwargs)[source]

‘query_object’ method search NEID data by ‘object name’. This method resolves the object name into coordiates to be used as the center of the circle position search with default radius of 0.5 deg.

Parameters
  • datalevel – l0, l1, l2, eng, solarl0, solarl1, solarl2, solareng

  • object (string) – an object name resolvable by SIMBAD, NED, and ExoPlanet’s name_resolve; outpath (string): (optional) a full output filepath of the returned metadata table

  • cookiepath (string) – (optional) a full cookie file path saved from login for querying the proprietary NEID data.

  • token (string) – (optional) a token string save in memory from login for querying the proprietary NEID data; the token is only valid for the current session.

  • format (string) –

    (optional) votable, ipac, csv, tsv (default: ipac) maxrec (integer): (optional) maximum records to be returned

    default: -1 or not specified will return all requested records

Examples

datalevel = ‘l1’, object = ‘WD 1145+017’

query_piname(datalevel, piname, **kwargs)[source]

‘query_piname’ method search NEID data by PI name

Parameters
  • datalevel (string) – l0, l1, l2, eng, solarl0, solarl1, solarl2, solareng

  • datetime (string) – a datetime string in the format of

  • piname (string) – PI name as formated in the project’s catalog

  • outpath (string) – (optional) a full output filepath of the returned metadata table

  • cookiepath (string) – (optional) a full cookie file path saved from login for querying the proprietary NEID data.

  • token (string) – (optional) a token string save in memory from login for querying the proprietary NEID data; the token is only valid for the current session.

  • format (string) –

    (optional) votable, ipac, csv, tsv (default: ipac) maxrec (integer): (optional) maximum records to be returned

    default: -1 or not specified will return all requested records

query_position(datalevel, position, **kwargs)[source]

‘query_position’ method search NEID data by ‘position’

Parameters
  • datalevel (string) – l0, l1, l2, eng, solarl0, solarl1, solarl2, solareng

  • datetime (string) – a datetime string as specified in qurey_datetime

  • position (string) – a position string in the format of outpath (string): (optional) a full output filepath of the returned metadata table

  • cookiepath (string) – (optional) a full cookie file path saved from login for querying the proprietary NEID data.

  • token (string) – (optional) a token string save in memory from login for querying the proprietary NEID data; the token is only valid for the current session.

  • format (string) –

    (optional) votable, ipac, csv, tsv (default: ipac) maxrec (integer): (optional) maximum records to be returned

    default: -1 or not specified will return all requested records

Note

Position can be a string in the following formats
  1. circle ra dec radius;

  2. polygon ra1 dec1 ra2 dec2 ra3 dec3 ra4 dec4;

  3. box ra dec width height;

All ra dec should be specified in J2000 coordinates.

Examples

>>> datalevel = 'l1',
>>> position = 'circle 230.0 45.0 0.5'
query_program(datalevel, program, **kwargs)[source]

‘query_program’ method search NEID data by ‘program’

Parameters
  • datalevel (string) – l0, l1, l2, eng, solarl0, solarl1, solarl2, solareng

  • datetime (string) – datetime string

  • program (string) – program ID in the project’s catalog

  • outpath (string) – (optional) a full output filepath of the returned metadata table

  • cookiepath (string) – (optional) a full cookie file path saved from login for querying the proprietary NEID data.

  • token (string) – (optional) a token string save in memory from login for querying the proprietary NEID data; the token is only valid for the current session.

  • format (string) –

    (optional) votable, ipac, csv, tsv (default: ipac) maxrec (integer): (optional) maximum records to be returned

    default: -1 or not specified will return all requested records

query_qobject(datalevel, qobject, **kwargs)[source]

‘query_qobject’ method search NEID data for ‘qobject’ column value. This method resolves the object name into coordiates to be used as the

center of the circle position search with default radius of 0.5 deg.

Parameters
  • datalevel – l0, l1, l2, eng, solarl0, solarl1, solarl2, solareng

  • qobject (string) – an object name as specified in the QOBJECT column. This is usually the Gaia DR2 ID outpath (string): (optional) a full output filepath of the returned metadata table

  • cookiepath (string) – (optional) a full cookie file path saved from login for querying the proprietary NEID data.

  • token (string) – (optional) a token string save in memory from login for querying the proprietary NEID data; the token is only valid for the current session.

  • format (string) –

    (optional) votable, ipac, csv, tsv (default: ipac) maxrec (integer): (optional) maximum records to be returned

    default: -1 or not specified will return all requested records