Extending rojak#
Other meteorological data sources#
Loading data from a different meteorological data source (i.e. not ERA5 data) can be achieved by,
Adding a new class: To keep the package structure consistent, create a new module in
rojak.datalib(e.g.,rojak/datalib/ifs.py) and within that create a new class (e.g.IFSData)Implementing the interface: Make the class subclass/implement
rojak.core.data.MetDataand satisfy any abstract methods or properties required by that interface.Providing the adaptor: Implement the abstract method
MetData.to_clear_air_turbulence_data()on the new class. This method must return arojak.core.data.CATDatainstance.Verifying compatibility: Add unit tests that confirm
to_clear_air_turbulence_data()returns a validCATDataand that required fields are correctly mapped.Using with diagnostics: Convert your
MetDatainstance viato_clear_air_turbulence_data()and pass the returnedCATDatatorojak.turbulence.diagnostic.DiagnosticFactoryto instantiate diagnostics.