R:在银河系中以Mollweide投影绘制天空图 [英] R: plotting sky map in Mollweide projection in galactic coordinate system

查看:188
本文介绍了R:在银河系中以Mollweide投影绘制天空图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Mollweide投影(椭圆投影提供360°视角的椭圆投影,用于绘制夜空)中生成具有星座等特征的星图.我在> https://kimnewzealand.github.io/2019/找到了食谱02/21/celestial-maps/(使用 sf 包)并将天空对象的默认EPSG:4326数据转换为Mollweide投影.

I need to produce the star map with constellations etc in the Mollweide projection (elliptical projection giving 360 view angle, used in plotting night sky). I found a recipe at https://kimnewzealand.github.io/2019/02/21/celestial-maps/ with the use of sf package and converting the default EPSG:4326 data of the sky objects into Mollweide projection.

在某些时候,使用以下命令将数据转换为Mollweide投影:

At some stage the data is converted to the Mollweide projection using the command:

constellation_lines_sf_trans<- st_transform(constellation_lines_sf_trans, crs = "+proj=moll")

按照链接中所述的线条复制的结果图像如下所示:

The resulting image, reproduced along the lines as described in the link, looks like:

很好,但是,坐标系是赤道的,基本上与地球上所有坐标系具有相同的旋转轴,例如WGS84(北极向上).例如,在该图上显示了银河系,以60度角移动.我们需要所谓的 galactic 坐标:这是与银河系平面重合的坐标平面.因此,这里的银河系只是椭圆轴的一条水平线.例如,在其他地方找到的解决方案似乎使用了相同的技术,但是此处未提供代码:

It is fine, however, the coordinate system is equatorial, that is basically with the same rotation axis as all coordinate systems on the Earth, like WGS84 (North Pole upwards). For example, the Milky Way is shown on this plot, going at some angle 60 degrees. We need the so called galactic coordinates: this is the coordinate plane coinciding with the plane of our Galaxy. So, Milky way here would be just a horizontal line of the ellipse axis. For example, the solution found elsewhere, seems to use the same technique, but the code is not given there:

这里的银河系是一条水平线,北极在左上角(表示为np;例如,在这里可以看到北极附近大熊/次要星座的可辨认星座).我将拍摄此图像,但有一个盲点(显示天文台的盲区,该盲区无法到达天空中的此区域),因此我想重现此图像:星座+莫尔维德投影+星系的银河"方向参考框架.

Here Milky Way is a horizontal line, and the North Pole is in the upper left corner (denoted as np; for example, here one can see the distorted recognizable constellations of Ursa Major/Minor around the North Pole). I would take this image, but there is a blind spot (showing the blind zone of an observatory which cannot reach this region in the sky), so I would like to reproduce this image: constellations + Mollweide projection + "galactic" orientation of the reference frame.

我们能够在R包中的各种坐标系之间进行转换.似乎大多数GIS工具都根据地球所需的旋转(北极向上)来使用各种与地球相关的坐标系和投影,这是GIS所需的大多数应用程序.问题是,是否有可能加载并转换为预定义的银河坐标系(或例如,黄道系),或者是否可以在脚本中通过手动转换恒星数据来即时执行此转换

We are able to convert between variety of coordinate systems in R packages. It seems that most GIS tools use various flavors of Earth-related coordinate systems and projections, based to the rotation of the Earth (North Pole up), for majority of applications, needed for GIS. The question is whether it is possible to load and convert to a predefined galactic coordinate system (or, for example, to the ecliptic system), or to perform this conversion on the fly in the scripts with manual conversion of star data

推荐答案

实际上,在进一步研究之后,看来这全都归因于您的投影进行旋转. 交互式示例上的代码中也会发生这种情况.我在下面进一步提到.要使其以银河系中心为中心,您需要旋转[93.5949, 28.9362, -58.5988],它指定围绕每个球面轴的[lambda,phi,γ]旋转角度,以度为单位. (旋转时,不再需要将radec坐标转换为银河坐标.)

Actually, after further research, it appears that it all comes down to having your projection do a rotation. This also happens in the code on the interactive example I mention farther below. To make it center of the Galactic center, you need to rotate by [93.5949, 28.9362, -58.5988], which specify the [lambda, p gamma] rotation angles in degrees about each spherical axis. (when you rotate, there's no need to convert your ra or dec coordinates to galactic coordinates anymore.)

我对R中的映射了解不足,无法说出是否可以在投影上指定旋转,但是

I don't know enough about mapping in R to be able to say if it's possible to specify a rotation on a projection, but here's an amazing example that shows this process with d3.js (and for those truly interested, shows where the angles come from). In case it's not possible, perhaps the route below would still be viable.

我正在调查同一件事,可能发现了一些东西.我认为您首先需要将赤道 ra (右升)和 dec (赤纬)坐标转换为银河坐标.然后然后应用一个(Mollweide)投影.我不确定这是否完全正确,因为我的情况略有不同,但这至少对我有用:

I was investigating the same thing, and I might've found something. I think that you first need to convert your equatorial ra (right ascension) and dec (declination) coordinates to galactic coordinates. And then apply a (Mollweide) projection. I'm not sure if that is completely correct since my case was slightly different, but at least this worked for me:

  • The dataset has rows of ra &dec in equatorial coordinates (given in degrees in my case)
  • Using the euler function of the astrolibR package, I calculate the Galactic longitude gl and latitude gb (ps: you can also use the glactc function):
data$gl <- euler(data$ra, data$dec, select=1)$ao
data$gb <- euler(data$ra, data$dec, select=1)$bo

  • 接下来,我使用这些新坐标应用 Aitoff 投影,该投影也是 astrolibR 包以获取xy坐标:
    • Next, using these new coordinates I apply the Aitoff projection that is also part of the astrolibR package to get back x and y coordinates:
    • data$x <- -aitoff(data$gl, data$gb)$x
      data$y <- aitoff(data$gl, data$gb)$y
      

      然后我可以绘制

      ggplot(data, aes(x, y)) + geom_point(shape=16, size = 0.1, alpha = 0.2) + coord_fixed()
      

      (下面的图像基于我自己的观测数据集,暗线"紧跟着黄道线,右下角的两个斑点是大麦哲伦星云和小麦哲伦星云) 我发现与此交互式地图进行比较,并将坐标设置为银河系",以0,0为中心,然后尝试各种投影.

      (the image below is based on my own dataset of observations, the "darker line" follows the ecliptic line, and the two blobs in the lower right are the Large & Small Magellanic Clouds) I found it useful to compare against this interactive map and setting the coordinates to "galactic", centering on 0,0 and then trying different kinds of projections.

      也许您可以尝试使用glgb坐标来应用Mollweide投影?

      Perhaps you can try applying the Mollweide projection with the gl and gb coordinates instead?

      这篇关于R:在银河系中以Mollweide投影绘制天空图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