; ============================================================================== ; filename_3b.pro ; ; Defines function filename_3b which constructs the CIPS Level 3B ; file name from the following arguments: ; ; hem hemisphere ('north' or 'south') string ; year year (e.g. 2009) integer or string ; version CIPS data version # (e.g., '05.20') string ; revision CIPS data revision # (e.g., '04') string ; ; Modifications/updates: ; ; < Sep 2019 Jerry D. Lumpe Initial Creation ; 16 Sep 2019 Paul E. Meade Cleaned Up, Added Comments ; 7 Nov 2019 Jerry D. Lumpe Added flag_preliminary input and logic ; 25 Feb 2020 Bill Barrett Minor changes ; ; ============================================================================== function filename_3b, hem, year, version, revision, flag_preliminary ; Generate the 'season' element of the file name from the hemisphere and year strings. ; Trim off the century from the four digit year if size(year, /type) eq 7 then y1 = string(year) $ else y1 = year y1=strmid(strtrim(y1,2),2,2) season=hem+'_'+y1 ; The southern hemisphere uses both the begin and end year if(hem eq 'south') then begin y2 = strtrim(string(fix(y1)+1),2) season=season + y2 endif ; Generate the 'version' and 'revision' elements of the file name: ; version should be something like '05.20' if(strlen(version) eq 4) then version='0'+version ; revision should be something like '01 if(strlen(revision) eq 1) then revision='0'+revision ; Concatenate the file name elements into the final file name: preliminary = flag_preliminary eq 1 ? '_prelim.preliminary' : '' file='cips_sci_3b_'+season+'_v'+version+'_r'+revision+ preliminary + '.mp4' return,file end