diff --git a/casa/limesolver.xml b/casa/limesolver.xml index 7d968a9..cb774b0 100644 --- a/casa/limesolver.xml +++ b/casa/limesolver.xml @@ -73,11 +73,9 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> 17 0 - - Input files with transition rates for radiating molecules - - - + + Input file with transition rates for the radiating molecule + Input file with dust opacity data diff --git a/casa/raytrace.xml b/casa/raytrace.xml index 9244c2f..9b36873 100644 --- a/casa/raytrace.xml +++ b/casa/raytrace.xml @@ -17,11 +17,9 @@ file:///opt/casa/code/xmlcasa/xml/casa.xsd"> Input FITS file - - Input files with transition rates for radiating molecules - - - + + Input file with transition rates for the radiating molecule + Input file containing paired wavelength/opacity values. diff --git a/casa/task_limesolver.py b/casa/task_limesolver.py index 84323cf..f87a3b7 100644 --- a/casa/task_limesolver.py +++ b/casa/task_limesolver.py @@ -63,7 +63,7 @@ def run(self): raysDoneMessageIsPrinted = False nItersCounted = 0 - fnDict = {'dust':dust,'gridInFile':gridInFile} + fnDict = {'dust':dust,'gridInFile':gridInFile,'moldatfile':moldatfile} for variableName in fnDict.keys(): fileName = fnDict[variableName] if not fileName is None and fileName!='': @@ -71,15 +71,7 @@ def run(self): casalog.post("Cannot find %s file %s" % (variableName, fileName), priority='ERROR') return - if not isinstance(moldatfile, list): - moldatfile = [moldatfile] - - for i in range(len(moldatfile)): - fileName = moldatfile[i] - if not fileName is None and fileName!='': - if not os.path.exists(fileName): - casalog.post("Cannot find moldatfile[%d] file %s" % (i, fileName), priority='ERROR') - return + moldatfile = [moldatfile] if (not userModelPath is None) and userModelPath!='': casalog.post("Supply of a user model is not yet supported.", priority='Warning') @@ -189,7 +181,13 @@ def run(self): numArgsRequired = len(argsRequired) reqArgsStr = '[%s]' % ','.join(argsRequired) - numArgsSupplied = len(funcDict[resultID]['args']) + try: + numArgsSupplied = len(funcDict[resultID]['args']) + except TypeError: # presumably because user has supplied a scalar for this value rather than a list. + if not(functionID=='scalarConst' or functionID=='vectorConstR'): + raise # we need a list. + funcDict[resultID]['args'] = [funcDict[resultID]['args']] + numArgsSupplied = len(funcDict[resultID]['args']) if numArgsSupplied!=numArgsRequired: errStr = 'Function %s requires %d arguments but you have supplied %d.' % (functionID, numArgsRequired, numArgsSupplied) diff --git a/casa/task_raytrace.py b/casa/task_raytrace.py index b7f2cd0..325d325 100644 --- a/casa/task_raytrace.py +++ b/casa/task_raytrace.py @@ -62,7 +62,7 @@ def run(self): raysDoneMessageIsPrinted = False nItersCounted = 0 - fnDict = {'dust':dust,'gridInFile':gridInFile} + fnDict = {'dust':dust,'gridInFile':gridInFile,'moldatfile':moldatfile} for variableName in fnDict.keys(): fileName = fnDict[variableName] if not fileName is None and fileName!='': @@ -70,15 +70,7 @@ def run(self): casalog.post("Cannot find %s file %s" % (variableName, fileName), priority='ERROR') return - if not isinstance(moldatfile, list): - moldatfile = [moldatfile] - - for i in range(len(moldatfile)): - fileName = moldatfile[i] - if not fileName is None and fileName!='': - if not os.path.exists(fileName): - casalog.post("Cannot find moldatfile[%d] file %s" % (i, fileName), priority='ERROR') - return + moldatfile = [moldatfile] #vvvvvvvvvvvvvvvvvvvv # Bodging up a dummy modellib setting, since Lime won't run without it. diff --git a/src/writefits.c b/src/writefits.c index d59b6f9..941df05 100644 --- a/src/writefits.c +++ b/src/writefits.c @@ -10,14 +10,14 @@ #include "lime.h" void -writeWCS(fitsfile *fptr, const int i, int axesOrder[4], double cdelt[4], double crpix[4], double crval[4], char ctype[4][9], char cunit[4][9]){ +writeWCS(fitsfile *fptr, const int i, int axesOrder[4], float cdelt[4], double crpix[4], double crval[4], char ctype[4][9], char cunit[4][9]){ char myStr[9]; int status = 0; sprintf(myStr, "CTYPE%d ", i+1); fits_write_key(fptr, TSTRING, myStr, &ctype[axesOrder[i]], "", &status); sprintf(myStr, "CDELT%d ", i+1); - fits_write_key(fptr, TDOUBLE, myStr, &cdelt[axesOrder[i]], "", &status); + fits_write_key(fptr, TFLOAT, myStr, &cdelt[axesOrder[i]], "", &status); sprintf(myStr, "CRPIX%d ", i+1); fits_write_key(fptr, TDOUBLE, myStr, &crpix[axesOrder[i]], "", &status); sprintf(myStr, "CRVAL%d ", i+1); @@ -35,7 +35,8 @@ Users have complained that downstream packages (produced by lazy coders >:8) wil double bscale,bzero,epoch,lonpole,equinox,restfreq; int axesOrder[] = {0,1,2,3}; char ctype[numAxes][9],cunit[numAxes][9]; - double cdelt[numAxes],crpix[numAxes],crval[numAxes]; + double crpix[numAxes],crval[numAxes]; + float cdelt[numAxes]; double ru3,scale=1.0; int velref,unitI,i; float *row; @@ -82,20 +83,20 @@ Users have complained that downstream packages (produced by lazy coders >:8) wil velref =257; sprintf(ctype[axesOrder[0]], "RA---SIN"); - cdelt[axesOrder[0]] = -1.8e2*img[im].imgres/M_PI; + cdelt[axesOrder[0]] = -1.8e2*(float)(img[im].imgres/M_PI); crpix[axesOrder[0]] = ((double)img[im].pxls)/2.0 + 0.5; crval[axesOrder[0]] = 0.0e0; sprintf(cunit[axesOrder[0]], "DEG "); sprintf(ctype[axesOrder[1]], "DEC--SIN"); - cdelt[axesOrder[1]] = 1.8e2*img[im].imgres/M_PI; + cdelt[axesOrder[1]] = 1.8e2*(float)(img[im].imgres/M_PI); crpix[axesOrder[1]] = ((double)img[im].pxls)/2.0 + 0.5; crval[axesOrder[1]] = 0.0e0; sprintf(cunit[axesOrder[1]], "DEG "); sprintf(ctype[axesOrder[2]], "VELO-LSR"); if(img[im].doline) - cdelt[axesOrder[2]] = img[im].velres; + cdelt[axesOrder[2]] = (float)img[im].velres; else cdelt[axesOrder[2]] = 1.0; crpix[axesOrder[2]] = (double) (naxes[axesOrder[2]]-1)/2.+1; @@ -105,7 +106,7 @@ Users have complained that downstream packages (produced by lazy coders >:8) wil sprintf(ctype[axesOrder[3]], "STOKES "); cdelt[axesOrder[3]] = 1.0; crpix[axesOrder[3]] = (double) (naxes[axesOrder[3]]-1)/2.+1; - crval[axesOrder[3]] = 0.0e0; + crval[axesOrder[3]] = 1.0e0; sprintf(cunit[axesOrder[3]], " "); bscale =1.0e0;