| 354 | | if( nOption == 1 ) |
| 355 | | { |
| 356 | | /* this is the incident continuum, col 2 of punch continuum command */ |
| 357 | | cont = rfield.flux_total_incident; |
| 358 | | lgFREE = false; |
| 359 | | } |
| 360 | | else if( nOption == 2 ) |
| 361 | | { |
| 362 | | /* the attenuated transmitted continuum, no diffuse emission, |
| 363 | | * col 3 of punch continuum command */ |
| 364 | | cont = rfield.flux; |
| 365 | | lgFREE = false; |
| 366 | | } |
| 367 | | else if( nOption == 3 ) |
| 368 | | { |
| 369 | | /* reflected incident continuum, col 6 of punch continuum command */ |
| 370 | | lgFREE = false; |
| 371 | | cont = rfield.ConRefIncid; |
| 372 | | } |
| 373 | | else if( nOption == 4 ) |
| 374 | | { |
| 375 | | /* diffuse continuous emission outward direction */ |
| 376 | | cont = (realnum*)MALLOC( sizeof(realnum)*(size_t)rfield.nupper ); |
| 377 | | /* need to free the vector once done */ |
| 378 | | lgFREE = true; |
| 379 | | refac = (realnum)radius.r1r0sq*geometry.covgeo; |
| 380 | | for( j=0; j<rfield.nflux; ++j) |
| 381 | | { |
| 382 | | cont[j] = rfield.ConEmitOut[j]*refac; |
| 383 | | } |
| 384 | | } |
| 385 | | else if( nOption == 5 ) |
| 386 | | { |
| 387 | | /* reflected diffuse continuous emission */ |
| 388 | | cont = (realnum*)MALLOC( sizeof(realnum)*(size_t)rfield.nupper ); |
| 389 | | /* need to free the vector once done */ |
| 390 | | lgFREE = true; |
| 391 | | for( j=0; j<rfield.nflux; ++j) |
| 392 | | { |
| 393 | | cont[j] = rfield.ConEmitReflec[j]; |
| 394 | | } |
| 395 | | } |
| 396 | | else if( nOption == 6 ) |
| 397 | | { |
| 398 | | /* all outward lines, */ |
| 399 | | cont = (realnum*)MALLOC( sizeof(realnum)*(size_t)rfield.nupper ); |
| 400 | | /* need to free the vector once done */ |
| 401 | | lgFREE = true; |
| 402 | | /* correct back to inner radius */ |
| 403 | | refac = (realnum)radius.r1r0sq*geometry.covgeo; |
| 404 | | for( j=0; j<rfield.nflux; ++j) |
| 405 | | { |
| 406 | | cont[j] = rfield.outlin[j]*refac; |
| 407 | | } |
| 408 | | } |
| 409 | | else if( nOption == 7 ) |
| 410 | | { |
| 411 | | /* all reflected lines */ |
| 412 | | if( geometry.lgSphere ) |
| 413 | | { |
| 414 | | refac = 0.; |
| 415 | | } |
| 416 | | else |
| 417 | | { |
| 418 | | refac = 1.; |
| 419 | | } |
| 420 | | |
| 421 | | cont = (realnum*)MALLOC( sizeof(realnum)*(size_t)rfield.nupper ); |
| 422 | | /* need to free the vector once done */ |
| 423 | | lgFREE = true; |
| 424 | | for( j=0; j<rfield.nflux; ++j) |
| 425 | | { |
| 426 | | /* units of lines here are to cancel out with tricks applied to continuum cells |
| 427 | | * when finally extracted below */ |
| 428 | | cont[j] = rfield.reflin[j]*refac; |
| 429 | | } |
| 430 | | } |
| 431 | | else if( nOption == 8 ) |
| 432 | | { |
| 433 | | /* total transmitted continuum */ |
| 434 | | cont = (realnum*)MALLOC( sizeof(realnum)*(size_t)rfield.nupper ); |
| 435 | | /* need to free the vector once done */ |
| 436 | | lgFREE = true; |
| 437 | | /* correct back to inner radius */ |
| 438 | | refac = (realnum)radius.r1r0sq*geometry.covgeo; |
| 439 | | for( j=0; j<rfield.nflux; ++j) |
| 440 | | { |
| 441 | | /* units of lines here are to cancel out with tricks applied to continuum cells |
| 442 | | * when finally extracted below */ |
| 443 | | cont[j] = (rfield.ConEmitOut[j]+ rfield.outlin[j])*refac |
| 444 | | + rfield.flux[j]*(realnum)radius.r1r0sq; |
| 445 | | } |
| 446 | | } |
| 447 | | else if( nOption == 9 ) |
| 448 | | { |
| 449 | | /* total reflected continuum */ |
| 450 | | cont = (realnum*)MALLOC( sizeof(realnum)*(size_t)rfield.nupper ); |
| 451 | | /* need to free the vector once done */ |
| 452 | | lgFREE = true; |
| 453 | | for( j=0; j<rfield.nflux; ++j) |
| 454 | | { |
| 455 | | /* units of lines here are to cancel out with tricks applied to continuum cells |
| 456 | | * when finally extracted below */ |
| 457 | | cont[j] = ((rfield.ConRefIncid[j]+rfield.ConEmitReflec[j]) + |
| | 358 | for( long i = 0; i < nEnergy; i++ ) |
| | 359 | { |
| | 360 | long j = ipLoEnergy + i; |
| | 361 | |
| | 362 | if( j >= rfield.nflux ) |
| | 363 | { |
| | 364 | ReturnedSpectrum[i] = SMALLFLOAT; |
| | 365 | continue; |
| | 366 | } |
| | 367 | |
| | 368 | if( nOption == 1 ) |
| | 369 | { |
| | 370 | /* this is the incident continuum, col 2 of punch continuum command */ |
| | 371 | ReturnedSpectrum[i] = rfield.flux_total_incident[j]; |
| | 372 | } |
| | 373 | else if( nOption == 2 ) |
| | 374 | { |
| | 375 | /* the attenuated transmitted continuum, no diffuse emission, |
| | 376 | * col 3 of punch continuum command */ |
| | 377 | ReturnedSpectrum[i] = rfield.flux[j]; |
| | 378 | } |
| | 379 | else if( nOption == 3 ) |
| | 380 | { |
| | 381 | /* reflected incident continuum, col 6 of punch continuum command */ |
| | 382 | ReturnedSpectrum[i] = rfield.ConRefIncid[j]; |
| | 383 | } |
| | 384 | else if( nOption == 4 ) |
| | 385 | { |
| | 386 | /* correct back to inner radius */ |
| | 387 | refac = (realnum)radius.r1r0sq*geometry.covgeo; |
| | 388 | ReturnedSpectrum[i] = (rfield.outlin[j]+rfield.ConEmitOut[j])*refac; |
| | 389 | } |
| | 390 | else if( nOption == 5 ) |
| | 391 | { |
| | 392 | /* all reflected diffuse emission */ |
| | 393 | if( geometry.lgSphere ) |
| | 394 | { |
| | 395 | refac = 0.; |
| | 396 | } |
| | 397 | else |
| | 398 | { |
| | 399 | refac = 1.; |
| | 400 | } |
| | 401 | |
| | 402 | ReturnedSpectrum[i] = (rfield.reflin[j]+rfield.ConEmitReflec[j])*refac; |
| | 403 | } |
| | 404 | else if( nOption == 6 ) |
| | 405 | { |
| | 406 | /* correct back to inner radius */ |
| | 407 | refac = (realnum)radius.r1r0sq*geometry.covgeo; |
| | 408 | ReturnedSpectrum[i] = rfield.outlin[j]*refac; |
| | 409 | } |
| | 410 | else if( nOption == 7 ) |
| | 411 | { |
| | 412 | /* all reflected line emission */ |
| | 413 | if( geometry.lgSphere ) |
| | 414 | { |
| | 415 | refac = 0.; |
| | 416 | } |
| | 417 | else |
| | 418 | { |
| | 419 | refac = 1.; |
| | 420 | } |
| | 421 | |
| | 422 | ReturnedSpectrum[i] = rfield.reflin[j]*refac; |
| | 423 | } |
| | 424 | else if( nOption == 8 ) |
| | 425 | { |
| | 426 | /* total transmitted continuum */ |
| | 427 | /* correct back to inner radius */ |
| | 428 | refac = (realnum)radius.r1r0sq*geometry.covgeo; |
| | 429 | ReturnedSpectrum[i] = (rfield.ConEmitOut[j]+ rfield.outlin[j])*refac |
| | 430 | + rfield.flux[j]*(realnum)radius.r1r0sq; |
| | 431 | } |
| | 432 | else if( nOption == 9 ) |
| | 433 | { |
| | 434 | /* total reflected continuum */ |
| | 435 | ReturnedSpectrum[i] = ((rfield.ConRefIncid[j]+rfield.ConEmitReflec[j]) + |