healpix | convert between lonlat and HEALPix coordinates | 3D Animation library
kandi X-RAY | healpix Summary
kandi X-RAY | healpix Summary
convert between lonlat and HEALPix coordinates. HEALPix coordinates are an equal area projection very similar to cube mapping. This coordinate system is used heavily in cosmology, where equal-area and uniform point distribution are important for density comparisons and binning. The HEALPix algorithm is described in the paper Mapping on the HEALPix grid.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of healpix
healpix Key Features
healpix Examples and Code Snippets
from astropy import units as u
from astropy.coordinates import SkyCoord
import matplotlib.pyplot as plt
import h5py
#from astropy_healpix import HEALPix
import numpy as np
fits_file = 'pixel_coords_map_ring_galactic_res9.fits'
Community Discussions
Trending Discussions on healpix
QUESTION
I am trying to translate a python code into a C code. So I was trying to translate that line:
...ANSWER
Answered 2021-Jun-09 at 13:35If you check the related documentation :
read_healpix_map
This routine reads a full sky HEALPix map from a FITS file
Location in HEALPix directory tree: src/C/subs/read_healpix_map.c
FORMAT float *read_healpix_map(char *infile, long *nside, char *coordsys, char *ordering)
ARGUMENTS
QUESTION
I'm trying to open a FITS file with healpix using a C code:
...ANSWER
Answered 2021-Jun-04 at 17:46Per the documentation of read_healpix_map()
:
ordering
and coordsys
are output arguments - they are pointers to space into which the function will write results. You have passed pointers to string constants in memory that will normally be marked read-only and may not be sufficiently large to receive the result in any case.
nside
is also an output argument, initialising it to 512 serves no purpose. You do not need p_nside
; you can simply pass &nside
It is not the most clear of interfaces; specifically it is not clear whether coordsys
is a string or a single char
. The documentation uses single quotes so you might assume char
but then it does that for ordering
too and that is clearly a string. It is safest to assume coordsys
is a string - it will do no harm.
QUESTION
I want to create a scatter plot with the X-Axis as the longitude coordinates in the healpix file https://wwwmpa.mpa-garching.mpg.de/~ensslin/research/data/faraday2020.html (Healpix)
and the Y-Axis as the mean values in hdf5 file https://wwwmpa.mpa-garching.mpg.de/~ensslin/research/data/faraday2020.html (Faraday sky 2020)
Code until now:
...ANSWER
Answered 2021-May-24 at 17:29I think you're close. IMHO, this scatter plot is easier than plotting with both skyplot coordinates (projection="aitoff"
). The process is similar to the answers I posted on your earlier question: Plot mean and standard dev values on skyplot using astropy from hdf5 file. You just need some minor teaks to the function parameters.
I modified your code to create a 2D scatter plot. Here's a quick summary of the differences:
- Changed
from astropy.coordinates import SkyCoord
(instead ofHEALPix
) - Changed matplot type (remove
projection=
) - Changes y-variable from
b_rad
tofaraday_sky_mean
on scatter plot. - Deleted
c=faraday_sky_mean
fromplt.scatter()
so data points are not color coded.
See code below.
QUESTION
I found an implementation of the HEALpix algorithm this is the dokumentation And the output looks very nice.
The following images show the latitude / longitude conversion to HEALpix areas. The x-axe goes from 0 to 2 * pi. The y-axe goes from 0 to pi. The grey color represents the HEALpix pixel encoded in grey.
The different grey values are the IDs for the texture I have to use. That means, that each HEALpix pixel represents one texture. The missing part is the UV mapping within each of the HEALpix pixels like shown below:
Right now I am using the function:
...ANSWER
Answered 2020-Oct-28 at 12:38After a lot of research I came to a solution for this problem:
First of all, I've changed the scheme to NESTED. With the NESTED scheme and a very high nSide value (8192), the returned value from the
QUESTION
I've got a high-resolution healpix map (nside = 4096) that I want to smooth in disks of a given radius, let's say 10 arcmin.
Being very new to healpy and having read the documentation I found that one - not so good - way to do this was to perform a "cone search", that is to find around each pixels the ones inside the disk, average them and give this new value to the pixel at the center. However this is very time-consuming.
...ANSWER
Answered 2019-May-18 at 10:00As suggested, I can easily make use of the healpy.sphtfunc.smoothing function by specifying a custom (circular) beam window.
To compute the beam window, which was my problem, healpy.sphtfunc.beam2bl is very useful and simple in the case of a top-hat.
The appropriated l_max would roughly be 2*Nside but it can be smaller depending on specific maps. One could for example compute the angular power-spectra (the Cls) and check if it dampens for smaller l than l_max which could help gain some more time.
Thanks a lot to everyone who helped in the comments section!
QUESTION
I have a Dockerfile which was originally pulling from ubuntu and I recently came across alpine which is more lightweight so would like to pull from that instead. Part of the code I'm trying to build is called Healpix which depends on cfitsio. When I originally built the ubuntu version I found this Dockerfile https://github.com/MilesCranmer/dockers/blob/master/dockerfiles/healpix.
Essentially the problem is the following works in ubuntu but not with alpine:
...ANSWER
Answered 2019-Mar-30 at 15:38In your Dockerfile
, use :
QUESTION
when I rotate a Healpix map along longitude or latitude, I get the wrong behavior. I'm probably missing something obvious here but so far, I failed to find what.
See demo:
...ANSWER
Answered 2018-Dec-06 at 16:05Theta is co-latitude, Phi is longitude.
It is confusing because their order is inverted than what we usually expect. In fact even in healpy
, for example in pix2ang if you set lonlat
to true, you get as outputs first Longitude and then Latitude.
Unfortunately this is the convention and we have to stick to this.
QUESTION
The data are coordinates of objects in the sky, for example as follows:
...ANSWER
Answered 2018-May-24 at 08:40Great question! I've written a short function to convert a catalogue into a HEALPix map of number counts:
QUESTION
I got a wired problem when setting a dataframe's column value as a series. I am reading a big csv file into chunks and processing each chunk to get a series, then add the series to each chunk as a new column. the code is as follows:
...ANSWER
Answered 2018-Apr-25 at 12:39In the below statement
QUESTION
I'm having trouble locating the source of an error in my code, that when run, produces a segfault. I know the error is in code that is essentially:
...ANSWER
Answered 2017-Jun-15 at 18:27The latter two values are "out" parameters, so you could call it by taking the address of stack-allocated variables.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install healpix
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page