Giter Site home page Giter Site logo

apvisitproc's Introduction

apVisitproc

badge-img

This package assumes you, the user, have some apVisit spectra from APOGEE and would like to turn them into text files that are continuum normalized and free of "spikey" telluric artifacts.

Prerequisites

Installation

First, clone (or download and unzip) this package.

At present, the best way to run the two main scripts in this package are from the command line, as described below.

You may also navigate to the apVisitproc directory and run python setup.py install. This should allow you to import apvisitproc within python, but this is not particularly useful at present.

apVisit2input

apVisit2input.py takes a data directory datadir and a KIC (targetID). It looks for a text file named datadir/KIC/KICVisitinfo.txt which you must create for your target.

To create this file, use the interface at https://dr13.sdss.org/infrared/spectrum/view/visits to retrieve a list of apVisit spectra. Save the CSV as the KICVisitinfo.txt file described above.

For example, if your target's KIC is 9246715 and APOGEE ID is 2M20034832+4536148:

  • Search for the APOGEE ID = 2M20034832+4536148 using the web form
  • Scroll down and select the "Visits" tab
  • Click the button to download the Table (csv) of the visit metadata
  • Rename/move this file to datadir/9246715/9246715Visitinfo.txt
  • Then, run apVisit2input like this

$ python apVisit2input.py -d datadir -k 9246715

The output will show the result of the continuum normalization for each visit spectrum. Once this is complete, you will have a new set of text file spectra. The full path to each one is printed to the screen, along with each visit's time of observation in days (HJD) and barycentric velocity in km/s (BCV).

despike

despike.py takes either the text files generated by apVisit2input (preferred) or a set of regular apVisit FITS files (in case you downloaded them individually yourself and did not use apVisit2input). You must tell the program which files to despike by creating a text file referred to as infilelist that lives at datapath. (Note that following the example convention above, datapath = datadir/KIC/.)

For example, if you have just two spectra in datapath, create a text file called infilelist.txt in the same directory which contains two lines

nameofspectrum1.txt
nameofspectrum2.txt

Do not include the full paths to the spectra in infilelist.txt, just their filenames.

Note: if you are using apVisit FITS files that have not been retrieved via apVisit2input, the visit spectra may have names like, e.g., nameofspectrum1.fits. This approach is not recommended because apVisit2input does continuum normalization and despike may not work well on un-normalized spectra.

Then, run despike like this

$ python despike.py -d datapath -i infilelist.txt

The output is a series of plots showing what the despike routine is doing. Close each plot to let the program proceed. When it is finished, you will have a new set of text file spectra in datapath that end in _despiked.txt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.