Skip to content

ywyw/dat-wise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

dat-wise

A dat importer for the all-sky data release from WISE

Disclaimer: Work in progress

columns.csv has the metadata for the WISE data

Thanks to Starlink for parsing the column names!

To run the demo, download the following:

Docker image

Download an example FITS file here:

curl http://lambda.gsfc.nasa.gov/data/map/dr4/ancillary/masks/wmap_temperature_analysis_mask_r9_7yr_v4.fits -o example.fits

usage: username, databasename

python healpixdb.py "Y" "tempdb"

POSTGRES schema: nside | npix | ipix | filename

This should insert all the healpixels into a POSTGRES database of your naming and print them out.

Demo for ra/dec to healpix geohash:

import numpy
import healpy
m = numpy.arange(healpy.nside2npix(4))
healpy.mollview(m, nest=True, title="Mollview image NESTED")
nside = 4
(theta,phi) = radec2polar(60,-1.25)
ipix = polar2healpix(theta,phi,nside)
(binnum, remainder) = ipix2tuple(ipix,nside)
print tuple2hash(binnum,remainder)
bounds = healpy.boundaries(1,0,nest=True,step=1)
vectranspose = bounds.T
numpy.array(healpy.vec2ang(vectranspose))
map(polar2radec, numpy.array(healpy.vec2ang(vectranspose)).T)

For a bbox query of npix = 12 resolution:

simplequery(ramin,decmin,ramax,decmax)

For a query returning minimum resolution healpix:

fullquerywrap(ramin,decmin,ramax,decmax,nsidemin)

Breakdown of bounding box query cases:

All possible intersections of a rectangular query against a curved Healpix are as follows:

Case one

This case is handled by testing each Healpix corner and seeing if it's within range of the bounding box, which is easy

Case two

This case is done by the radec2healpix function, which tests each corner of the bbox and sees if it lands within the Healpix in question, also straightforward

Case three

This is an edge case that took some consideration, when no corners of either fall within the other, this is a fairly fast and easy way to avoid complex math and dealing with curved Healpix edges

A fourth case occurs when the Healpix is entirely inside the bounding box, and here, we decide not to divide this pixel further in the recursive set algorithm.

WIP

  • hashing for queries
  • reverse functions
  • latlong vs radec: radec is 0 -> 360 and then modulus, latlong is -180 -> 180, change query valid func
  • change queries to be in radec format
  • settle ring vs nest: read docs
  • write a few tests

About

Importer for the WISE All-Sky Data Products

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages