Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://bitbucket.org/vgl_iisc/bivariate-analysis-for-electronic-transitions/src/master
30 May 2024, 13:38:14 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • a9cc5886fdf1a5f09f584eb12255b9007228cf48
    No releases to show
  • 417ddc4
  • /
  • CSP Operators
  • /
  • CSPS lenses
  • /
  • CSP_lenses.py
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:9c07abfab5e4b46fac852ae923dcf17cd9c7d1b6
origin badgedirectory badge
swh:1:dir:36f451d06c7c68126e117c4900642b5b57d4b426
origin badgerevision badge
swh:1:rev:a9cc5886fdf1a5f09f584eb12255b9007228cf48
origin badgesnapshot badge
swh:1:snp:b81f805f05c6499be1375f6e8a617be1cee68ccf

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: a9cc5886fdf1a5f09f584eb12255b9007228cf48 authored by Mohit Sharma on 27 May 2024, 07:42:17 UTC
Added representative image for replicability stamp
Tip revision: a9cc588
CSP_lenses.py
# state file generated using paraview version 5.5.2

# ----------------------------------------------------------------
# setup views used in the visualization
# ----------------------------------------------------------------

# trace generated using paraview version 5.5.2

#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()

# Create a new 'Render View'
renderView1 = CreateView('RenderView')
renderView1.AnnotationColor = [0.0, 0.0, 0.0]
renderView1.InteractionMode = '2D'
renderView1.AxesGrid = 'GridAxes3DActor'
renderView1.OrientationAxesVisibility = 0
renderView1.OrientationAxesLabelColor = [0.0, 0.0, 0.0]
renderView1.OrientationAxesOutlineColor = [0.0, 0.0, 0.0]
renderView1.CenterOfRotation = [0.0, 0.0, 1e-20]
renderView1.StereoType = 0
renderView1.CameraPosition = [0.000471635620407468, -0.000471635620407453, -0.103419034991959]
renderView1.CameraFocalPoint = [0.000471635620407468, -0.000471635620407453, 1e-20]
renderView1.CameraParallelScale = 0.0270247210493478
renderView1.Background = [1.0, 1.0, 1.0]

# init the 'GridAxes3DActor' selected for 'AxesGrid'
renderView1.AxesGrid.XTitleColor = [0.0, 0.0, 0.0]
renderView1.AxesGrid.XTitleFontFile = ''
renderView1.AxesGrid.YTitleColor = [0.0, 0.0, 0.0]
renderView1.AxesGrid.YTitleFontFile = ''
renderView1.AxesGrid.ZTitleColor = [0.0, 0.0, 0.0]
renderView1.AxesGrid.ZTitleFontFile = ''
renderView1.AxesGrid.GridColor = [0.0, 0.0, 0.0]
renderView1.AxesGrid.XLabelColor = [0.0, 0.0, 0.0]
renderView1.AxesGrid.XLabelFontFile = ''
renderView1.AxesGrid.YLabelColor = [0.0, 0.0, 0.0]
renderView1.AxesGrid.YLabelFontFile = ''
renderView1.AxesGrid.ZLabelColor = [0.0, 0.0, 0.0]
renderView1.AxesGrid.ZLabelFontFile = ''

# ----------------------------------------------------------------
# restore active view
SetActiveView(renderView1)
# ----------------------------------------------------------------

# ----------------------------------------------------------------
# setup the data processing pipelines
# ----------------------------------------------------------------

# create a new 'Line'
line1 = Line()

# create a new 'Line'
line2 = Line()
line2.Point1 = [0.0, -0.5, 0.0]
line2.Point2 = [0.0, 0.5, 0.0]

# create a new 'Line'
line3 = Line()
line3.Point1 = [-0.5, -0.5, 0.0]
line3.Point2 = [0.5, 0.5, 0.0]

# create a new 'Line'
line4 = Line()
line4.Point1 = [-0.5, 0.5, 0.0]
line4.Point2 = [0.5, -0.5, 0.0]

# create a new 'XML Image Data Reader'
state1vti = XMLImageDataReader(FileName=['/home/mohit/Desktop/electronDAta/TQ-geometries-Vornoi-segments/tq-120.vti'])
state1vti.PointArrayStatus = ['hole_nto', 'particle_nto', 'hole_charge_density', 'particle_charge_density', 'segment_ID']

