Select Git revision
FunctionalTestsCsminit.cpp
-
Jesse Mapel authored
* Updated to new blob structure * Clean up after being able to look at all of the changes at once * Changed the history read to return a history object rather than a pointer * Addressed PR feedback * Imagepolygon Update (#4308) * Converted Imagepolygon to no longer be a subclass of blob * Updated Imagepolygon with constructor chaining * Fixed error message * Refactor OriginalLabel class to remove inheritance from Blob (#4309) * Initial refactor of OriginalLabel class * Addressed PR feedback * Fixed error message Co-authored-by:
Jesse Mapel <jmapel@usgs.gov> * Modified Table to not inherit from Blob anymore (#4312) * Ported Table test to gtest * Table refactor * Fixed merge issue * Fixed merge issues * Removes blob inheritance from OriginalXmlLabel (#4316) * Initial refactor of OriginalLabel class * Addressed PR feedback * Fixed error message * Remove blob inheritance from originalxmllabel * Removed commented / old code * Added byte order specification * History object tests (#4314) * Adds History object tests * Updated blob tests to use a non-pointer variable * Removed gisblob from isis (#4329) * Removed blob inheritance from stretchblob (#4331) * Removed blob inheritance from stretchblob * Addressed feedback + working read/write * Updated cubestretch with the stretch blob functionality * Removed stretchBlob and updated cubestretch/cube with read write functionality * Replaced readStretchBlob with readCubeStretch * Fixed segfault * Removed debug print statements * Added check for existence of OriginalLabel before attempting to propagate * Addressed PR feedback Co-authored-by:
Adam Paquette <acpaquette@usgs.gov> * Removed StringBlob Class (#4321) * Converted StringBlob * Removed StretchBlob class * Changed Blob setData to copy * Added csminit change and docs * Removed old memcopy * History Blob Old Implementation (#4342) * Implemented old history functionality * Removed old history unit test * Fixed original label reading * Fixed Blob branch test failures (#4344) * Fixed test failures * More clean-up * Fixed marci2isis test * Blob final clean-up (#4346) * Redid Blob writing * Added docs * Review feedback * Fixed int comparison Co-authored-by:
Adam Paquette <acpaquette@usgs.gov> Co-authored-by:
AustinSanders <arsanders@usgs.gov>
Jesse Mapel authored* Updated to new blob structure * Clean up after being able to look at all of the changes at once * Changed the history read to return a history object rather than a pointer * Addressed PR feedback * Imagepolygon Update (#4308) * Converted Imagepolygon to no longer be a subclass of blob * Updated Imagepolygon with constructor chaining * Fixed error message * Refactor OriginalLabel class to remove inheritance from Blob (#4309) * Initial refactor of OriginalLabel class * Addressed PR feedback * Fixed error message Co-authored-by:
Jesse Mapel <jmapel@usgs.gov> * Modified Table to not inherit from Blob anymore (#4312) * Ported Table test to gtest * Table refactor * Fixed merge issue * Fixed merge issues * Removes blob inheritance from OriginalXmlLabel (#4316) * Initial refactor of OriginalLabel class * Addressed PR feedback * Fixed error message * Remove blob inheritance from originalxmllabel * Removed commented / old code * Added byte order specification * History object tests (#4314) * Adds History object tests * Updated blob tests to use a non-pointer variable * Removed gisblob from isis (#4329) * Removed blob inheritance from stretchblob (#4331) * Removed blob inheritance from stretchblob * Addressed feedback + working read/write * Updated cubestretch with the stretch blob functionality * Removed stretchBlob and updated cubestretch/cube with read write functionality * Replaced readStretchBlob with readCubeStretch * Fixed segfault * Removed debug print statements * Added check for existence of OriginalLabel before attempting to propagate * Addressed PR feedback Co-authored-by:
Adam Paquette <acpaquette@usgs.gov> * Removed StringBlob Class (#4321) * Converted StringBlob * Removed StretchBlob class * Changed Blob setData to copy * Added csminit change and docs * Removed old memcopy * History Blob Old Implementation (#4342) * Implemented old history functionality * Removed old history unit test * Fixed original label reading * Fixed Blob branch test failures (#4344) * Fixed test failures * More clean-up * Fixed marci2isis test * Blob final clean-up (#4346) * Redid Blob writing * Added docs * Review feedback * Fixed int comparison Co-authored-by:
Adam Paquette <acpaquette@usgs.gov> Co-authored-by:
AustinSanders <arsanders@usgs.gov>
make_header_polar.py 1.87 KiB
#!/usr/bin/env python3
import math
import numpy as np
import sys
import os
#==============================================================
if len(sys.argv) < 4:
print("\nScript to create the polarization_structure.h of the MC ray-tracing code")
print("Synopsis: make_header_polar.py emin=emin emax=emax nbin=nbin\n")
os.sys.exit()
for inputval in sys.argv:
if inputval.startswith('emin') == True:
emin = float(inputval[inputval.rfind('=') + 1:])
if inputval.startswith('emax') == True:
emax = float(inputval[inputval.rfind('=') + 1:])
if inputval.startswith('nbin') == True:
nbin = int(inputval[inputval.rfind('=') + 1:])
#==============================================================
array_energy=np.zeros(nbin)
ymin = math.log(emin / 511.)
ymax = math.log(emax / 511.)
hy = (ymax - ymin) / (nbin - 1)
y = ymin
c_array="static const double ene_bound[POLAR_NBOUNDS]={"
for ii in range(nbin):
energy=math.exp(y)
array_energy[ii]=energy*511
if ii == nbin-1:
final_string="};"
else:
final_string=", "
c_array=c_array+str(round(array_energy[ii],3))+final_string
y = y + hy
#===========================================================
output="polarization_structure.h"
f = open(output, "w")
f.write("#ifndef POLARIZATION_STRUCTURE_H_ \n")
f.write("#define POLARIZATION_STRUCTURE_H_ \n\n")
f.write("#include <functions.h>\n\n")
f.write("#define POLAR_NBOUNDS %d\n\n" % (nbin))
f.write(c_array)
f.write("\n\n\n\n")
f.write("typedef struct {\n\n")
f.write("double* array_Is;\n")
f.write("double* array_Qs;\n")
f.write("double* array_Us;\n")
f.write("double* polar_degree;\n")
f.write("double* csi_angle;\n")
f.write("uint32_t *counter;\n\n")
f.write("} stokes_parameters;\n\n\n")
f.write("#endif\n")
f.close()
#===========================================================
print('Written file', output)