[R-sig-Geo] astrophysics - transform sf from equatorial to galactic coordinates

Barry Rowlingson b@row||ng@on @end|ng |rom gm@||@com
Sun Mar 22 21:51:12 CET 2020


Eugene,

I don't think this can be done using the PROJ library that does most
coordinate transformations for sf objects. The `astrolibR` package has
functions for converting coordinates on various astronomical systems

 https://cran.r-project.org/web/packages/astrolibR/astrolibR.pdf

but you have to feed it vectors of RA and declination rather than entire
spatial objects. This isn't much of a problem if you are dealing with
points (extract coords with st_coordinates, convert, make a new geometry)
but for lines of polygons you need to extract all the vertex points,
convert them, then rebuild the features.

You might also have problems if you have lines or polygons going across the
cosmic coordinate equivalent of the -180/+180 longitude line...

 Having another look, it *might* be possible to do this with PROJ by
constructing an appropriate spherical rotated coordinate system,  and you
might even be able to convert degrees to RA hours with a +units parameter...

Barry



On Sat, Mar 21, 2020 at 6:06 PM Eugene Hickey <Eugene.Hickey using tudublin.ie>
wrote:

> Hi
> Does anyone know of a way to transform an sf from equatorial (RA, DEC)
> into galactic (b, l) coordinates please?
>
>
> Thanks
> Eugene
>
> This email originated from TU Dublin. If you received this email in error,
> please delete it from your system. Please note that if you are not the
> named addressee, disclosing, copying, distributing or taking any action
> based on the contents of this email or attachments is prohibited.
>
> Is ó OT Baile Átha Cliath a tháinig an ríomhphost seo. Má fuair tú an
> ríomhphost seo trí earráid, scrios de do chóras é le do thoil. Tabhair ar
> aird, mura tú an seolaí ainmnithe, go bhfuil dianchosc ar aon nochtadh, aon
> chóipeáil, aon dáileadh nó ar aon ghníomh a dhéanfar bunaithe ar an ábhar
> atá sa ríomhphost nó sna hiatáin seo.
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list