Code Monkey home page Code Monkey logo

gethigal's Introduction

gethigal

A selenium webscraper for automated download of the Hi-GAL DR1 data products.

Dependencies

  • Python 3.x
  • Firefox with geckodriver
  • selenium
  • astropy

Drawbacks

  • Some manual interaction with Firefox is still required
  • Default download directory has to hacked around

Installation

To clone and install gethigal locally:

git clone https://github.com/vlas-sokolov/gethigal.git
cd gethigal
pip install .

Example use

The following code snippet downloads the Hi-GAL maps in a 15 arcminute radius around the IRDC G035.39-00.33:

import os
import astropy.units as u
import astropy.coordinates as c
from gethigal.requestform import RequestForm

home_dir = os.path.expanduser('~')

radius = 15*u.arcmin
skycoord_g035_39 = c.SkyCoord(284.2875*u.deg, 2.1294*u.deg, frame = 'fk5')

# Opens a Firefox session with "save file" pop-ups
getter = RequestForm(skycoord_g035_39, radius, submit = True)

# After the files are saved, moves them to a designated directory
getter.fix_download_loc(os.path.join(home_dir, 'Downloads/'), 'data/',
                        globber = "HIGAL*354*.fits", lay_low = True)

# Quits the browser session
getter.quit()

gethigal's People

Contributors

vlas-sokolov avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.