# create a new 'Calculator'
select_subgroupHole = Calculator(Input=state1vti)
select_subgroupHole.ResultArrayName = 'selected_hole_nto'
select_subgroupHole.Function = 'if(segment_ID>-1, hole_nto, 0)'
RenameSource('Select subgroup (Hole)', select_subgroupHole)

# create a new 'Calculator'
select_subgroupParticle = Calculator(Input=select_subgroupHole)
select_subgroupParticle.ResultArrayName = 'selected_particle_nto'
select_subgroupParticle.Function = 'if(segment_ID>-1, particle_nto, 0)'
RenameSource('Select subgroup (Particle)', select_subgroupParticle)

# create a new 'Plane'
plane1 = Plane()
plane1.Origin = [-0.02, -0.02, 0.0]
plane1.Point1 = [0.02, -0.02, 0.0]
plane1.Point2 = [-0.02, 0.02, 0.0]
plane1.XResolution = 400
plane1.YResolution = 400

# create a new 'TTK ContinuousScatterPlot'
tTKContinuousScatterPlot1 = TTKContinuousScatterPlot(Input=select_subgroupParticle)
tTKContinuousScatterPlot1.ScalarField1 = 'selected_hole_nto'
tTKContinuousScatterPlot1.ScalarField2 = 'selected_particle_nto'
tTKContinuousScatterPlot1.ScatterplotResolution = [800, 800]

# create a new 'Resample With Dataset'
resampleWithDataset1 = ResampleWithDataset(Input=tTKContinuousScatterPlot1,
    Source=plane1)
resampleWithDataset1.PassPointArrays = 1
resampleWithDataset1.Tolerance = 2.22044604925031e-16
resampleWithDataset1.CellLocator = 'Static Cell Locator'

# create a new 'Calculator'
hole_charge_lens = Calculator(Input=resampleWithDataset1)
hole_charge_lens.ResultArrayName = 'hole_weight'
hole_charge_lens.Function = 'coordsX * coordsX'
RenameSource('Hole charge lens', hole_charge_lens)

# create a new 'Calculator'
particle_charge_lens = Calculator(Input=hole_charge_lens)
particle_charge_lens.ResultArrayName = 'particle_weight'
particle_charge_lens.Function = 'coordsY * coordsY'
RenameSource('Particle charge lens', particle_charge_lens)

# create a new 'Calculator'
charge_transfer_lens = Calculator(Input=particle_charge_lens)
charge_transfer_lens.ResultArrayName = 'transfer_weight'
charge_transfer_lens.Function = 'particle_weight - hole_weight'
RenameSource('Charge transfer lens', charge_transfer_lens)

# create a new 'Calculator'
local_excitation_lens = Calculator(Input=charge_transfer_lens)
local_excitation_lens.ResultArrayName = 'localization_weight'
local_excitation_lens.Function = 'if(hole_weight < particle_weight, hole_weight, particle_weight)'
RenameSource('Local excitation lens', local_excitation_lens)

# create a new 'Calculator'
donor_lens = Calculator(Input=local_excitation_lens)
donor_lens.ResultArrayName = 'donor_weight'
donor_lens.Function = 'if(transfer_weight < 0, transfer_weight, 0)'
RenameSource('Donor lens', donor_lens)

# create a new 'Calculator'
acceptor_lens = Calculator(Input=donor_lens)
acceptor_lens.ResultArrayName = 'acceptor_weight'
acceptor_lens.Function = 'if(transfer_weight > 0, transfer_weight, 0)'
RenameSource('Acceptor lens', acceptor_lens)

# create a new 'Calculator'
hole_CSP = Calculator(Input=acceptor_lens)
hole_CSP.ResultArrayName = 'hole_CSP_density'
hole_CSP.Function = 'Density * hole_weight'
RenameSource('Hole charge CSP', hole_CSP)

# create a new 'Calculator'
particle_CSP = Calculator(Input=hole_CSP)
particle_CSP.ResultArrayName = 'particle_CSP_density'
particle_CSP.Function = 'Density * particle_weight'
RenameSource('Particle charge CSP', particle_CSP)

