Skip to content

Commit

Permalink
updates of the geometrical sampling routines
Browse files Browse the repository at this point in the history
  • Loading branch information
Gelu-Nita committed May 7, 2023
1 parent a6e101f commit 516a693
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion idl/gx_ebtel_valid_path.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function gx_ebtel_valid_path,path,has_ddm=has_ddm,quiet=quiet
goto,not_valid
CATCH, /CANCEL
ENDIF
restore,gx_findfile(path)
if file_exist(path) then restore, path else restore,gx_findfile(file_basename(path))
if ~isa(DEM_COR_RUN) or $
~isa(DEM_TR_RUN) or $
~isa(LOGTDEM) or $
Expand Down
10 changes: 5 additions & 5 deletions idl/gxmodel__define.pro
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ pro gxModel::Slice,parms,row,scanner=scanner
missing=0
(self->GetVolume())->GetVertexAttributeData,'voxel_id',id
if n_elements(id) gt 0 then begin
var=interpolate(id,fix(vol_ind[*,0]),fix(vol_ind[*,1]),fix(vol_ind[*,2]),missing=missing)
var=interpolate(id,round(vol_ind[*,0]),round(vol_ind[*,1]),round(vol_ind[*,2]),missing=missing)
idx=gx_name2idx(parms,'VoxelID')
if (size(idx))[0] ne 0 then begin
(*scanner).parms[*,*,idx]=var
Expand Down Expand Up @@ -1089,7 +1089,7 @@ pro gxModel::Slice,parms,row,scanner=scanner
idx=gx_name2idx(parms,'h')
if (size(idx))[0] ne 0 then begin
vol=(self->R(/volume)-1)*gx_rsun(unit='km')
(*scanner).parms[*,*,idx]=interpolate(vol,fix(vol_ind[*,0]),fix(vol_ind[*,1]),fix(vol_ind[*,2]),missing=missing)
(*scanner).parms[*,*,idx]=interpolate(vol,round(vol_ind[*,0]),round(vol_ind[*,1]),round(vol_ind[*,2]),missing=missing)
assigned[idx]=1
end

