Coder Social home page Coder Social logo

pysynch's People

Contributors

mhardcastle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lophelia

pysynch's Issues

inconsistent zeta definitions in normalize?

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.

s.normalize hangs intermittently for batch runs

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.

To make it work with python3

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);
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.