mhardcastle / pysynch Goto Github PK
View Code? Open in Web Editor NEWPython interface to synchrotron libraries
License: GNU General Public License v3.0
Python interface to synchrotron libraries
License: GNU General Public License v3.0
Unless I'm missing something the zeta parameter to account for non-radiating particles is defined differently for the 'equipartition' and 'minimum_energy' methods in synchro.py . For the former it seems to be defined as 1/k where k is the ratio of energy density in radiating particles to the total energy in particles, while for the latter zeta=k. It would be helpful if this was consistent and also if zeta defined in the documentation.
I'm trying to measure batch properties (B, Pint) for samples of 100s to 1000s of objects in a loop that calls SynchSource and then normalises it to set the properties. This is running successfully for large numbers of sources and then hanging in a non-reproducible way on the s.normalize step -- repeated runs have it stopping at a different source, and whichever source it stops at I can successfully run individually by hand with the same parameters.
The code I'm running is /beegfs/lofar/jcroston/surveys/hizfeedback/runsynch.py and called as follows:
% python3 runsynch.py unresolved24_withenvsx_kcorr.fits test_out.fits
On my last two runs it hung at source 290 and 1443 respectively - this seems very random - but is not just an issue flushing the diagnostic output as I've left it overnight to see if it wakes up and it remains stuck.
It seems to work OK when updating "synchmodule.c" so that it looks like this:
//(void)Py_InitModule("synch", SynchMethods);
static struct PyModuleDef synch =
{
PyModuleDef_HEAD_INIT,
"synch", /* name of module /
"", / module documentation, may be NULL /
-1, / size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */
SynchMethods
};
PyMODINIT_FUNC PyInit_synch(void)
{
// do some initialization
w1=gsl_integration_workspace_alloc(GSL_WSIZE);
w2=gsl_integration_workspace_alloc(GSL_WSIZE);
gsl_set_error_handler_off(); // to avoid abort
gsl_epsilon=1e-3;
gsl_quiet=1;
fx=calloc(xls,sizeof(double));
#ifdef DEBUG
printf("running makefx\n");
#endif
makefx();
// these numeric parameters and the spectral function to be used are
// changeable by the user: set some defaults
gmin=10;
gmax=100000;
set_minmax_globals();
power=2.2;
set_simple_powerlaw();
return PyModule_Create(&synch);
};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.