Expand Down Expand Up @@ -1159,7 +1159,7 @@ pro gxModel::Slice,parms,row,scanner=scanner
if (size(idx))[0] ne 0 then begin
vol=self->Box2Volume('bmed',/corona)
if isa(vol)then begin
(*scanner).parms[*,*,idx]=interpolate(vol,fix(vol_ind[*,0]),fix(vol_ind[*,1]),fix(vol_ind[*,2]),missing=missing)
(*scanner).parms[*,*,idx]=interpolate(vol,round(vol_ind[*,0]),round(vol_ind[*,1]),round(vol_ind[*,2]),missing=missing)
assigned[idx]=1
end
end
Expand All @@ -1170,7 +1170,7 @@ pro gxModel::Slice,parms,row,scanner=scanner
vol=self->Box2Volume('length',/corona)
if isa(vol)then begin
vol=gx_rsun()*vol/2
(*scanner).parms[*,*,idx]=interpolate(vol,fix(vol_ind[*,0]),fix(vol_ind[*,1]),fix(vol_ind[*,2]),missing=missing)
(*scanner).parms[*,*,idx]=interpolate(vol,round(vol_ind[*,0]),round(vol_ind[*,1]),round(vol_ind[*,2]),missing=missing)
assigned[idx]=1
end
end
Expand Down Expand Up @@ -1346,7 +1346,7 @@ pro gxModel::Slice,parms,row,scanner=scanner
end
if (idx_parms[k] eq 'SpineS') or (idx_parms[k] eq 'HasArr') or $
(idx_parms[k] eq 'SpineR') or (idx_parms[k] eq 'dummy_n_b')then begin
(*scanner).parms[*,*,idx]+=interpolate(vol[box2vol],fix(vol_ind[*,0]),fix(vol_ind[*,1]),fix(vol_ind[*,2]),missing=missing)
(*scanner).parms[*,*,idx]+=interpolate(vol[box2vol],round(vol_ind[*,0]),round(vol_ind[*,1]),round(vol_ind[*,2]),missing=missing)
endif else (*scanner).parms[*,*,idx]+=interpolate(vol[box2vol],vol_ind[*,0],vol_ind[*,1],vol_ind[*,2],missing=missing)
endif
end
Expand Down
4 changes: 2 additions & 2 deletions userslib/aia/AIA.pro
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pro aia,parms,rowdata,nparms,rparms,path=path,logtdem=logtdem,dem_run=dem_run,qr
rowparms=transpose(parms[pix,*,*])
cutoff=max(where(rowparms[nhi_idx,*] ge n_hi0))
if cutoff ge 0 then rowparms[nhi_idx,0:cutoff]=n_hi0
tr_idx=max(where((ulong(rowparms[v_idx,*]) and gx_voxelid(/euv)) ne 0 and rowparms[t0_idx,*] ne 0))
tr_idx=max(where((ulong(rowparms[v_idx,*]) and gx_voxelid(/euv)) ne 0))
point_in=where((rowparms[t0_idx,*] gt 0 and rowparms[v_idx,*] gt 1 and rowparms[nhi_idx,*] lt n_hi0), Nvox)
if Nvox gt 0 then begin
parmin=rowparms[*,point_in]
Expand All @@ -95,7 +95,7 @@ pro aia,parms,rowdata,nparms,rparms,path=path,logtdem=logtdem,dem_run=dem_run,qr
dem_interpolate,n,t,dem,path=path,logtdem=logtdem,dem_run=dem_run,qrun=qrun,lrun=lrun,qarr=parmin[q_idx,*],larr=parmin[l_idx,*],avgdem=avgdem
tr_factor=1
if AddTR eq 1 then begin
tr_idx=max(where((ulong(parmin[v_idx,*]) and gx_voxelid(/euv)) ne 0 and parmin[t0_idx,*] ne 0))
tr_idx=max(where((ulong(parmin[v_idx,*]) and gx_voxelid(/euv)) ne 0))
if tr_idx ge 0 then begin
point_in=where((parmin[t0_idx,*] gt 0 and parmin[nhi_idx,*] lt n_hi0))
dem_interpolate,n_tr,t_tr,dem_tr,path=path,logtdem=logtdem,dem_run=dem_tr_run,lrun=lrun,qrun=qrun,$
Expand Down
2 changes: 1 addition & 1 deletion userslib/sampling/blos_layers.pro
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pro blos_layers,parms,rowdata,info=info
rparms=transpose(parms[pix,*,*])
z=float(reform(rparms[12,*]))
for chanid =0, nchan-1 do begin
idx=max(where(fix(z) eq chanid,count))
idx=max(where(round(z) eq chanid,count))
if count gt 0 then begin
rowdata[pix,chanid,0]=rparms[2,idx]
rowdata[pix,chanid,1]=rparms[2,idx]*cos(rparms[3,idx]*!dtor)
Expand Down
3 changes: 1 addition & 2 deletions userslib/sampling/blos_tr.pro
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ pro blos_tr,parms,rowdata,info=info
rowdata[*]=0
for pix=0, Npix-1 do begin
rparms=transpose(parms[pix,*,*])
z=float(reform(rparms[8,*]))
idx=max(where(((ulong(rparms[5,*]) and 2l) eq 2l) and (z ge 0),count))
idx=max(where(((ulong(rparms[5,*]) and gx_voxelid(/tr)) eq gx_voxelid(/tr)),count))
if count gt 0 then begin
rowdata[pix,0,0]=rparms[2,idx]
rowdata[pix,0,1]=rparms[2,idx]*cos(rparms[3,idx]*!dtor)
Expand Down

0 comments on commit 516a693

Please sign in to comment.