Skip to content

make passive grid calls get_plasma_extrema for incorrect number of channels #290

Open

Description

@KlaraBogar

If you want to calculate passive signal of NPA or FIDA only, it callest get_plasma_extrema with r0_arr and v0_arr of size spec_chords%nchan+npa_chords%nchan. The positions corresponding to diagnostic, that you did not want to count are strange numbers (usually 0, but also nan), leading to code freezing.

Suggested solution:

call get_plasma_extrema with positions of considered diagnostics only:

!! Next consider passive diagnostic extrema relative to the plasma
if((inputs%calc_pfida.gt.0).and.(inputs%calc_pnpa.gt.0)) then
do i=1,(spec_chords%nchan)
r0_arr(:,i) = spec_chords%los(i)%lens_uvw
v0_arr(:,i) = spec_chords%los(i)%axis_uvw
enddo
do i=1, npa_chords%nchan
call xyz_to_uvw(npa_chords%det(i)%detector%origin, r0_arr(:,i+spec_chords%nchan))
xyz_axis = npa_chords%det(i)%detector%basis
v0_arr(:,i+spec_chords%nchan) = matmul(beam_grid%basis, xyz_axis(:,3))
enddo
call get_plasma_extrema(r0_arr,v0_arr,extrema,xarr_beam_grid,yarr_beam_grid)
else if(inputs%calc_pfida.gt.0) then
do i=1, spec_chords%nchan
r0_arr(:,i) = spec_chords%los(i)%lens_uvw
v0_arr(:,i) = spec_chords%los(i)%axis_uvw
enddo
call get_plasma_extrema(r0_arr(:,:spec_chords%nchan),v0_arr(:,:spec_chords%nchan),extrema,xarr_beam_grid,yarr_beam_grid)
else !pnpa>=1 case
do i=1, npa_chords%nchan
call xyz_to_uvw(npa_chords%det(i)%detector%origin, r0_arr(:,i))
xyz_axis = npa_chords%det(i)%detector%basis
v0_arr(:,i) = matmul(beam_grid%basis, xyz_axis(:,3))
enddo
call get_plasma_extrema(r0_arr(:,:npa_chords%nchan),v0_arr(:,:npa_chords%nchan),extrema,xarr_beam_grid,yarr_beam_grid)
endif

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions