astrosource


Nameastrosource JSON
Version 1.7.0 PyPI version JSON
download
home_page
SummaryAnalysis script for sources with variability in their brightness
upload_time2023-03-27 11:50:54
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords astronomy time-series analysis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # astrosource
Analysis script for sources with variability in their brightness. The package was formerly called `autovar` but this clashes with an existing Python package.

[![Build Status](https://travis-ci.org/zemogle/astrosource.svg?branch=master)](https://travis-ci.org/zemogle/astrosource)

## Installation

It is strongly recommended you use python 3 and a virtual environment

Using the [Anaconda](https://www.anaconda.com/download/) distribution of Python:

```bash
conda create -n astrosource python=3
source activate astrosource
```

The package is available on PyPi and can be installed with `pip`.

```bash
pip install astrosource
```

### Install development version

If you need to install the development branch, download from [GitHub](https://github.com/zemogle/astrosource) and from the root of the repo, run:

```bash
cd astrosource
pip install .
```

or directly with the setup script

```bash
cd astrosource
python setup.py install
```

## Usage

There are a few input options when running the scripts. You can either run the whole analysis at once or the individual stages.

`--ra` *[required parameter]* Right Ascension of the target (in decimal)

`--dec` *[required parameter]* Declination of the target (in decimal)

`--target-file` *[required parameter]*

`--indir` [parameter] Path of directory containing LCO data files. If none is given, astrosource assumes the current directory

`--format` [parameter] input file format. If not `fz`, `fits`, or `fit` assumes the input files are photometry files with correct headers. If image files given, code will extract photometry from FITS extension. Defaults to `fz`.

`--stars` [boolean flag] Step 1: Identify and match stars from each data file

`--comparison` [boolean flag] Step 2: Identify non-varying stars to use for comparisons

`--calc` [boolean flag] Step 3: Calculate the brightness change of the target

`--phot` [boolean flag] Step 4: Photometry calculations for either differential or calibrated

`--plot` [boolean flag] Step 5: Produce lightcurve plots

`--full` [boolean flag] Run the whole code. This will run the following steps in this order `stars` > `comparison` > `calc` > `phot` > `plot`



### Extra options
`--verbose` [boolean flag] Show all system messages for AstroSource

`--period` [boolean flag] Search for periodicity in the data, currently with PDM and String methods. This will autoselect a reasonable search range if not provided a range.

`--periodlower` [float] Shortest period to trial in days. Default is 0.05

`--periodupper` [float] Longest period to trial in days. Default is one-third the observational baseline of your dataset.

`--periodtests` [integer] Number of different trial periods to run, Default 10000

`--skipvarsearch` [boolean flag] If this is set, this skips the variability calculations for each identified star. Pragmatically this skips creating the starVariability outputs. In a crowded field this can take an excessive amount of time.

`--detrend` [boolean flag] Detrend exoplanet data

`--eebls` [boolean flag] EEBLS - box fitting to search for periodic transits

`--calib` [boolean flag] Perform calibrated

`--lowcounts` [int] Count rate above which to accept a comparison star as a candidate. Defaults to 1000. (Note: This may seem like a low number but realistically stars at this low rate will be highly variable and rejected anyway)

`--hicounts` [int] Count rate above which to reject a comparison star as a candidate. Defaults to 1000000. (Note: This will vary from camera to camera, but it should be representative of a typical value that would have a peak pixel value significantly below the full range of the ccd, preferably lower rather than higher. )

`--thresholdcounts` [int] the number of counts at which to stop adding identified comparison stars to the ensemble. Default 1000000.

`--closerejectd` [float] astrosource will reject potential comparison calibration stars if there are nearby stars to it. Closerejectd is the limiting distance in arcseconds. For crowded fields, this value may need to be lowered. Default 5.0. While the primary function here is to identify stars that are not in crowded situations, it also has the side-effect of removing false detections in sky surveys due to image artifacts or diffraction spikes which tend to cluster together.

`--nopanstarrs` [boolean flag] Do not use the PanSTARRS catalogue for calibration. Some regions of the sky in PanSTARRS have poorer quality photometry than SDSS.

`--nosdss` [boolean flag] Do not use the SDSS catalogue for calibration. Some regions of the sky in SDSS have poorer quality photometry than PanSTARRS.

`--bjd` [boolean flag] Convert the MJD time into BJD time for LCO images.

`--clean` [boolean flag] Remove all files except the original data files, and photometry files

`--imgreject` [float] Image fraction rejection allowance based on image size starting value. Defaults to `0.0`. Astrosource automatically adjusts this value, so it is only in very rare cases this might need to be set.

`--starreject` [float] Image fraction rejection allowance based on number of rejected stars starting value. Defaults to `0.3`. Astrosource automatically adjusts this value, so it is only in very rare cases this might need to be set.


### Example Usage

```bash
astrosource --ra 154.9083708 --dec -9.8062778 --indir /path/to/your/data --full
```

All the files generated will be stored in the directory you specify in `--indir`

### Output Files

A variety of output files are generated. Some are obvious, some are not so obvious.

`usedImages.txt` : the list of images astrosource chose to use out of the original image set

`screenedComps.csv` : These are the stars brighter than --lowcounts and dimmer than --hicounts identified in every single used image.

`stdComps.csv`: These are the variability of the original set of screenedComps.csv stars after rejecting outlier stars with high variability.

`compsUsed.csv`: These are the stars selected to form the differential magnitude lightcurve. They are the lowest variability stars in the dataset up to --threshcounts.

`calibStands.csv`: There are stars from stdComps.csv (as opposed to compsUsed.csv) that have identified calibrated magnitudes in the catalogue. The magnitudes in this catalogue are from the reference catalogue (e.g. APASS, Skymapper, SDSS or PanSTARRS)

`calibCompsUsed.csv`: These are the calibrated magnitudes of the compsUsed.csv comparison stars calculated by comparison to calibStands.csv.

The various calibration files may seem like a bit of a puzzle at first. The reason there is a few steps is that the brightest, least variable, most suitable comparison stars (compsUsed.csv) may (and usually are if you are using a smaller telescope) be actually saturated in the reference catalogue which can tend to become problematic at 10th to 12th magnitude. Hence the identified comparison stars in compsUsed.csv to create the shape of the lightcurve are actually sometimes also calibrated to the dimmer, but still low variability, stars available in stdComps.csv. If your comparison stars are 10th magnitude or dimmer, the identified comparison stars are likely also the calibration stars used.

`calibrationErrors.txt`: The errors output from the calibration to the reference catalogue.

`starVariability.*`: A csv listing the mean differential magnitudes and standard deviation in differential magnitudes for all stars identified in the data set. This can be used to identify variable stars, particularly using the provided png and eps plots.

`LightcurveStats.txt`: A simple list of Maximum, Minimum and Middle Magnitude and Amplitude for each requested target.

`PeriodEstimates.txt`: A simple list of the results of the period-finding function for each requested target using PDM and the String Method.

`outputcats`: This folder contains the catalogues for each target (V1, V2… etc.). There are differential (diff) and calibrated (calib) versions of the final results formatted for various software packages.

`outputplots`: This folder contains the output lightcurves (phaseplotted also if --period was requested)

`periods`: This folder contains Likelihood plots and differential and calibrated lightcurves for each target when the --period option was selected.

`checkplots`: This folder contains some plots by airmass, which are only really useful for exoplanet transits.


### Tests

If you are developing this package, you will want to run the tests. You will need `pytest` installed and then, from the `astrosource` directory within this repo, run:

```bash
pytest
```

To suppress the warning messages use:

```bash
pytest --disable-pytest-warnings
```

You may also want to install this in developer mode

```bash
python setup.py develop
```

## Authors
Written by Michael Fitzgerald and [Edward Gomez](@zemogle)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "astrosource",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "astronomy,time-series,analysis",
    "author": "",
    "author_email": "Michael Fitzgerald <info@realpython.com>, Edward Gomez <egomez@lco.global>",
    "download_url": "https://files.pythonhosted.org/packages/2c/e4/a0224f1e879a5c9567dfe0ea6cfeb8d36bad5204cbfb546c6dfeb4b3aaac/astrosource-1.7.0.tar.gz",
    "platform": null,
    "description": "# astrosource\nAnalysis script for sources with variability in their brightness. The package was formerly called `autovar` but this clashes with an existing Python package.\n\n[![Build Status](https://travis-ci.org/zemogle/astrosource.svg?branch=master)](https://travis-ci.org/zemogle/astrosource)\n\n## Installation\n\nIt is strongly recommended you use python 3 and a virtual environment\n\nUsing the [Anaconda](https://www.anaconda.com/download/) distribution of Python:\n\n```bash\nconda create -n astrosource python=3\nsource activate astrosource\n```\n\nThe package is available on PyPi and can be installed with `pip`.\n\n```bash\npip install astrosource\n```\n\n### Install development version\n\nIf you need to install the development branch, download from [GitHub](https://github.com/zemogle/astrosource) and from the root of the repo, run:\n\n```bash\ncd astrosource\npip install .\n```\n\nor directly with the setup script\n\n```bash\ncd astrosource\npython setup.py install\n```\n\n## Usage\n\nThere are a few input options when running the scripts. You can either run the whole analysis at once or the individual stages.\n\n`--ra` *[required parameter]* Right Ascension of the target (in decimal)\n\n`--dec` *[required parameter]* Declination of the target (in decimal)\n\n`--target-file` *[required parameter]*\n\n`--indir` [parameter] Path of directory containing LCO data files. If none is given, astrosource assumes the current directory\n\n`--format` [parameter] input file format. If not `fz`, `fits`, or `fit` assumes the input files are photometry files with correct headers. If image files given, code will extract photometry from FITS extension. Defaults to `fz`.\n\n`--stars` [boolean flag] Step 1: Identify and match stars from each data file\n\n`--comparison` [boolean flag] Step 2: Identify non-varying stars to use for comparisons\n\n`--calc` [boolean flag] Step 3: Calculate the brightness change of the target\n\n`--phot` [boolean flag] Step 4: Photometry calculations for either differential or calibrated\n\n`--plot` [boolean flag] Step 5: Produce lightcurve plots\n\n`--full` [boolean flag] Run the whole code. This will run the following steps in this order `stars` > `comparison` > `calc` > `phot` > `plot`\n\n\n\n### Extra options\n`--verbose` [boolean flag] Show all system messages for AstroSource\n\n`--period` [boolean flag] Search for periodicity in the data, currently with PDM and String methods. This will autoselect a reasonable search range if not provided a range.\n\n`--periodlower` [float] Shortest period to trial in days. Default is 0.05\n\n`--periodupper` [float] Longest period to trial in days. Default is one-third the observational baseline of your dataset.\n\n`--periodtests` [integer] Number of different trial periods to run, Default 10000\n\n`--skipvarsearch` [boolean flag] If this is set, this skips the variability calculations for each identified star. Pragmatically this skips creating the starVariability outputs. In a crowded field this can take an excessive amount of time.\n\n`--detrend` [boolean flag] Detrend exoplanet data\n\n`--eebls` [boolean flag] EEBLS - box fitting to search for periodic transits\n\n`--calib` [boolean flag] Perform calibrated\n\n`--lowcounts` [int] Count rate above which to accept a comparison star as a candidate. Defaults to 1000. (Note: This may seem like a low number but realistically stars at this low rate will be highly variable and rejected anyway)\n\n`--hicounts` [int] Count rate above which to reject a comparison star as a candidate. Defaults to 1000000. (Note: This will vary from camera to camera, but it should be representative of a typical value that would have a peak pixel value significantly below the full range of the ccd, preferably lower rather than higher. )\n\n`--thresholdcounts` [int] the number of counts at which to stop adding identified comparison stars to the ensemble. Default 1000000.\n\n`--closerejectd` [float] astrosource will reject potential comparison calibration stars if there are nearby stars to it. Closerejectd is the limiting distance in arcseconds. For crowded fields, this value may need to be lowered. Default 5.0. While the primary function here is to identify stars that are not in crowded situations, it also has the side-effect of removing false detections in sky surveys due to image artifacts or diffraction spikes which tend to cluster together.\n\n`--nopanstarrs` [boolean flag] Do not use the PanSTARRS catalogue for calibration. Some regions of the sky in PanSTARRS have poorer quality photometry than SDSS.\n\n`--nosdss` [boolean flag] Do not use the SDSS catalogue for calibration. Some regions of the sky in SDSS have poorer quality photometry than PanSTARRS.\n\n`--bjd` [boolean flag] Convert the MJD time into BJD time for LCO images.\n\n`--clean` [boolean flag] Remove all files except the original data files, and photometry files\n\n`--imgreject` [float] Image fraction rejection allowance based on image size starting value. Defaults to `0.0`. Astrosource automatically adjusts this value, so it is only in very rare cases this might need to be set.\n\n`--starreject` [float] Image fraction rejection allowance based on number of rejected stars starting value. Defaults to `0.3`. Astrosource automatically adjusts this value, so it is only in very rare cases this might need to be set.\n\n\n### Example Usage\n\n```bash\nastrosource --ra 154.9083708 --dec -9.8062778 --indir /path/to/your/data --full\n```\n\nAll the files generated will be stored in the directory you specify in `--indir`\n\n### Output Files\n\nA variety of output files are generated. Some are obvious, some are not so obvious.\n\n`usedImages.txt` : the list of images astrosource chose to use out of the original image set\n\n`screenedComps.csv` : These are the stars brighter than --lowcounts and dimmer than --hicounts identified in every single used image.\n\n`stdComps.csv`: These are the variability of the original set of screenedComps.csv stars after rejecting outlier stars with high variability.\n\n`compsUsed.csv`: These are the stars selected to form the differential magnitude lightcurve. They are the lowest variability stars in the dataset up to --threshcounts.\n\n`calibStands.csv`: There are stars from stdComps.csv (as opposed to compsUsed.csv) that have identified calibrated magnitudes in the catalogue. The magnitudes in this catalogue are from the reference catalogue (e.g. APASS, Skymapper, SDSS or PanSTARRS)\n\n`calibCompsUsed.csv`: These are the calibrated magnitudes of the compsUsed.csv comparison stars calculated by comparison to calibStands.csv.\n\nThe various calibration files may seem like a bit of a puzzle at first. The reason there is a few steps is that the brightest, least variable, most suitable comparison stars (compsUsed.csv) may (and usually are if you are using a smaller telescope) be actually saturated in the reference catalogue which can tend to become problematic at 10th to 12th magnitude. Hence the identified comparison stars in compsUsed.csv to create the shape of the lightcurve are actually sometimes also calibrated to the dimmer, but still low variability, stars available in stdComps.csv. If your comparison stars are 10th magnitude or dimmer, the identified comparison stars are likely also the calibration stars used.\n\n`calibrationErrors.txt`: The errors output from the calibration to the reference catalogue.\n\n`starVariability.*`: A csv listing the mean differential magnitudes and standard deviation in differential magnitudes for all stars identified in the data set. This can be used to identify variable stars, particularly using the provided png and eps plots.\n\n`LightcurveStats.txt`: A simple list of Maximum, Minimum and Middle Magnitude and Amplitude for each requested target.\n\n`PeriodEstimates.txt`: A simple list of the results of the period-finding function for each requested target using PDM and the String Method.\n\n`outputcats`: This folder contains the catalogues for each target (V1, V2\u2026 etc.). There are differential (diff) and calibrated (calib) versions of the final results formatted for various software packages.\n\n`outputplots`: This folder contains the output lightcurves (phaseplotted also if --period was requested)\n\n`periods`: This folder contains Likelihood plots and differential and calibrated lightcurves for each target when the --period option was selected.\n\n`checkplots`: This folder contains some plots by airmass, which are only really useful for exoplanet transits.\n\n\n### Tests\n\nIf you are developing this package, you will want to run the tests. You will need `pytest` installed and then, from the `astrosource` directory within this repo, run:\n\n```bash\npytest\n```\n\nTo suppress the warning messages use:\n\n```bash\npytest --disable-pytest-warnings\n```\n\nYou may also want to install this in developer mode\n\n```bash\npython setup.py develop\n```\n\n## Authors\nWritten by Michael Fitzgerald and [Edward Gomez](@zemogle)\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Analysis script for sources with variability in their brightness",
    "version": "1.7.0",
    "split_keywords": [
        "astronomy",
        "time-series",
        "analysis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "113bb52ce36937a3cb45ebf27421d8c960121bba32be39a7545b45ee4f80d718",
                "md5": "4da0177d001fe8dd0089e5e4ad1acf06",
                "sha256": "cc22ffff4210c3b0e49f20074f7488855444129122b765e5b389402be77a06ec"
            },
            "downloads": -1,
            "filename": "astrosource-1.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4da0177d001fe8dd0089e5e4ad1acf06",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 69815,
            "upload_time": "2023-03-27T11:50:51",
            "upload_time_iso_8601": "2023-03-27T11:50:51.991843Z",
            "url": "https://files.pythonhosted.org/packages/11/3b/b52ce36937a3cb45ebf27421d8c960121bba32be39a7545b45ee4f80d718/astrosource-1.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2ce4a0224f1e879a5c9567dfe0ea6cfeb8d36bad5204cbfb546c6dfeb4b3aaac",
                "md5": "a10d834660dc45811bdea9b6e9ccbbbb",
                "sha256": "d2c5df255dd93030c7dca9010cdfeee72a35ab5a6bbceb4aad28285df3b9bb6b"
            },
            "downloads": -1,
            "filename": "astrosource-1.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a10d834660dc45811bdea9b6e9ccbbbb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 67495,
            "upload_time": "2023-03-27T11:50:54",
            "upload_time_iso_8601": "2023-03-27T11:50:54.254496Z",
            "url": "https://files.pythonhosted.org/packages/2c/e4/a0224f1e879a5c9567dfe0ea6cfeb8d36bad5204cbfb546c6dfeb4b3aaac/astrosource-1.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-27 11:50:54",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "astrosource"
}
        
Elapsed time: 0.06601s