createMovie#
- hvpy.createMovie(startTime, endTime, layers, events, eventsLabels, imageScale, format='mp4', frameRate='15', maxFrames=None, scale=None, scaleType=None, scaleX=None, scaleY=None, movieLength=None, watermark=True, width=None, height=None, x0=None, y0=None, x1=None, y1=None, x2=None, y2=None, size=0, movieIcons=None, followViewport=None, reqObservationDate=None, overwrite=False, filename=None, hq=False, timeout=5)[source]#
Automatically creates a movie using queueMovie, getMovieStatus and downloadMovie functions.
- Parameters:
overwrite (
bool
) – Whether to overwrite the file if it already exists. Default is False.filename (
Union
[str
,Path
,None
]) – The path to save the file to. Optional, will default tof"{res['title']}.{format}"
.hq (
bool
) – Download a higher-quality movie file (valid for “mp4” movies only, ignored otherwise). Default is False, optional.timeout (
float
) – The timeout in minutes to wait for the movie to be created. Default is 5 minutes.startTime (
datetime
) – Datetime of the first frame of the movie.endTime (
datetime
) – Datetime of the final frame of the movie.layers (
str
) – Image datasource layers to include in the movie.events (
str
) – List of feature/event types and FRMs to use to annotate the movie.eventsLabels (
bool
) – Boolean to indicate if the event labels should be included in the movie.imageScale (
float
) – Image scale in arcseconds per pixel.format (
str
) – Movie format (“mp4”, “webm”, “flv”). Default value is “mp4”, optional.frameRate (
str
) – Movie frames per second. Default value is 15 frames per second, optional.maxFrames (
Optional
[str
]) – Maximum number of frames in the movie, can be capped by the server. Default value is None, optional.scale (
Optional
[bool
]) – Overlay an image scale indicator. Default value is None, optional.scaleType (
Optional
[str
]) – Set the image scale indicator. Default value is None, optional.scaleX (
Optional
[float
]) – Horizontal offset of the image scale indicator in arcseconds with respect to the center of the Sun. Default value is None, optional.scaleY (
Optional
[float
]) – Vertical offset of the image scale indicator in arcseconds with respect to the center of the Sun. Default value is None, optional.movieLength (
Optional
[float
]) – Movie length in seconds. Default value is None, optional.watermark (
bool
) – Overlay a Helioviewer.org watermark image. Default value is True, optional.width (
Optional
[int
]) – Width of the field of view in pixels. (Used in conjunction withx0
,y0
, andheight
). Default value is None, optional.height (
Optional
[int
]) – Height of the field of view in pixels. (Used in conjunction withx0
,y0
, andwidth
). Default value is None, optional.x0 (
Optional
[int
]) – The horizontal offset of the center of the field of view from the center of the Sun. Used in conjunction withy0
,width
, andheight
. Default value is None, optional.y0 (
Optional
[int
]) – The vertical offset of the center of the field of view from the center of the Sun. Used in conjunction withx0
, width, and height. Default value is None, optional.x1 (
Optional
[int
]) – The horizontal offset of the top-left corner of the field of view with respect to the center of the Sun (in arcseconds). Used in conjunction withy1
,x2
, andy2
. Default value is None, optional.y1 (
Optional
[int
]) – The vertical offset of the top-left corner of the field of view with respect to the center of the Sun (in arcseconds). Used in conjunction withx1
,x2
, andy2
. Default value is None, optional.x2 (
Optional
[int
]) – The horizontal offset of the bottom-right corner of the field of view with respect to the center of the Sun (in arcseconds). Used in conjunction withx1
,y1
, andy2
. Default value is None, optional.y2 (
Optional
[int
]) – The vertical offset of the bottom-right corner of the field of view with respect to the center of the Sun (in arcseconds). Used in conjunction withx1
,y1
, andx2
. Default value is None, optional.callback – Wrap the response object in a function call of your choosing. Default value is None, optional.
size (
int
) – Scale video to preset size. Default value is 0, optional.movieIcons (
Optional
[int
]) – Display other user generated movies on the video. Default value is None, optional.followViewport (
Optional
[int
]) – Rotate field of view of movie with Sun. Default value is None, optional.reqObservationDate (
Optional
[datetime
]) – Viewport datetime. Used when ‘followViewport’ enabled to shift viewport area to correct coordinates Default value is None, optional.
- Return type:
References
Examples
>>> from hvpy import createMovie, DataSource, create_events, create_layers >>> from datetime import datetime, timedelta >>> movie_location = createMovie( ... startTime=datetime.today() - timedelta(days=15, minutes=5), ... endTime=datetime.today() - timedelta(days=15), ... layers=create_layers([(DataSource.AIA_171, 100)]), ... events=create_events(["AR"]), ... eventsLabels=True, ... imageScale=1, ... filename="my_movie", ... ) >>> # This is to cleanup the file created from the example >>> # you don't need to do this >>> from pathlib import Path >>> Path('my_movie.mp4').unlink()