{"id":20440432,"url":"https://github.com/astrosica/python-functions","last_synced_at":"2025-04-12T23:09:41.953Z","repository":{"id":173128063,"uuid":"149509543","full_name":"astrosica/python-functions","owner":"astrosica","description":"Miscellaneous Python functions.","archived":false,"fork":false,"pushed_at":"2024-02-06T17:08:05.000Z","size":290,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T17:11:24.177Z","etag":null,"topics":["astronomy","convolution","coordinate-systems","coordinate-transformations","coordinates","fits","fits-files","photometry","polarimetry","polarization","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astrosica.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-09-19T20:39:31.000Z","updated_at":"2025-02-22T15:13:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"bbafa7a9-02a8-43ba-9e4e-d85c14a09214","html_url":"https://github.com/astrosica/python-functions","commit_stats":null,"previous_names":["astrosica/misc-functions","astrosica/python-functions","jessicacampbell-astro/python-functions"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrosica%2Fpython-functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrosica%2Fpython-functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrosica%2Fpython-functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrosica%2Fpython-functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astrosica","download_url":"https://codeload.github.com/astrosica/python-functions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643004,"owners_count":21138355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astronomy","convolution","coordinate-systems","coordinate-transformations","coordinates","fits","fits-files","photometry","polarimetry","polarization","python"],"created_at":"2024-11-15T09:24:17.894Z","updated_at":"2025-04-12T23:09:41.932Z","avatar_url":"https://github.com/astrosica.png","language":"Python","readme":"# Python functions\n\nPython functions for PhD work.\n\n## Polarization\n\n* [x] compute the polarized intensity and its uncertainty\n* [x] compute the polarization angle and its uncertainty\n* [x] compute the polarization fraction and its uncertainty\n* [x] compute the de-biased polarized intensity\n* [x] compute the polarization gradient (with and without cross-terms)\n* [x] compute the normalized polarization gradient (with and without cross-terms)\n* [x] compute the argument of polarization gradient (with and without cross-terms)\n* [x] apply a mask to the argument of polarization gradient\n* [x] compute the radial and tangential components of the polarization gradient\n* [x] compute the angular version of the polarization gradient\n* [x] compute the plane-of-sky magnetic field orientation\n* [x] compute an estimate of the polarization angle dispersion function\n* [x] compute the de-rotated magnetic field orientation\n* [x] create a dictionary of polarization gradient arguments for each pixel\n* [x] plot an image with pseudovectors overlaid\n* [x] compute the rotation measure structure function (RMSF) and related parameters\n* [x] compute the first moment of a one-dimensional Faraday dispersion function\n* [x] compute the second moment of a one-dimensional Faraday dispersion function\n* [x] compute the first moment map of a three-dimensional Faraday dispersion function\n* [x] compute the second moment map of a three-dimensional Faraday dispersion function\n\n## FITS files\n\n* [x] construct the frequency axis of a 3D FITS file\n* [x] compute the average across a data cube's third axis\n* [x] compute the summation of a list of 2D FITS files\n* [x] create a grid of equatorial coordinates for a FITS file\n* [x] create a grid of Galactic coordinates for a FITS file\n* [x] transform a coordinate grid from equatorial to Galactic coordinates\n* [x] transform a coordinate grid from Galactic to equatorial coordinates\n* [x] reproject one 2D FITS image to another\n* [ ] reproject one 3D FITS image to another\n* [x] reproject a 2D FITS image from equatorial to Galactic coordinates\n* [x] reproject a 3D FITS image from equatorial to Galactic coordinates\n* [ ] reproject a 2D FITS image from Galactic to equatorial coordinates\n* [ ] reproject a 3D FITS image from Galactic to equatorial coordinates\n* [x] reproject a HEALPix image to a standard FITS projection\n* [x] creates a mask using a condition on Galactic latitude\n* [x] masks a 2D FITS image in equatorial coordinates based on Galactic latitude\n* [x] transform a 3D FITS header to a 2D FITS header\n* [x] slice a 3D FITS data cube along its third axis and save each 2D image as a separate FITS image\n\n## Sky Coordinates\n\n* [x] transform Right Ascension and Declination coordinates from decimal degrees to the sexagismal system\n* [x] transform Right Ascension and Declination coordinates from the sexagismal system to decimal degrees\n* [x] precess Right Ascension and Declination coordinates from the sexagismal system in the B1959 equinox to decimal degrees in the J2000 equinox\n* [x] match two sets of catalogue positions in equatorial coordinates\n* [x] write a set of cooridinates to an annotation file for kvis\n* [x] write a set of cooridinates to a region file for ds9\n\n## Photometry\n\n* [x] convert photometric magnitude uncertainty to signal-to-noise ratio\n* [x] convert photometric signal-to-noise ratio to magnitude uncertainty\n* [x] convert AB magnitudes to the Vega magnitude scale\n* [x] compute photometric colour and its uncertainty\n* [x] compute J-, H-, and K-band extinctions using the RJCE technique\n* [x] compute J-, H-, and K-band intrinsic magnitudes using the RJCE technique\n* [x] compute J-, H-, and K-band distance-corrected luminosities using Gaia parallaxes\n* [x] compute distance using Gaia parallax\n\n## Rolling Hough Transform\nSee the [Rolling Hough Transform](https://github.com/seclark/RHT).\n* [x] execute the RHT on all FITS files within a given directory\n* [x] add contents of a FITS image header to an RHT FITS file\n* [x] collect all RHT angles for each spatial pixel in the image plane\n* [x] compute the distribution in RHT angle differences between two images\n* [x] compute the RHT backprojection allowing one to mask specific angles\n\n## Planck\n\n* [x] converts Planck Stokes maps from K_CMB to MJy/sr\n* [x] converts Planck Stokes maps from uK to MJy/sr\n* [x] remove the CMB monopole from the Planck 353 GHz Stokes maps\n* [x] add the Galactic HI offset correction to the Planck 353 GHz Stokes I map\n\n## Line Integral Convolution (LIC)\n\n* [x] compute magnetic field orientation in IAU convention\n* [x] compute LIC texture\n* [x] overplot LIC texture on an image\n\n## Colormaps\n\n* [x] twilight colormap\n* [x] Planck frequency colormap\n* [x] Planck parchment colormap\n\n## Miscellaneous\n\n* [x] convert frequency to wavelength\n* [x] convert wavelength to frequency\n* [x] compute upper limit kinetic temperature from line broadening\n* [x] mask a 2D FITS image in signal\n* [x] mask a 2D FITS image in signal-to-noise\n* [x] compute the 1D and 2D fast Fourier transform (FFT)\n* [x] compute the 1D and 2D inverse fast Fourier transform (IFFT)\n* [x] compute the 2D spatial gradient of an image\n* [x] map angles defined on the polar plane \\[0,2pi) to the half polar plane \\[0,pi)\n* [x] compute the angular difference between two angles defined on the half-polar plane\n* [x] convolve a 2D FITS image using FFT convolution\n* [x] reads in a ROHSA data file\n* [x] mask and interpolate over point sources\n* [x] applies a mask to a 2D FITS image and interpolates\n* [x] mask an image within the boundary of a circle\n* [x] mask an image within the boundary of an ellipse\n* [x] mask an image betweeen two lines\n* [x] masks basketweaving artefacts of the GALFACTS sensitivity map FFT\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrosica%2Fpython-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrosica%2Fpython-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrosica%2Fpython-functions/lists"}