# create a new 'Calculator'
charge_transfer_CSP = Calculator(Input=particle_CSP)
charge_transfer_CSP.ResultArrayName = 'charge_transfer_CSP_density'
charge_transfer_CSP.Function = 'Density * transfer_weight'
RenameSource('Charge transfer CSP', charge_transfer_CSP)

# create a new 'Calculator'
local_excitation_CSP = Calculator(Input=charge_transfer_CSP)
local_excitation_CSP.ResultArrayName = 'localization_CSP_density'
local_excitation_CSP.Function = 'Density * localization_weight'
RenameSource('Local excitation CSP', local_excitation_CSP)

# create a new 'Calculator'
donor_CSP = Calculator(Input=local_excitation_CSP)
donor_CSP.ResultArrayName = 'donor_CSP_density'
donor_CSP.Function = 'Density * donor_weight'
RenameSource('Donor CSP', donor_CSP)

# create a new 'Calculator'
acceptor_CSP = Calculator(Input=donor_CSP)
acceptor_CSP.ResultArrayName = 'acceptor_CSP_density'
acceptor_CSP.Function = 'Density * acceptor_weight'
RenameSource('Acceptor CSP', acceptor_CSP)

# find source
line1 = FindSource('Line1')

# set active source
SetActiveSource(line1)

# show data in view
line1Display = Show(line1, renderView1)

# trace defaults for the display properties.
line1Display.Representation = 'Surface'
line1Display.AmbientColor = [0.0, 0.0, 0.0]
line1Display.ColorArrayName = [None, '']
line1Display.OSPRayScaleArray = 'Texture Coordinates'
line1Display.OSPRayScaleFunction = 'PiecewiseFunction'
line1Display.SelectOrientationVectors = 'None'
line1Display.ScaleFactor = 0.1
line1Display.SelectScaleArray = 'None'
line1Display.GlyphType = 'Arrow'
line1Display.GlyphTableIndexArray = 'None'
line1Display.GaussianRadius = 0.005
line1Display.SetScaleArray = ['POINTS', 'Texture Coordinates']
line1Display.ScaleTransferFunction = 'PiecewiseFunction'
line1Display.OpacityArray = ['POINTS', 'Texture Coordinates']
line1Display.OpacityTransferFunction = 'PiecewiseFunction'
line1Display.DataAxesGrid = 'GridAxesRepresentation'
line1Display.SelectionCellLabelFontFile = ''
line1Display.SelectionPointLabelFontFile = ''
line1Display.PolarAxes = 'PolarAxesRepresentation'

# toggle 3D widget visibility (only when running from the GUI)
Hide3DWidgets(proxy=line1)

# find source
line2 = FindSource('Line2')

# set active source
SetActiveSource(line2)

# show data in view
line2Display = Show(line2, renderView1)

# trace defaults for the display properties.
line2Display.Representation = 'Surface'
line2Display.AmbientColor = [0.0, 0.0, 0.0]
line2Display.ColorArrayName = [None, '']
line2Display.OSPRayScaleArray = 'Texture Coordinates'
line2Display.OSPRayScaleFunction = 'PiecewiseFunction'
line2Display.SelectOrientationVectors = 'None'
line2Display.ScaleFactor = 0.1
line2Display.SelectScaleArray = 'None'
line2Display.GlyphType = 'Arrow'
line2Display.GlyphTableIndexArray = 'None'
line2Display.GaussianRadius = 0.005
line2Display.SetScaleArray = ['POINTS', 'Texture Coordinates']
line2Display.ScaleTransferFunction = 'PiecewiseFunction'
line2Display.OpacityArray = ['POINTS', 'Texture Coordinates']
line2Display.OpacityTransferFunction = 'PiecewiseFunction'
line2Display.DataAxesGrid = 'GridAxesRepresentation'
line2Display.SelectionCellLabelFontFile = ''
line2Display.SelectionPointLabelFontFile = ''
line2Display.PolarAxes = 'PolarAxesRepresentation'

# toggle 3D widget visibility (only when running from the GUI)
Hide3DWidgets(proxy=line2)

# find source
line3 = FindSource('Line3')

# set active source
SetActiveSource(line3)

# show data in view
line3Display = Show(line3, renderView1)

