HIRS
- class typhon.datasets.tovs.HIRS(name=None, **kwargs)[source]
- High-resolution Infra-Red Sounder. - This class can read HIRS l1b as published in the NOAA CLASS archive. - Reading routines as for any datasets (see documentation for Dataset, MultiFileDataset, and others). - Specifically for HIRS: when reading a single file (i.e. h.read(path)), takes keyword arguments: - radiance_units. Defaults to “si”, by which I annoyingly mean W/(m²·sr·Hz). Set to “classic” if you want mW/(m²·sr·cm^{-1}), which is the unit more commonly used for HIRS and which it is calibrated against. - apply_scale_factors. If true (defaults true), apply scale factors as documented in KLM / POD guides. This is required when calibrate is True. - calibrate. If true (defaults true), apply calibration. When false, will not return any brightness temperatures or radiances, just counts. Note that this relates to the native NOAA calibration, not to any new calibration such as developed for FIDUCEO. - max_flagged. Float between 0 and 1. If a larger proportion than this number is flagged, raise an exception (FIXME DOC) and throw away the entire granule. - Note that this class only reads in the standard HIRS data with its standard calibration. Innovative calibrations including uncertainties are implemented in HIRSFCDR. - To use this class, you need to define in your typhonrc the following settings in the section ‘hirs’: - basedir - subdir - re - (TODO: migrate to definition?) - format_definition_file - only for FIXME - Work in progress. - TODO/FIXME: - What is the correct way to use the odd bit parity? Information in NOAA KLM User’s Guide pages 3-31 and 8-154, but I’m not sure how to apply it. 
- If datasets like MHS or AVHRR are added some common code could probably move to a class between HIRS and MultiFileDataset, or to a mixin such as ATOVS. 
- Better handling of duplicates between subsequent granules. Currently it takes all lines from the older granule and none from the newer, but this should be decided on a case-by-case basis (Jon Mittaz, personal communication). 
 - __init__(*args, **kwargs)[source]
 - Methods - __init__(*args, **kwargs)- as_xarray_dataset(M[, skip_dimensions, ...])- Convert structured ndarray to xarray dataset - calc_time_since_last_calib(M[, D, H, fn])- Calculate time since last calibration. - calibrate(cc, counts)- check_parity(counts)- Verify parity for counts - combine(my_data, other_obj[, other_data, ...])- Combine with data from other dataset. - count_lines_since_last_calib(M[, D, H, fn])- Count scanlines since last calibration. - Find the directory containing granules/measurements at (date)time - find_granules([dt_start, dt_end, ...])- Yield all granules/measurementfiles in period - find_granules_sorted([dt_start, dt_end, ...])- Yield all granules, sorted by times. - find_most_recent_granule_before(instant, ...)- Find granule covering instant - flagscore(M)- Calculate "flag score"; higher is worse. - get_additional_field(M, fld)- Get additional field. - get_cc(scanlines)- Extract calibration coefficients from scanlines. - get_dataname(header[, robust])- Extract dataname from header. - get_definition_from_PDF(path_to_pdf)- Get HIRS definition from NWPSAF PDF. - get_dtypes(fp)- Get dtypes for file. - Return dict (re.fullmatch) for granule, based on re - get_iwt(header, elem)- Get temperature of internal warm target - get_mask_from_flags(header, lines[, max_flagged])- Set mask in lines, based on header and lines info - Get other information from scanlines. - What extra format variables are needed in find_granules? - get_pos()- Get lat-lon from scanlines. - Return the resolution for the subdir precision. - get_temp(header, elem, anwrd)- Get temperatures from header, element, anwrd - Get datetime objects for beginning and end of granule - get_times_for_granule(p, **kwargs)- For granule stored in path, get start and end times. - get_wn_c1_c2(header)- Read central wavenumber, c1, and c2 from header - id2name(satid)- Translate satellite id to satellite name. - id2no(satid)- Translate satellite id to satellite number. - iterate_subdirs(d_start, d_end, **extra)- Iterate through all subdirs in dataset. - rad2bt(rad_wn, wn, c1, c2)- Apply the standard radiance-to-BT conversion from NOAA KLM User's Guide. - read([f, fields, pseudo_fields])- Read granule in file and do some other fixes - read_period([start, end, onerror, fields, ...])- Read all granules between start and end, in bulk. - seekhead(f)- Seek open file to header position. - setlocal()- Set local attributes, from config or otherwise. - verify_mandatory_fields(extra)- Attributes - aliases- basedir- concat_coor- count_end- count_start- datefields- default_orbit_filters- end_date- filter_calibcounts- filter_prttemps- flag_fields- format_definition_file- granule_cache_file- granule_duration- granules_firstline_db- granules_firstline_file- mandatory_fields- max_valid_time_ptp- maxsize- my_pseudo_fields- n_calibchannels- n_channels- n_minorframes- n_perline- name- re- read_returns- refields- related- satellites- satname- section- srf_backend_f- srf_backend_response- srf_dir- srf_rttov- start_date- subdir- temperature_fields- time_field- typ_Earth- typ_iwt- typ_space- unique_fields- valid_field_values- dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).