mastquery


Namemastquery JSON
Version 1.8.2 PyPI version JSON
download
home_pagehttps://github.com/gbrammer/mastquery
SummaryPython tools for querying the MAST Archive
upload_time2024-01-30 11:24:16
maintainer
docs_urlNone
authorG. Brammer
requires_python>=3.7
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # MASTQUERY
User-friendly tools for using the MAST Mashup API (https://mast.stsci.edu/api/v0/index.html)

## Installation:

    # From PIP
    pip install mastquery
    
    # *OR* from latest version of the respository
    git clone https://github.com/gbrammer/mastquery.git
    cd mastquery
    pip install . 
    
## Demo:

See also [demo.ipynb](https://github.com/gbrammer/mastquery/blob/master/examples/demo.ipynb).

```python
>>> from mastquery import query, fetch

### Query associations
>>> tab = query.run_query(box=None, proposal_id=[11359],
                         instruments=['WFC3/IR'], 
                         filters=['G141'],
                         base_query=query.DEFAULT_QUERY)

>>> print(tab['obs_id', 'filter', 'exptime', 'proposal_id'])
  obs_id   filter  exptime  proposal_id
========   ======  =======  ===========
ib6o23010   G141    4211.7        11359

### Data products
>>> prod = query.get_products_table(tab, extensions=['RAW'])

>>> print(prod['observation_id', 'filter', 'productFilename'])
observation_id filter  productFilename  
============== ====== ==================
     ib6o23rsq   G141 ib6o23rsq_raw.fits
     ib6o23ruq   G141 ib6o23ruq_raw.fits
     ib6o23ryq   G141 ib6o23ryq_raw.fits
     ib6o23s0q   G141 ib6o23s0q_raw.fits
     
### Fetch products
>>> s3_lines = fetch.make_curl_script(prod, script_name=None, s3_sync=True)
>>> print(s3_lines[0])
aws s3 sync --request-payer requester --exclude="*.*" --include="*raw.fits" s3://stpubdata/hst/public/ib6o/ib6o23rsq/ .//
``` 

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/gbrammer/mastquery",
    "name": "mastquery",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "G. Brammer",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/31/56/493e08aa86b5250535defbfda2af8863aab23ac456b278b740bb1ce56677/mastquery-1.8.2.tar.gz",
    "platform": null,
    "description": "# MASTQUERY\nUser-friendly tools for using the MAST Mashup API (https://mast.stsci.edu/api/v0/index.html)\n\n## Installation:\n\n    # From PIP\n    pip install mastquery\n    \n    # *OR* from latest version of the respository\n    git clone https://github.com/gbrammer/mastquery.git\n    cd mastquery\n    pip install . \n    \n## Demo:\n\nSee also [demo.ipynb](https://github.com/gbrammer/mastquery/blob/master/examples/demo.ipynb).\n\n```python\n>>> from mastquery import query, fetch\n\n### Query associations\n>>> tab = query.run_query(box=None, proposal_id=[11359],\n                         instruments=['WFC3/IR'], \n                         filters=['G141'],\n                         base_query=query.DEFAULT_QUERY)\n\n>>> print(tab['obs_id', 'filter', 'exptime', 'proposal_id'])\n  obs_id   filter  exptime  proposal_id\n========   ======  =======  ===========\nib6o23010   G141    4211.7        11359\n\n### Data products\n>>> prod = query.get_products_table(tab, extensions=['RAW'])\n\n>>> print(prod['observation_id', 'filter', 'productFilename'])\nobservation_id filter  productFilename  \n============== ====== ==================\n     ib6o23rsq   G141 ib6o23rsq_raw.fits\n     ib6o23ruq   G141 ib6o23ruq_raw.fits\n     ib6o23ryq   G141 ib6o23ryq_raw.fits\n     ib6o23s0q   G141 ib6o23s0q_raw.fits\n     \n### Fetch products\n>>> s3_lines = fetch.make_curl_script(prod, script_name=None, s3_sync=True)\n>>> print(s3_lines[0])\naws s3 sync --request-payer requester --exclude=\"*.*\" --include=\"*raw.fits\" s3://stpubdata/hst/public/ib6o/ib6o23rsq/ .//\n``` \n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python tools for querying the MAST Archive",
    "version": "1.8.2",
    "project_urls": {
        "Homepage": "https://github.com/gbrammer/mastquery",
        "Source": "https://github.com/gbrammer/mastquery",
        "Tracker": "https://github.com/gbrammer/mastquery/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3156493e08aa86b5250535defbfda2af8863aab23ac456b278b740bb1ce56677",
                "md5": "d63efcbd66777f1ec028a1aad680b6d1",
                "sha256": "e9b8c0fc598737a1e23ff9d8934bb43434dae1f5b9015d4967489890dbcbbbd9"
            },
            "downloads": -1,
            "filename": "mastquery-1.8.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d63efcbd66777f1ec028a1aad680b6d1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 304658,
            "upload_time": "2024-01-30T11:24:16",
            "upload_time_iso_8601": "2024-01-30T11:24:16.996491Z",
            "url": "https://files.pythonhosted.org/packages/31/56/493e08aa86b5250535defbfda2af8863aab23ac456b278b740bb1ce56677/mastquery-1.8.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-30 11:24:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gbrammer",
    "github_project": "mastquery",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mastquery"
}
        
Elapsed time: 0.36310s