Coder Social home page Coder Social logo

pvhub's Introduction

pvhub

Function to predict peculiar velocities given RA (right ascension), Dec (declination), and CMB-frame redshift. All maps are in redshift-space. All maps are limited to z < 0.067 with a flag in the function for extrapolation option. Conversion from real-space to redshift space as well as the extrapolation option are explained by Carr et al. (2021).

Maps

The number of each map is the corresponding flag in pvhub.py

default

  1. 2M++_SDSS (Said et al. 2020; Peterson et al. 2021; Carr et al. 2021)

Other available maps

  1. 2M++_SDSS_6dF (Said et al. 2020)
  2. 2MRS (Lilow & Nusser 2021)
  3. 2M++ (Carrick et al. 2015)

Cloning

The PV maps are large files (156 MB each), so to properly clone this repository you must use Git Large File Storage (or download them individually from this webpage). If you have not used Git LFS before, see https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage or follow the instructions below.

Mac

brew install git-lfs
git lfs install
git clone https://github.com/KSaid-1/pvhub.git

Linux

sudo apt install git-lfs
git lfs install
git clone https://github.com/KSaid-1/pvhub.git

Windows

You can use the GitHub Desktop GUI application or Git for Windows, both of which come with Git LFS. If not using a GUI, then continue as normal in Git Bash:

git clone https://github.com/KSaid-1/pvhub.git

Running

Simply import pvhub into your python code, execute the choose_model() function that accepts an integer from 0 to 3 for the maps as listed above, then run calculate_pv() with your RA, Dec and redshift:

import pvhub
pvhub.choose_model(flag)
pv = pvhub.calculate_pv(RA, Dec, zcmb, extrapolation=True)

A few examples of how to use this code are shown in examples/example.py. We provide an example set of input objects in examples/example.csv. You can run the example code from within the examples directory via python example.py

You only need to run choose_model() once and calculate_pv() will continue to use what was selected. If you do not choose a model, the default model 0 will be selected. You can input single objects or lists of RA, Dec, and the redshift to calculate for any number of objects at once.

Coordinates are expected to be in decimal degrees, and output peculiar velocities are in km/s.

pvhub's People

Contributors

anthonyc958 avatar ksaid-1 avatar

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.