- This topic has 4개 답변, 3명 참여, and was last updated 6 years 전에 by tlseorb0111.
-
글쓴이글
-
-
HPkim회원
데이터파일과 코드입니다.
https://drive.google.com/open?id=1rJjiCfLgRfczsjD9ssBk1SrJPtLkyk0Zfile=file_search(‘\data\s*.cdf’)
time=timegen(start=julday(6,25,2015,19,0,0),final=julday(6,26,2015,00,59,44), step_size=15, units=’second’)
DB=[]FOR i=0, N_ELEMENTS(file)-1 DO BEGIN
id=CDF_OPEN(file[i])
cdf_control,id,variable=’time_db_dt’, get_var_info=info
cdf_control,id,variable=’db_dt’, get_var_info=info1
cdf_control,id,variable=’epoch_db_dt’, get_var_info=info2
cdf_control,id,variable=’frequency’, get_var_info=info3
cdf_control,id,variable=’sensitivity’, get_var_info=info4cdf_varget, id,’time_db_dt’,time_db_dt,rec_count=info.maxrec
cdf_varget, id,’db_dt’,db_dt,rec_count=info1.maxrec
cdf_varget,id,’epoch_db_dt’, epoch_db_dt, rec_count=info2.maxrec
cdf_varget, id,’frequency’,frequency,rec_count=info3.maxrec
cdf_varget, id,’sensitivity’,sensitivity,rec_count=info4.maxreccdf_epoch, epoch_db_dt, yr, mo, dy, hr, mn, sc, milli, /break
DB=[[DB],[db_dt]]
ENDFOR
n=N_ELEMENTS(DB[0,*])
w=1024
dt=0.015625
Fs=1/dt
ut_step_size=15.
freq= findgen(w)
freq= freq*Fs/w
help, freq
freq=freq[0:511]
Fx=complexarr(w, n/(ut_step_size*Fs))
Fy=complexarr(w, n/(ut_step_size*Fs))
Fz=complexarr(w, n/(ut_step_size*Fs))
help, fx
FOR i=0.,n/(ut_step_size*Fs)-1. DO BEGINFx[*,i]=fft(DB[0,i*ut_step_size*Fs:(i*ut_step_size*Fs)+w-1])
Fy[*,i]=fft(DB[1,i*ut_step_size*Fs:(i*ut_step_size*Fs)+w-1])
Fz[*,i]=fft(DB[2,i*ut_step_size*Fs:(i*ut_step_size*Fs)+w-1])ENDFOR
Fx=rotate(Fx,3)
Fy=rotate(Fy,3)
Fz=rotate(Fz,3)Fx=bytscl(alog10(abs(Fx)^2/0.0625),-13,-4)
Fy=bytscl(alog10(abs(Fy)^2/0.0625),-8,-4)
Fz=bytscl(alog10(abs(Fz)^2/0.0625),-8,-4)help, fx
Fx=Fx[*,0:511]
Fy=Fy[*,0:511]
Fz=Fz[*,0:511]WIN=window(DIM=[1000,500])
DUM=label_date(date_format=’%H:%I!C%D %M’)
ct=colortable(33)
c=image(Fx, time, freq, xtickformat=’label_date’, ytitle=’Freqyency[Hz]’, aspect_ratio=0.002, RGB_TABLE=ct, AXIS_STYLE=2, XMAJOR=7,/current)
cp=c.position
cb=COLORBAR(TARGET=c,TITLE=’log(nT!u2!n/Hz!u2!n)’, position=[cp[2]+0.01,cp[1],cp[2]+0.03,cp[3]],MAJOR=3,orientation=1,TEXTPOS=1,TICKNAME=[‘-13′,’ ‘,’-3′])END
-
mwkim회원
안녕하세요, 올려주신 내용은 봤을 때, 축을 로그스케일로 바꿔서 그리고자 하시는 것 같습니다.
IMAGE 함수 사용 시, 사용하신 것처럼 x, y 좌표를 입력할 수 있기 때문에
로그스케일로 표기하고자 하는 축에 좌표의 로그 값을 넣어주면 될 것 같습니다.
대신 축 서식을 로그 스케일에 맞게 설정해야합니다.
(IMAGE 함수의 [XYZ]LOG 옵션 조정, 도움말 참조)아래 예제를 해보시면 이해하실 수 있을 것 같습니다.
================================
data = HANNING(100,100) + RANDOMN(seed,100,100) * 0.2
x = FINDGEN(100) + 1
y = FINDGEN(100) + 1 ; 로그스케일로 변환할 걸 고려해서 1을 더했습니다.img = IMAGE(data,x,y,MARGIN=0.05,RGB_TABLE=13,AXIS_STYLE=2) ; 원 자료 표출
imgLog = IMAGE(data,x,ALOG10(y),MARGIN=0.05,RGB_TABLE=13,AXIS_STYLE=2,ASPECT_RATIO=0,YLOG=1) ; 로그스케일 표출================================
-
HPkim회원
로스스케일로 다 변환은 했지만, error가 뜹니다..
% QHULL:
qhull precision error: 101 attempts to construct a convex hull
with joggled input. Increase joggle above ‘QJ0.028’
or modify qh_JOGGLE… parameters in user.h
-
-
안녕하세요.
아래 코드 참고하시면 도움이 될 듯 합니다.1234567891011121314151617;; frequency 가 0 인곳 삭제fx = fx[*, 1:*]freq = freq[1:*]dim = fx.dim;; log space 에서 균일한 간격을 같는 frequency 생성log_y = alog10(freq)new_y = findgen(dim[1]) / (dim[1]-1) * (log_y[-1] - log_y[0]) + log_y[0];; 새로 만들어진 log(frequency) 축에 맞게 fx를 interpolateyidx = interpol(findgen(dim[1]), log_y, new_y)new_data = interpolate(fx, findgen(dim[0]), yidx, /grid)i = image(new_data, time, new_y, rgb_table=33, axis_style=2, aspect_ratio=0, pos=[0.1,0.1,0.9,0.9], /ylog)만일 fx를 interpolation할 때 linear 가 아닌 spline 과 같은 interpolation 방법이 필요하다면 interpolate 함수 대신 interpol 함수를 적용하시면 될 것 입니다.
- 이 답변은 tlseorb0111에 의해 6 years 전에 수정됐습니다.
-
글쓴이글