;+ ; NAME: ; forecast_movie ; PURPOSE: ; Updates movies for IPS forecast web site ; CATEGORY: ; WWW ; CALLING SEQUENCE: PRO forecast_movie, hdr, ff, $ filter = filter , $ ftp = ftp , $ magnetic = magnetic , $ synoptic = synoptic , $ skymap = skymap , $ skysweep = skysweep , $ insitu = insitu , $ remote = remote , $ solardisk = solardisk , $ planarcut = planarcut , $ fast = fast , $ silent = silent , $ png = png , $ gif = gif , $ ut = ut , $ nv_filter = nv_filter , $ planets = planets , $ env_filter = env_filter ; INPUTS: ; (none) ; OUTPUTS: ; (none) ; OPTIONAL INPUTS: ; /magnetic if set, make movies from magnetic field data (wson files) ; (default is to use 'nv3d' files ; /fast use time-dependent tomography files from ; $NAGOYA/fast (default: corotating tomography files ; from $NAGOYA/slow ; filter=filter explicitly sets the file name filter (overriding the defaults ; 'nv3d' or 'wson' ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; TimeGet, TimeSet, TimeUnit, TimeSystem, forecast_ftp, vu_movie ; InitVar, forecast_cfg, TimeOp, jpl_body, vu_prefix ; RESTRICTIONS: ; Can onLy be run on Linux ; idl_startup.pro needs to be run. This requires that the environment ; variable IDL_STARTUP is set. ; PROCEDURE: ; This is run as part of the cron job sync_daily_ips after new ; final (averaged) tomography files have been created. ; ; MODIFICATION HISTORY: ; APR-2000, Paul Hick (UCSD/CASS) ; SEP-2002, Paul Hick (UCSD/CASS) ; Adapted to accept magnetic field 'bb3d' files ; Added /forcecd keyword to the vu_movie calls that read files (to be passed ; down to vu_select and eventually FindAllFiles). ; JUN-2003, Paul Hick (UCSD/CASS) ; bb3d files are now called wson files ; JUL-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; Adapted to make movies of remoteviews with hcs embedded ;- InitVar, fast , /key InitVar, ftp , /key InitVar, synoptic , /key InitVar, skymap , /key InitVar, skysweep , /key InitVar, insitu , /key InitVar, remote , /key InitVar, solardisk , /key InitVar, planarcut , /key InitVar, magnetic , /key speed = 1-magnetic density = 1-magnetic brad = magnetic btang = magnetic InitVar, filter, vu_prefix(magnetic=magnetic,/silent) IF IsType(env_filter,/defined) THEN BEGIN setenv, env_filter+'='+filter add2label = filter ENDIF IF strpos(filter, '*.*') EQ -1 THEN filter = filter+'*.*' CASE magnetic OF 0: mag_type = '' 1: mag_type = ' ('+strupcase(strmid(filter,0,3))+'/NOAA)' ENDCASE ; Only needed for remote views with magnetic data in it InitVar, nv_filter, vu_prefix(/silent) InitVar, png, /key InitVar, gif, /key png = png or 1-gif IF total( [synoptic, skymap, skysweep, insitu, remote, solardisk, planarcut] ) EQ 0 THEN BEGIN synoptic = 1 skymap = 1 skysweep = 1 insitu = 1 remote = 1 solardisk= 1 planarcut= 1 ENDIF kind = (['slow','fast'])[fast] tm_label = (['corotating','time-dependent'])[fast]+mag_type root = filepath(root=forecast_cfg(/root), kind) input = filepath(root=root, subdir='final', '') ; Source directory of tomography files movie = filepath(root=root, subdir='movie', '') ; Destination directory of animations htm_dir = filepath(root=forecast_cfg(/html), subdir=kind, 'current') ; Adjust the ROI extracted from the 3D data files. ; Only used if hdr and ff don't exist yet. roi_offset= forecast_cfg(/roi_offset)*(1-fast) local2ut = forecast_cfg(/local2ut) ; Difference PST to GST mtime = forecast_cfg(/movie_time) ; Time period for the movie delay = forecast_cfg(kind, /movie_delay) ; Delay for animations skip = forecast_cfg(/movie_skip) ; Skip files when making movies upto = forecast_cfg(/round_time) rounds = round(forecast_cfg(/round_time, /mmsec))/1000 maxelo = forecast_cfg(/maxelo, /degrees) ; Max elongation remote views scale = forecast_cfg(/scale_skymap) ngrid = forecast_cfg(/remote_ngrid) fovsize = forecast_cfg(/remote_fovsize) location= forecast_cfg(/remote_location) ; Sets longitude to NaN volsize = forecast_cfg(/remote_volsize) ; Limit radial distance used in remote views color_v = forecast_cfg(/remote_color_v) color_n = forecast_cfg(/remote_color_n) range_v = forecast_cfg(kind, /remote_range_v) range_n = forecast_cfg(kind, /remote_range_n) opa_v = forecast_cfg(kind, /remote_opacity_v) opa_n = forecast_cfg(kind, /remote_opacity_n) InitVar, ut, TimeSystem(local2ut,/silent) ut = TimeGet(ut, TimeUnit(/sec), roundt=rounds) ut = TimeOp(/add, ut, mtime) delt = forecast_cfg(/insitu_delt) tx_range= forecast_cfg(/insitu_trange) ; Sets time axis for insitu plot to ut +/- 15 days IF fast AND insitu THEN BEGIN ; Read extra data to fill in time series ut_extra = forecast_cfg(/movie_ut_extra) ts_range = [tx_range[0],4] ; Prevent time series from going too far into future ENDIF ut_off = forecast_cfg(/disk_dtime) IF solardisk THEN IF IsType(ut_extra, /undef) THEN ut_extra = [ut_off,0] IF synoptic THEN BEGIN vu_movie, ut, 'synoptic', path=input, filter=filter, movie_destination=movie, speed=speed, brad=brad, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ timeaxis=1-fast, /earth, /forecast, $ roi_offset=roi_offset, ut_extra=ut_extra, silent=silent, /forcecd, png=png, gif=gif, $ add2label=add2label forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent vu_movie, ut, 'synoptic', path=input, filter=filter, movie_destination=movie, density=density, btang=btang, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ timeaxis=1-fast, /earth, /forecast, silent=silent, png=png, gif=gif, $ add2label=add2label forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent ENDIF IF solardisk THEN BEGIN vu_movie, ut, 'earth_solardisk', path=input, filter=filter, movie_destination=movie, speed=speed, brad=brad, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ roi_offset=roi_offset, ut_extra=ut_extra, /forcecd, ut_off=ut_off, $ silent=silent, png=png, gif=gif, $ add2label=add2label forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent vu_movie, ut, 'earth_solardisk', path=input, filter=filter, movie_destination=movie, density=density, btang=btang,$ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ ut_off=ut_off, $ silent=silent, png=png, gif=gif, $ add2label=add2label forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent ENDIF IF planarcut THEN BEGIN body = [jpl_body(/earth,/string),jpl_body(/mars,/string)]+'&' vu_movie, ut, 'planarcut', path=input, filter=filter, movie_destination=movie, speed=speed, brad=brad, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ roi_offset=roi_offset, ut_extra=ut_extra, /forcecd, $ silent=silent, png=png, gif=gif, $ add2label=add2label, $ /from_centered_ecliptic, /heliocentric, body=body, radius=2 forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent vu_movie, ut, 'planarcut', path=input, filter=filter, movie_destination=movie, density=density, btang=btang,$ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ silent=silent, png=png, gif=gif, $ add2label=add2label, $ /from_centered_ecliptic, /heliocentric, body=body, radius=2 forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent ENDIF IF insitu THEN BEGIN vu_movie, ut, 'earth_insitu', path=input, filter=filter, movie_destination=movie, speed=speed, brad=brad, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ /nofuture, /timeseries, /forecast, delt=delt, $ nosequence=1-fast, tm_label=tm_label, ts_range=ts_range, tx_range=tx_range, $ roi_offset=roi_offset, ut_extra=ut_extra, silent=silent, /forcecd, png=png, gif=gif,$ add2label=add2label forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent vu_movie, ut, 'earth_insitu', path=input, filter=filter, movie_destination=movie, density=density, btang=btang, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ /nofuture, /timeseries, /forecast, delt=delt, $ nosequence=1-fast, tm_label=tm_label, ts_range=ts_range, tx_range=tx_range, $ silent=silent, png=png, gif=gif, $ add2label=add2label forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent FOR iplanet=0,n_elements(planets)-1 DO BEGIN planet = strcompress(strlowcase(planets[iplanet]),/rem) vu_movie, ut, planet+'_insitu', path=input, filter=filter, movie_destination=movie, speed=speed, brad=brad, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ /nofuture, /timeseries, /forecast, delt=delt, $ nosequence=1-fast, tm_label=tm_label, ts_range=ts_range, tx_range=tx_range, $ roi_offset=roi_offset, ut_extra=ut_extra, silent=silent, /forcecd, png=png, gif=gif,$ add2label=add2label forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent vu_movie, ut, planet+'_insitu', path=input, filter=filter, movie_destination=movie, density=density, btang=btang, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ /nofuture, /timeseries, /forecast, delt=delt, $ nosequence=1-fast, tm_label=tm_label, ts_range=ts_range, tx_range=tx_range, $ silent=silent, png=png, gif=gif, $ add2label=add2label forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent ENDFOR ENDIF IF skymap AND NOT magnetic THEN BEGIN vu_movie, ut, 'earth_skysnap', path=input, filter=filter, movie_destination=movie, /ips_speed, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ maxelo=-1, /legend, /compass, $ roi_offset=roi_offset, ut_extra=ut_extra, silent=silent, /forcecd, png=png, gif=gif forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent vu_movie, ut, 'earth_skysnap', path=input, filter=filter, movie_destination=movie, /ips_glevel, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ maxelo=-1, /legend, /compass, $ silent=silent, png=png, gif=gif forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent vu_movie, ut, 'earth_skysnap', path=input, filter=filter, movie_destination=movie, /ips_speed, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ maxelo=maxelo, /degrees, scale=scale, /legend, /compass, $ silent=silent, png=png, gif=gif forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent vu_movie, ut, 'earth_skysnap', path=input, filter=filter, movie_destination=movie, /ips_glevel, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ maxelo=maxelo, /degrees, scale=scale, /legend, /compass, $ silent=silent, png=png, gif=gif forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent ENDIF IF skysweep AND NOT magnetic THEN BEGIN vu_movie, ut, 'earth_skysweep', path=input, filter=filter, movie_destination=movie, /ips_speed, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ /track, /solar, /fillsky, maxelo=-1, /legend, /compass, $ roi_offset=roi_offset, ut_extra=ut_extra, silent=silent, /forcecd, png=png, gif=gif forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent vu_movie, ut, 'earth_skysweep', path=input, filter=filter, movie_destination=movie, /ips_glevel,$ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ /track, /solar, /fillsky, maxelo=-1, /legend, /compass, $ silent=silent, png=png, gif=gif forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent vu_movie, ut, 'earth_skysweep', path=input, filter=filter, movie_destination=movie, /ips_speed, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ /track, /solar, /fillsky, maxelo=maxelo, /degrees, scale=scale, /legend, /compass, $ silent=silent, png=png, gif=gif forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent vu_movie, ut, 'earth_skysweep', path=input, filter=filter, movie_destination=movie, /ips_glevel,$ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ /track, /solar, /fillsky, maxelo=maxelo, /degrees, scale=scale, /legend, /compass, $ silent=silent, png=png, gif=gif forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent ENDIF IF remote THEN BEGIN CASE magnetic OF 0: BEGIN vu_movie, ut, 'earth_remoteview', path=input, filter=filter, movie_destination=movie, /speed, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ location=location, /ecliptic, ngrid=ngrid, /eqangle, fovsize=fovsize, volsize=volsize, $ full_color=color_v, full_range=range_v, full_opa=opa_v, $ roi_offset=roi_offset, ut_extra=ut_extra, silent=silent, /forcecd, png=png, gif=gif forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent vu_movie, ut, 'earth_remoteview', path=input, filter=filter, movie_destination=movie, /density, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ location=location, /ecliptic, ngrid=ngrid, /eqangle, fovsize=fovsize, volsize=volsize, $ full_color=color_n, full_range=range_n, full_opa=opa_n, $ silent=silent, png=png, gif=gif forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent END 1: BEGIN ; hdr, ff contain magnetic data. nv_filter is used to find the density/velocity ; data needed to make the remoteviews with the hcs embbedded vu_movie, ut, 'earth_remoteview', path=input, filter=filter, movie_destination=movie, /speed, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ location=location, /ecliptic, ngrid=ngrid, /eqangle, fovsize=fovsize, volsize=volsize, $ full_color=color_v, full_range=range_v, full_opa=opa_v, $ roi_offset=roi_offset, ut_extra=ut_extra, silent=silent, /forcecd, png=png, gif=gif, $ nv_filter=nv_filter, nv_hdr=nv_hdr, nv_ff=nv_ff, $ type_bb=vu_type_insitu('earth_remoteview', /brad, add2label=add2label) forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent ; nv_hdr, nv_ff are passed from the previous call to vu_movie. vu_movie, ut, 'earth_remoteview', path=input, filter=filter, movie_destination=movie, /density, $ hdr=hdr, ff=ff, movie_file=movie_file, upto=upto, skip=skip, delay=delay, $ location=location, /ecliptic, ngrid=ngrid, /eqangle, fovsize=fovsize, volsize=volsize, $ full_color=color_n, full_range=range_n, full_opa=opa_n, $ silent=silent, png=png, gif=gif, $ nv_filter=nv_filter, nv_hdr=nv_hdr, nv_ff=nv_ff, $ type_bb=vu_type_insitu('earth_remoteview', /btang, add2label=add2label) forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent END ENDCASE ENDIF RETURN & END