# trace defaults for the display properties.
line3Display.Representation = 'Surface'
line3Display.AmbientColor = [0.0, 0.0, 0.0]
line3Display.ColorArrayName = [None, '']
line3Display.OSPRayScaleArray = 'Texture Coordinates'
line3Display.OSPRayScaleFunction = 'PiecewiseFunction'
line3Display.SelectOrientationVectors = 'None'
line3Display.ScaleFactor = 0.1
line3Display.SelectScaleArray = 'None'
line3Display.GlyphType = 'Arrow'
line3Display.GlyphTableIndexArray = 'None'
line3Display.GaussianRadius = 0.005
line3Display.SetScaleArray = ['POINTS', 'Texture Coordinates']
line3Display.ScaleTransferFunction = 'PiecewiseFunction'
line3Display.OpacityArray = ['POINTS', 'Texture Coordinates']
line3Display.OpacityTransferFunction = 'PiecewiseFunction'
line3Display.DataAxesGrid = 'GridAxesRepresentation'
line3Display.SelectionCellLabelFontFile = ''
line3Display.SelectionPointLabelFontFile = ''
line3Display.PolarAxes = 'PolarAxesRepresentation'

# toggle 3D widget visibility (only when running from the GUI)
Hide3DWidgets(proxy=line3)

# find source
line4 = FindSource('Line4')

# set active source
SetActiveSource(line4)

# show data in view
line4Display = Show(line4, renderView1)

# trace defaults for the display properties.
line4Display.Representation = 'Surface'
line4Display.AmbientColor = [0.0, 0.0, 0.0]
line4Display.ColorArrayName = [None, '']
line4Display.OSPRayScaleArray = 'Texture Coordinates'
line4Display.OSPRayScaleFunction = 'PiecewiseFunction'
line4Display.SelectOrientationVectors = 'None'
line4Display.ScaleFactor = 0.1
line4Display.SelectScaleArray = 'None'
line4Display.GlyphType = 'Arrow'
line4Display.GlyphTableIndexArray = 'None'
line4Display.GaussianRadius = 0.005
line4Display.SetScaleArray = ['POINTS', 'Texture Coordinates']
line4Display.ScaleTransferFunction = 'PiecewiseFunction'
line4Display.OpacityArray = ['POINTS', 'Texture Coordinates']
line4Display.OpacityTransferFunction = 'PiecewiseFunction'
line4Display.DataAxesGrid = 'GridAxesRepresentation'
line4Display.SelectionCellLabelFontFile = ''
line4Display.SelectionPointLabelFontFile = ''
line4Display.PolarAxes = 'PolarAxesRepresentation'

# toggle 3D widget visibility (only when running from the GUI)
Hide3DWidgets(proxy=line4)

# set active source
SetActiveSource(acceptor_CSP)

# show data in view
acceptor_CSP_display = Show(acceptor_CSP, renderView1)

# get color transfer function/color map for 'acceptor_CSP_density'
acceptor_CSP_densityLUT = GetColorTransferFunction('acceptor_CSP_density')

# trace defaults for the display properties.
acceptor_CSP_display.Representation = 'Surface'
acceptor_CSP_display.AmbientColor = [0.0, 0.0, 0.0]
acceptor_CSP_display.ColorArrayName = ['POINTS', 'acceptor_CSP_density']
acceptor_CSP_display.LookupTable = acceptor_CSP_densityLUT
acceptor_CSP_display.OSPRayScaleArray = 'acceptor_CSP_density'
acceptor_CSP_display.OSPRayScaleFunction = 'PiecewiseFunction'
acceptor_CSP_display.SelectOrientationVectors = 'Density'
acceptor_CSP_display.ScaleFactor = 0.003999999910593033
acceptor_CSP_display.SelectScaleArray = 'acceptor_CSP_density'
acceptor_CSP_display.GlyphType = 'Arrow'
acceptor_CSP_display.GlyphTableIndexArray = 'acceptor_CSP_density'
acceptor_CSP_display.GaussianRadius = 0.00019999999552965166
acceptor_CSP_display.SetScaleArray = ['POINTS', 'acceptor_CSP_density']
acceptor_CSP_display.ScaleTransferFunction = 'PiecewiseFunction'
acceptor_CSP_display.OpacityArray = ['POINTS', 'acceptor_CSP_density']
acceptor_CSP_display.OpacityTransferFunction = 'PiecewiseFunction'
acceptor_CSP_display.DataAxesGrid = 'GridAxesRepresentation'
acceptor_CSP_display.SelectionCellLabelFontFile = ''
acceptor_CSP_display.SelectionPointLabelFontFile = ''
acceptor_CSP_display.PolarAxes = 'PolarAxesRepresentation'

