Menu

#49 !g. additions

open
Other (21)
5
2005-06-10
2005-06-10
Tom Bania
No

Colleagues

I continue to methodically migrate my package into GBTIDL.
I have defined the global structure !he3. below in
order to do so.
Of course, I could just invoke this ideosyncratically
as now I do,
but I feel strongly that these globals are of great
utility to anyone
who wants to deal with large data sets.

So, I would ask that the team consider adding these
items to !g.
The first bunch are all the current things that can be
SELECTed
upon. The last have to do with dataio management
within user
written procedures.

Note, too, that I have written some CLASS look alike
functions:
'fi', 'fo', 'gf', 'gn','find' that use/set these
globals... More on this
anon.

;
; Procedure to create IDL He3 structure for SELECT
;
pro he3_struct
;
on_error,2
;
he3 = { he3_struct, $ ;
source:string(replicate(32B,16)), $
projid:string(replicate(32B,32)), $
backend:string(replicate(32B,32)), $
observer:string(replicate(32B,32)), $
bandwidth:0.0D, $
telescope:string(replicate(32B,16)), $ ;
telescop in sdfits
polarization:string(replicate(32B,2)), $ ;
crval4 in sdfits
polarization_num:0L, $
scan_number:0L, $ ; scan in sdfits
procedure:string(replicate(32B,16)), $ ;
obsmodes[0] in sdfits
switch_state:string(replicate(32B,16)), $ ;
obsmodes[1] in sdfits
switch_sig:string(replicate(32B,16)), $ ;
obsmodes[2] in sdfits
obsid:string(replicate(32B,32)), $
frontend:string(replicate(32B,16)), $
sampler_name:string(replicate(32B,16)), $ ;
sampler in sdfits
feed:0L, $ ; feed in sdfits
srfeed:0L, $ ; srfeed in sdfits
feed_num:0L, $
if_number:0L, $ ; from index file
;
;
;
lastrec:0L , $ ; last record# read from
'filein'
recmin:0L, $ ; first rec# for search range
recmax:0L, $ ; last rec# for search range
lastscan:0L, $ ; last scan# gotten from
'filein'
scanmin:0L, $ ; first scan# for search range
scanmax:0L, $ ; last scan# for search range
input_file_name:string(replicate(32B,80)), $
nrecs_in_filein:0L, $ ; total number of records
in filein
output_file_name:string(replicate(32B,80)), $
nrecs_in_fileout:0L $ ; total number of records
in fileout
}
;
defsysv,'!he3',{he3_struct}
;
print,'!he3 structure created'
;
return
end

Discussion

  • Bob Garwood

    Bob Garwood - 2005-06-10

    Logged In: YES
    user_id=978628

    Hi Tom,
    On the selection issue, we're currently planning on
    implementing a FIND (modelled on CLASS FIND) which would be
    built on top of SELECT using fields in !g. We already have
    pointers in !g to hold the things that FIND would use. We
    would need to also provide setsource, setscan, etc, to set
    the search parameters for each selectable thing. FIND would
    then use any previous set things plus any additional
    refinements the user might provide. As things stand now,
    this is unlikely to be ready by v1.1, but it should be ready
    sometime shortly after that.

    On the second set:

    !g.line_filein_name
    !g.line_fileout_name

    Already exist and

    nrecords([/keep])

    is an existing function, so I don't see the need for your
    input_file_name, output_file_name, nrecs_in_filein,
    nrecs_in_fileout

    I do, though, see the utility of lastrec and lastscan.

    Did I miss anything in responding to this?

    -Bob

     
  • Bob Garwood

    Bob Garwood - 2005-06-10
    • labels: --> Other
    • assigned_to: nobody --> bgarwood
     
  • Tom Bania

    Tom Bania - 2005-06-10

    Logged In: YES
    user_id=1286618

    we are working in parallel. sigh.

    when is v1.1 due out?

    i take all your points above. missed them. hard to code
    when one is only
    doing it sporadically. and, i am still catching up on
    exactly what you folks
    have done....

    my only thought as to why the file sizes should be in !g. is
    that you then
    don't have to constantly invoke nrecords(). sooner or later
    this sort of
    recomputing everything slows throughput. i have written a
    wrapper around
    'filein', the CLASS-like 'fi' command which stuffs this file
    size into the
    !he3.file_size elements.....

    insofar as some of the CLASS like stuff is concerned,
    perhaps you might
    consider adopting/modifying what i have done. perhaps not.
    here is an
    example:

    ;+
    ;
    ; setpol.pro Sets polarization for a SELECT search via
    FIND procedure
    ; ---------- if pol value not passed, prompts for string
    ; Syntax:: setpol,"LL" <-- must pass a
    string "*" is wildcard
    ; RR
    ;
    ; T.M. Bania June 2005
    ;-
    pro setpol,pol,ask=ask,noinfo=noinfo
    ;
    on_error,2
    compile_opt idl2
    ;
    if (n_elements(ask) eq 1) then goto, query
    ;
    if (n_params() eq 0) then begin
    print,'Set the Polarization for data
    filtering searches:'
    print,'Syntax: setpol,"LL" <-- must pass a
    string "*" is wildcard'
    print,' setpol,/ask <-- prompts for
    input
    print,' setpol,/noinfo <-- suppress output
    return
    endif
    ;
    goto, out
    ;
    query: begin
    pol=''
    print,'Polarization ID= no quotes needed; <CR> means
    wildcard'
    read,pol,prompt='Input Polarization: '
    end
    ;
    out:
    ;
    spol=strtrim(pol,2)
    if ( (spol eq "") or (spol eq " ") ) then spol='*'
    ;
    !he3.polarization=spol
    ;
    if (n_elements(noinfo) ne 1) then print,'Polarization for
    searches is: ' + !he3.polarization
    ;
    return
    end

    if you are interested, i have already written in this style:

    set <- prompts for stuff invoking .pro's below
    setsrc
    setid
    setpol
    setrange <- sets a scan range
    setrec <- sets a record range

     

Log in to post a comment.