Notes on software, astronomy, machine learning, and infrastructure.

HiPS tile drawing

One of the major part of the hips package is being able to draw HiPS tiles onto a larger sky image. This involves using projective transformation for computing and drawing a HiPS tile at the correct location. The discussion below is for the tile containing the galactic center pixel values. To achieve this, several steps are involved.

Computing boundaries of a HiPS tile

A tile is defined by four corners, hips uses the astropy_healpix.HEALPix.boundaries_skycoord function which returns the angle (\(\theta\) and \(\phi\)) in radians wrapped inside astropy.coordinates.SkyCoord class. This contains the four corners of a HiPS tile in the order (North, West, South, East). A snippet which computes the corners of a HiPS tile is provided …

Read more →

Type annotations in Python 3.6 and using Mypy as a static type checker

The main goal of type annotations is to open up Python code for static analysis. It makes it easier to debug and maintain code because each type is explicitly stated. It also makes the code review process simpler as the parameters and return types can be inferred from the function header. These changes were introduced in PEP 484.

In this regards, static type checking is the most important. It allows support for off-line third-party type checkers, such as Mypy, which will be introduced in a later section.

Purpose of annotations

The typing module in Python 3.6 contains many definitions that are useful in statically typed code. For instance, the Any type is used by default for every argument and …

Read more →

An overview of Hierarchical Progressive Surveys (HiPS) and the HEALPix framework

The Hierarchical Progressive Surveys (HiPS) is a scheme for describing astronomical images and provides a solution for managing large amounts of data. Underneath, HiPS utilizes the HEALPix framework for mapping a sphere (in this case, part of a sky) and transforms it into HiPS tiles and HiPS pixels which contain the astronomical data. The HiPS scheme emphasizes on usability, and abstracts the scientific details to reach a wider audience. This can be further built upon for statistical analysis of large datasets. A brief overview of HEALPix is given below before moving onto the working of HiPS.

Introduction to HEALPix

HEALPix, an acronym of ‘Hierarchical Equal Area isoLatitude Pixelization of a sphere’, is a framework for discretizing high resolution data. It …

Read more →

An introduction to coordinate systems used in Astronomy

From Wikipedia:

In geometry, a coordinate system is a system which uses one or more numbers, or coordinates, to uniquely determine the position of the points or other geometric elements on a manifold such as Euclidean space.

The following text briefly explains the coordinate systems being used in astronomy, some of which are listed below:

RA / DEC

RA (right ascension) and DEC (declination) are the longitudes and latitudes of the sky. RA corresponds to east / west direction, similar to longitude, while DEC measures north / south directions, like latitude.

WCS

World Coordinate System (WCS) is a set of transformations that map pixel locations in an image to their real-world units, such as their position on the sky sphere. These transformations can …

Read more →

A comparison of response times using URLLib, GRequests, and asyncio

For the HiPS client multiple tiles have to be fetched for time efficiency. To achieve this, we create a separate thread for each outgoing request. Thus, requests are sent concurrently. A comparison is done utilizing Python’s threading library. The elapsed time is calculated using the time module. For fetching the tiles urllib, grequests, aiohttp, and asyncio packages are used. The HiPS survey chosen for this comparison is alasky.u-strasbg.fr.

For fetching 10 tiles, it takes the following time (in seconds):

Elapsed Time URLLib (without concurrency): 3.5430831909179688
Elapsed Time URLLib (with concurrency): 0.388397216796875
Elapsed Time URLLib (with aiohttp): 0.3900480270385742
Elapsed Time GRequests: 1.6238431930541992

Similarly, for fetching 100 tiles, it takes:

Elapsed Time URLLib (without concurrency …
Read more →

My First Article

Hello World!

This blog will be extensively used for posting GSoC updates, apart from other technical ramblings.

Read more →