function tsy_valid_coords, dlimits, geopack_2008 = geopack_2008
if ~is_struct(dlimits) then begin
message, /continue, 'dlimits structure not set, make sure input variables are in gsm coordinates or results will be invalid'
return, -1
endif else begin
str_element, dlimits, 'data_att', success = s
if s eq 0 then begin
message, /continue, 'dlimits.data_att structure not set, make sure input variables are in gsm coordinates or results will be invalid'
return, -1
endif else begin
str_element, dlimits.data_att, 'coord_sys', success = s
if s eq 0 then begin
message, /continue, 'dlimits.data_att.coord_sys value not set, make sure input variables are in gsm coordinates or results will be invalid'
return, -1
endif else if strlowcase(dlimits.data_att.coord_sys) ne 'gsm' then begin
message, /continue, 'input variable is in the wrong coordinate system, returning'
return, -1
endif
endelse
endelse
return, 1
end