Skip to content

Ionosphere plotting

Yann Pfau-Kempf edited this page Jan 30, 2023 · 4 revisions

Practical tips for plotting ionosphere data in Visit:

Coastlines visualization

def user_macro_Add_world_map():
    ActivateDatabase("localhost:/path/to/file/ne_110m_coastline.shp")
    AddPlot("Mesh", "polyline", 1, 0)
    SetActivePlots(4)
    SetActivePlots(4)
    AddOperator("Transform", 0)
    TransformAtts = TransformAttributes()
    TransformAtts.doRotate = 1
    TransformAtts.rotateOrigin = (0, 0, 0)
    TransformAtts.rotateAxis = (0, 1, 0)
    TransformAtts.rotateAmount = -90
    TransformAtts.rotateType = TransformAtts.Deg  # Deg, Rad
    TransformAtts.doScale = 1
    TransformAtts.scaleOrigin = (0, 0, 0)
    TransformAtts.scaleX = 1
    TransformAtts.scaleY = 0.01745
    TransformAtts.scaleZ = 0.01745
    TransformAtts.doTranslate = 1
    TransformAtts.translateX = -6.471e+06
    TransformAtts.translateY = 1.571
    TransformAtts.translateZ = 0
    TransformAtts.transformType = TransformAtts.Similarity  # Similarity, Coordinate, Linear
    TransformAtts.inputCoordSys = TransformAtts.Cartesian  # Cartesian, Cylindrical, Spherical
    TransformAtts.outputCoordSys = TransformAtts.Spherical  # Cartesian, Cylindrical, Spherical
    TransformAtts.continuousPhi = 0
    TransformAtts.m00 = 1
    TransformAtts.m01 = 0
    TransformAtts.m02 = 0
    TransformAtts.m03 = 0
    TransformAtts.m10 = 0
    TransformAtts.m11 = 1
    TransformAtts.m12 = 0
    TransformAtts.m13 = 0
    TransformAtts.m20 = 0
    TransformAtts.m21 = 0
    TransformAtts.m22 = 1
    TransformAtts.m23 = 0
    TransformAtts.m30 = 0
    TransformAtts.m31 = 0
    TransformAtts.m32 = 0
    TransformAtts.m33 = 1
    TransformAtts.invertLinearTransform = 0
    TransformAtts.vectorTransformMethod = TransformAtts.AsDirection  # None, AsPoint, AsDisplacement, AsDirection
    TransformAtts.transformVectors = 1
    SetOperatorOptions(TransformAtts, 0, 0)
    AddOperator("Transform", 0)
    TransformAtts = TransformAttributes()
    TransformAtts.doRotate = 0
    TransformAtts.rotateOrigin = (0, 0, 0)
    TransformAtts.rotateAxis = (0, 0, 1)
    TransformAtts.rotateAmount = 0
    TransformAtts.rotateType = TransformAtts.Deg  # Deg, Rad
    TransformAtts.doScale = 0
    TransformAtts.scaleOrigin = (0, 0, 0)
    TransformAtts.scaleX = 1
    TransformAtts.scaleY = 1
    TransformAtts.scaleZ = 1
    TransformAtts.doTranslate = 0
    TransformAtts.translateX = 0
    TransformAtts.translateY = 0
    TransformAtts.translateZ = 0
    TransformAtts.transformType = TransformAtts.Coordinate  # Similarity, Coordinate, Linear
    TransformAtts.inputCoordSys = TransformAtts.Spherical  # Cartesian, Cylindrical, Spherical
    TransformAtts.outputCoordSys = TransformAtts.Cartesian  # Cartesian, Cylindrical, Spherical
    TransformAtts.continuousPhi = 0
    TransformAtts.m00 = 1
    TransformAtts.m01 = 0
    TransformAtts.m02 = 0
    TransformAtts.m03 = 0
    TransformAtts.m10 = 0
    TransformAtts.m11 = 1
    TransformAtts.m12 = 0
    TransformAtts.m13 = 0
    TransformAtts.m20 = 0
    TransformAtts.m21 = 0
    TransformAtts.m22 = 1
    TransformAtts.m23 = 0
    TransformAtts.m30 = 0
    TransformAtts.m31 = 0
    TransformAtts.m32 = 0
    TransformAtts.m33 = 1
    TransformAtts.invertLinearTransform = 0
    TransformAtts.vectorTransformMethod = TransformAtts.AsDirection  # None, AsPoint, AsDisplacement, AsDirection
    TransformAtts.transformVectors = 1
    SetOperatorOptions(TransformAtts, 1, 0)
    MeshAtts = MeshAttributes()
    MeshAtts.legendFlag = 1
    MeshAtts.lineWidth = 0
    MeshAtts.meshColor = (128, 128, 128, 255)
    MeshAtts.meshColorSource = MeshAtts.MeshCustom  # Foreground, MeshCustom, MeshRandom
    MeshAtts.opaqueColorSource = MeshAtts.Background  # Background, OpaqueCustom, OpaqueRandom
    MeshAtts.opaqueMode = MeshAtts.Auto  # Auto, On, Off
    MeshAtts.pointSize = 0.05
    MeshAtts.opaqueColor = (255, 255, 255, 255)
    MeshAtts.smoothingLevel = MeshAtts.High  # None, Fast, High
    MeshAtts.pointSizeVarEnabled = 0
    MeshAtts.pointSizeVar = "default"
    MeshAtts.pointType = MeshAtts.Point  # Box, Axis, Icosahedron, Octahedron, Tetrahedron, SphereGeometry, Point, Sphere
    MeshAtts.showInternal = 0
    MeshAtts.pointSizePixels = 2
    MeshAtts.opacity = 1
    SetPlotOptions(MeshAtts)
    DrawPlots()
    
RegisterMacro("Add world map", user_macro_Add_world_map)
  • (Modify the source appropriately to find the earth coastline data file that I post below)
  • Click "Update Macros" at the bottom.
  • Then, close the commands window and open "Controls"->"Macros".
  • There, you'll now find a new button that magically adds a world map to a plotting window!

This also works for any other plot, but I presume it is pretty useless for anything else but ionosphere plots.

Truecolor globe

  • Find the truecolor globe from turso:/wrk-vakka/group/spacephysics/vlasiator/temp/globe.vtk
  • With VisIt, add a truecolor plot of the variable color -> shows the globe in units of RE
  • Use a transform operator to rotate as desired
  • Uses (heavily downsampled) NASA Blue Marble Next Generation imagery. If you manage to set up a proper textured sphere in VisIt, feel free to update the globe data!