@classmethod<EOL><INDENT>def from_tmy(cls, tmy_metadata, tmy_data=None, **kwargs):<DEDENT>
<EOL>tmy2 = tmy_metadata.get('<STR_LIT>', False)<EOL>latitude = tmy_metadata['<STR_LIT>']<EOL>longitude = tmy_metadata['<STR_LIT>']<EOL>if tmy2:<EOL><INDENT>name = tmy_metadata['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>name = tmy_metadata['<STR_LIT:Name>']<EOL><DEDENT>tz = tmy_metadata['<STR_LIT>']<EOL>altitude = tmy_metadata['<STR_LIT>']<EOL>new_object = cls(latitude, longitude, tz=tz, altitude=altitude,<EOL>name=name, **kwargs)<EOL>if tmy_data is not None:<EOL><INDENT>new_object.tmy_data = tmy_data<EOL><DEDENT>return new_object<EOL>
Create an object based on a metadata
dictionary from tmy2 or tmy3 data readers.

Parameters
----------
tmy_metadata : dict
    Returned from tmy.readtmy2 or tmy.readtmy3
tmy_data : None or DataFrame, default None
    Optionally attach the TMY data to this object.

Returns
-------
Location object (or the child class of Location that you
called this method from).