Skip to content
/ ppv Public

Tools for dealing with SDSS-V plate files and plate runs.

License

Notifications You must be signed in to change notification settings

jcbird/ppv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ppv - Python Plate Vetting

Tools for dealing with SDSS-V plate files and plate runs.

Installation

  • Setup environment (optional, but recommended)
    If fulfilling the Requirements seems daunting and you run the conda package manager, you can set up a python environment that will happily install `ppv` with
    conda env create -f ppv_sdss_min.yml  # creates conda environment
    conda activate ppv  # activates conda environment
        

    Once you have activated your environment, proceed to clone and install!

  • Clone this repository and install
    git clone https://github.com/jcbird/ppv.git  # clone repository
    cd ppv
        

    Install with pip. Note the -e option. With this option, `pip` will automatically reinstall ppv when you pull the latest commit. Very handy!

    pip install -e .    # installs ppv package
        
  • Requirements <<require>>
    • python (>3.5, 3.8 preferred) [if this frightens you, read on]
    • astropy
    • pexpect (this is a dependency of ipython)
    • pydl (development version) Package from Benjamin Weaver for dealing with yanny files.

Configuration and Data Files

ppv interacts with a number of data files and needs to know their location on disk. This is accomplished through the configuration file =ppv_setup.ini=. This setup file is short, but will grow in future releases.

The contents of ppv_setup.ini

parameterdefault valuedescription
plate_dir/home/user/path/to/platedirabsolute path to directory to store plate files
fiveplates_dir/home/user/path/to/five_plates/platerunsabsolute path to plateruns directory inside five_plates repo
sdss_orgusername_at_utahusername for sdss.org server at Utah

Notes:

  • file is ONLY read locally.
  • plate_dir does not need to exist. ppv will automatically create this directory if needed.

Copy ppv_setup.ini to ~/.config and edit

You MUST edit the ppv_setup.ini and copy it to the .config directory in your home directory. Make this directory if necessary. Using a posix shell,

mkdir ~/.config
cd ppv
cp ppv_setup.ini ~/.config

and edit accordingly.

five_plates functionality

=https://github.com/sdss/five_plates/tree/master/python= produces the input files for the plate design code. ppv can interact with these “field files” as well.

  • You MUST clone the five_plates to the local machine running ppv AND edit your ppv_setup.ini file to point to the plateruns directory inside the repository. Be sure to perform a git pull when necessary to get the latest plateruns files.
  • See the =five_plates= tutorial notebook in the docs directory for an example of this.

Plate directory and PlugHoles files

If you have an account at Utah and put the ppv_setup.ini file in your $HOME/.config directory, you are good to go! ppv will take of everything!

run ppv.ppv.update_platefiles() to ensure the latest versions of all plate files.

See the tutorial notebook in the docs directory for an example of this.

Breaking Changes (PLEASE READ)

In the interest of speed, ppv is following the, “break early and often” maxim. Inevitably, some changes will need to occur that are not backward-compatible. Apologies for the lack of a deprecation warning! Note that the tutorial notebooks in the docs folder are always updated to the latest syntax. With the hope that this section stays very short, the following breaking changes need to be accounted for:

Since version or commitChange
v0.3list of available plateruns are now accessible via ppv.ppv.available_plateruns()
v0.3summary table of all plates now accessible via ppv.ppv.allplate_summary
v0.35ppv.targets.Targets constructor now just takes table and, optionally, column names

Concepts

There are four basic objects in the ppv package: Plate, Field, Platerun, and Targets. There is also a convenient plate summary table.

Plate Summary

Table accessible via ppv.ppv.allplate_summary. Each row corresponds to a single plate and contains, amongst other columns, the plate id, position of the plate center, the program name driving plate design, the corresponding field (name), and the platerun.

Plate

One to one correspondence with a plate. A Plate is identified by its unique plate id (an integer; e.g., 15004).

Field

A field is defined by a field name (a string; e.g., AQM_001.85+26.44) and represents one field of view on the sky. All plates belong to one field. All fields contain one or more plates.

Platerun

A platerun is defined by its name (a string; e.g., 2020.08.c.bhm-mwm). A platerun is a collection of fields (and thus plates) to be a drilled for a given observing run.

Targets

The Targets class is a container for your targets of interest and interfaces with the Plate, Field, and Platerun objects.

Basic Usage

See the tutorial notebook in the docs directory.

FAQs

I don’t have an account at Utah and/or I can’t get the plugHoles files.

If you plan on checking SDSS-V targeting, please sign up for a Utah account at https://wiki.sdss.org/display/DATA/Utah+Accounts.
PLEASE DO THIS! \ If there is a delay in getting an account for any reason, submit an issue with “No Utah account” as the title. I will send you a tarball with the correct files and directory structure.

I don’t know the catalogIDs of the targets I want to check.

Look at the tutorial notebook (under Targets) to see if downloading one of the carton targetDB files is helpful. If not, create an issue and I will help asap!

Something doesn’t work, I wish ppv did THIS, why does ppv do THIS, I want to do X with ppv, or I wish something in ppv had a different name.

Awesome, let’s make it work. Submit an issue!

TODOs

  1. Sort targets and plugHoles tables by catalogID (after making sure that no info is lost in plugHoles files)
  2. Make it easy to get Gaia source IDs for all targets.
  3. Get documentation into ReadtheDocs format.
  4. Better Targets constructor.

  1. Make functions to update platePlans summary.
  2. Interface with five_plates field files.

About

Tools for dealing with SDSS-V plate files and plate runs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages