;+ ; NAME: ; qnagoya_pointsources ; PURPOSE: ; Read Nagoya IPS data and put them in user values of qnagoya widget ; CATEGORY: ; qnagoya widget ; CALLING SEQUENCE: pro qnagoya_pointsources, state ; INPUTS: ; state scalar; type: structure ; qnagoya state structure ; OUTPUTS: ; (to user values of widgets) ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; getnagoyasources, TimeSet, TimeGet, TimeUnit, qnagoya_skymap ; PROCEDURE: ; MODIFICATION HISTORY: ; JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- widget_control, state.wid_tbeg, get_value=tbeg widget_control, state.wid_tend, get_value=tend IF tbeg[0] NE '' AND tend[0] NE '' THEN trange = TimeSet([tbeg, tend]) widget_control, state.wid_info, get_uvalue=subdir IF getnagoyasources(trange, subdir=subdir, point_sources=point_sources, /degrees) NE 0 THEN BEGIN ; Set the begin and end time of the extracted IPS data IF tbeg[0] EQ '' OR tend[0] EQ '' THEN BEGIN widget_control, state.wid_tbeg, set_value=TimeGet(trange[0], upto=TimeUnit(/day), /ymd) widget_control, state.wid_tend, set_value=TimeGet(trange[1], upto=TimeUnit(/day), /ymd) ENDIF names = point_sources.name ; Source names for all data list = uniq(names, sort(names)) ; Index of list of unique names point = point_sources[list] ; Extract one data point for each unique source names = point.name ; Sorted list of unique names widget_control, state.wid_name, set_uvalue=names ; User value contains the names len = strcompress(strlen(names[0]), /rem) ; Name length (8 chars) count = -1 ; Find # data points for each source FOR i=0,n_elements(names)-1 DO BEGIN dummy = where(point_sources.name EQ names[i], tmp) count = [count, tmp] ENDFOR count = count[1:*] names = names+' ('+strcompress(count, /rem)+')' widget_control, state.wid_name, set_value=names ; Droplist names contain name + # data points ; Store the list of source names in the uvalue of state.wid_draw ; Store the data points in the user value of state.wid_exit widget_control, state.wid_draw, set_uvalue=point, /no_copy widget_control, state.wid_exit, set_uvalue=point_sources, /no_copy qnagoya_skymap, state ENDIF RETURN & END