# init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'
acceptor_CSP_display.ScaleTransferFunction.Points = [0.0, 0.0, 0.5, 0.0, 4.633428769073356, 1.0, 0.5, 0.0]

# init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'
acceptor_CSP_display.OpacityTransferFunction.Points = [0.0, 0.0, 0.5, 0.0, 4.633428769073356, 1.0, 0.5, 0.0]

# hide color bar/color legend
acceptor_CSP_display.SetScalarBarVisibility(renderView1, False)
ColorBy(acceptor_CSP_display, ('POINTS', 'charge_transfer_CSP_density'))

# get color transfer function/color map for 'transfer_weight'
transfer_weightLUT = GetColorTransferFunction('transfer_weight')
transfer_weightLUT.ApplyPreset('Cool to Warm (Extended)', True)
transfer_weightLUT.NumberOfTableValues = 32
transfer_weightLUT.RescaleTransferFunction(-0.0004, 0.0004)

acceptor_weightLUT = GetColorTransferFunction('acceptor_weight')
acceptor_weightLUT.ApplyPreset('Cool to Warm (Extended)', True)
acceptor_weightLUT.NumberOfTableValues = 32
acceptor_weightLUT.RescaleTransferFunction(-0.0004, 0.0004)

donor_weightLUT = GetColorTransferFunction('donor_weight')
donor_weightLUT.ApplyPreset('Cool to Warm (Extended)', True)
donor_weightLUT.NumberOfTableValues = 32
donor_weightLUT.RescaleTransferFunction(-0.0004, 0.0004)

hole_weightLUT = GetColorTransferFunction('hole_weight')
hole_weightLUT.ApplyPreset('X Ray', True)

particle_weightLUT = GetColorTransferFunction('particle_weight')
particle_weightLUT.ApplyPreset('X Ray', True)

localization_weightLUT = GetColorTransferFunction('localization_weight')
localization_weightLUT.ApplyPreset('X Ray', True)

charge_transfer_CSP_densityLUT = GetColorTransferFunction('charge_transfer_CSP_density')
charge_transfer_CSP_densityLUT.ApplyPreset('Cool to Warm (Extended)', True)
charge_transfer_CSP_densityLUT.RescaleTransferFunction(-5.82477, 5.82477)

donor_CSP_densityLUT = GetColorTransferFunction('donor_CSP_density')
donor_CSP_densityLUT.ApplyPreset('Cool to Warm (Extended)', True)
donor_CSP_densityLUT.RescaleTransferFunction(-5.82477, 5.82477)

acceptor_CSP_densityLUT = GetColorTransferFunction('acceptor_CSP_density')
acceptor_CSP_densityLUT.ApplyPreset('Cool to Warm (Extended)', True)
acceptor_CSP_densityLUT.RescaleTransferFunction(-5.82477, 5.82477)

particle_CSP_densityLUT = GetColorTransferFunction('particle_CSP_density')
particle_CSP_densityLUT.ApplyPreset('Warm to Cool (Extended)', True)
particle_CSP_densityLUT.RescaleTransferFunction(0, 4.6)

hole_CSP_densityLUT = GetColorTransferFunction('hole_CSP_density')
hole_CSP_densityLUT.ApplyPreset('Warm to Cool (Extended)', True)
hole_CSP_densityLUT.RescaleTransferFunction(0, 4.6)

localization_CSP_densityLUT = GetColorTransferFunction('localization_CSP_density')
localization_CSP_densityLUT.ApplyPreset('Warm to Cool (Extended)', True)
localization_CSP_densityLUT.RescaleTransferFunction(0, 4.6)

#### saving camera placements for all active views

# current camera placement for renderView1
renderView1.InteractionMode = '2D'
renderView1.CameraPosition = [9.569525718688965e-05, 0.0, -2.1819500030836276]
renderView1.CameraFocalPoint = [9.569525718688965e-05, 0.0, 0.0]
renderView1.CameraParallelScale = 0.02695210168388744

#### uncomment the following to render all views
# RenderAllViews()
# alternatively, if you want to write images, you can use SaveScreenshot(...).

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API