MetopDatasets
Documentation for MetopDatasets.
Copyright and License
This code is licensed under MIT license. See file LICENSE for details on the usage and distribution terms.
diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 9b3916e..4104e82 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-15T09:24:25","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-15T10:12:04","documenter_version":"1.8.0"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 4b9361e..4a36b8f 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -
Documentation for MetopDatasets.
This code is licensed under MIT license. See file LICENSE for details on the usage and distribution terms.
Settings
This document was generated with Documenter.jl version 1.8.0 on Friday 15 November 2024. Using Julia version 1.11.1.
Documentation for MetopDatasets.
This code is licensed under MIT license. See file LICENSE for details on the usage and distribution terms.
Settings
This document was generated with Documenter.jl version 1.8.0 on Friday 15 November 2024. Using Julia version 1.11.1.
MetopDatasets.data_record_type
— Methoddata_record_type(header::MainProductHeader)::Type
Get the type of data record based on the main product header
Example
julia> file_pointer = open("ASCA_SZO_1B_M03_20230329063300Z_20230329063556Z_N_C_20230329081417Z")
julia> main_header = MetopDatasets.native_read(file_pointer, MainProductHeader)
julia> data_record_type(main_header)
-ASCA_SZO_1B_V13
MetopDatasets.get_data_record_chunks
— Methodget_data_record_chunks(internal_pointer_records::Vector{InternalPointerRecord},
- total_file_size::Integer, record_type::Type{<:DataRecord})::Vector{RecordChunk}
Compute the record_chunks
MetopDatasets.get_description
— Methodget_description(T::Type{<:BinaryRecord}, field::Symbol)::AbstractString
Get the description for a given field in the BinaryRecord
Example
julia> get_description(ASCA_SZR_1B_V13, :sigma0_trip)
-"Sigma0 triplet, re-sampled to swath grid, for 3 beams (fore, mid, aft) "
MetopDatasets.get_dimensions
— Methodget_dimensions(T::Type{<:BinaryRecord})::Dict{String, <:Integer}
Get the the named dimensions in a BinaryRecord and their length.
Example
julia> get_dimensions(ASCA_SZR_1B_V13)
+ASCA_SZO_1B_V13
MetopDatasets.get_data_record_chunks
— Methodget_data_record_chunks(internal_pointer_records::Vector{InternalPointerRecord},
+ total_file_size::Integer, record_type::Type{<:DataRecord})::Vector{RecordChunk}
Compute the record_chunks
MetopDatasets.get_description
— Methodget_description(T::Type{<:BinaryRecord}, field::Symbol)::AbstractString
Get the description for a given field in the BinaryRecord
Example
julia> get_description(ASCA_SZR_1B_V13, :sigma0_trip)
+"Sigma0 triplet, re-sampled to swath grid, for 3 beams (fore, mid, aft) "
MetopDatasets.get_dimensions
— Methodget_dimensions(T::Type{<:BinaryRecord})::Dict{String, <:Integer}
Get the the named dimensions in a BinaryRecord and their length.
Example
julia> get_dimensions(ASCA_SZR_1B_V13)
Dict{String, Int64} with 2 entries:
"num_band" => 3
- "xtrack" => 82
MetopDatasets.get_field_dimensions
— Methodget_field_dimensions(T::Type{<:BinaryRecord}, field::Symbol)::Vector{<:AbstractString}
Get the named dimensions of a field in a BinaryRecord
Example
julia> get_field_dimensions(ASCA_SZR_1B_V13, :sigma0_trip)
-["num_band", "xtrack"]
MetopDatasets.get_raw_format_dim
— Methodget_raw_format_dim(T::Type{<:BinaryRecord}, field::Symbol)::NTuple{4, Int64}
Get the dimensions of the field as defined in the record format specification.
Example
julia> get_raw_format_dim(ASCA_SZR_1B_V13, :sigma0_trip)
-(3, 82, 1, 1)
MetopDatasets.get_scale_factor
— Methodget_scale_factor(T::Type{<:BinaryRecord}, field::Symbol)::Union{Number,Nothing}
get the scale_factor
for a given field in the BinaryRecord
. The variable can late be scaled from integer to float by dividing with 10^scale_factor
. Returns nothing
if no scale factor is set.
Example
julia> get_scale_factor(ASCA_SZR_1B_V13, :sigma0_trip)
-6
MetopDatasets.native_read
— Methodnative_read(io::IO, T)::T
Read a single object of type T from io to a file in the native Metop format. Endianness is automatically converted.
Example
julia> file_pointer = open("ASCA_SZO_1B_M03_20230329063300Z_20230329063556Z_N_C_20230329081417Z")
+ "xtrack" => 82
MetopDatasets.get_field_dimensions
— Methodget_field_dimensions(T::Type{<:BinaryRecord}, field::Symbol)::Vector{<:AbstractString}
Get the named dimensions of a field in a BinaryRecord
Example
julia> get_field_dimensions(ASCA_SZR_1B_V13, :sigma0_trip)
+["num_band", "xtrack"]
MetopDatasets.get_raw_format_dim
— Methodget_raw_format_dim(T::Type{<:BinaryRecord}, field::Symbol)::NTuple{4, Int64}
Get the dimensions of the field as defined in the record format specification.
Example
julia> get_raw_format_dim(ASCA_SZR_1B_V13, :sigma0_trip)
+(3, 82, 1, 1)
MetopDatasets.get_scale_factor
— Methodget_scale_factor(T::Type{<:BinaryRecord}, field::Symbol)::Union{Number,Nothing}
get the scale_factor
for a given field in the BinaryRecord
. The variable can late be scaled from integer to float by dividing with 10^scale_factor
. Returns nothing
if no scale factor is set.
Example
julia> get_scale_factor(ASCA_SZR_1B_V13, :sigma0_trip)
+6
MetopDatasets.native_read
— Methodnative_read(io::IO, T)::T
Read a single object of type T from io to a file in the native Metop format. Endianness is automatically converted.
Example
julia> file_pointer = open("ASCA_SZO_1B_M03_20230329063300Z_20230329063556Z_N_C_20230329081417Z")
julia> main_header = MetopDatasets.native_read(file_pointer, MainProductHeader)
julia> main_header.sensing_start
-2023-03-29T06:33:00
MetopDatasets.native_sizeof
— Methodnative_sizeof(x)::Integer
The byte size of the type x in a METOP native product.
Example
julia> native_sizeof(RecordHeader)
-20
MetopDatasets.read_first_record
— Methodread_first_record(ds::MetopDataset, record_type::Type{<:Record})
Read the first record of type record_type
from the dataset. This can be used to access records that are not directly exposed through the MetopDataset
interface.
MetopDatasets.record_struct_expression
— Methodrecord_struct_expression(file_name, record_type)
Function to autogenerate Struct
code based on a CSV file. Also autogenerates get_description
and get_scale_factor
method for Struct
. Use it together with eval
.
Example
julia> eval(record_struct_expression(joinpath(@__DIR__, "TEST_FORmaT.csv"), DataRecord))
+2023-03-29T06:33:00
MetopDatasets.native_sizeof
— Methodnative_sizeof(x)::Integer
The byte size of the type x in a METOP native product.
Example
julia> native_sizeof(RecordHeader)
+20
MetopDatasets.read_first_record
— Methodread_first_record(ds::MetopDataset, record_type::Type{<:Record})
Read the first record of type record_type
from the dataset. This can be used to access records that are not directly exposed through the MetopDataset
interface.
MetopDatasets.record_struct_expression
— Methodrecord_struct_expression(file_name, record_type)
Function to autogenerate Struct
code based on a CSV file. Also autogenerates get_description
and get_scale_factor
method for Struct
. Use it together with eval
.
Example
julia> eval(record_struct_expression(joinpath(@__DIR__, "TEST_FORmaT.csv"), DataRecord))
julia> TEST_FORMAT <: DataRecord
-true
MetopDatasets.scale_iasi_spectrum
— Methodscale_iasi_spectrum(spec_raw, giadr::GIADR_IASI_XXX_1C; high_precision = false)
+true
MetopDatasets.scale_iasi_spectrum
— Methodscale_iasi_spectrum(spec_raw, giadr::GIADR_IASI_XXX_1C; high_precision = false)
scale_iasi_spectrum(spec_raw, giadr::GIADR_IASI_XXX_1C, channel_range::OrdinalRange; high_precision = false)
Scaling the IASI L1C spectrum using the giadr record information. The channel_range
is needed if only a subset of the raw spectrum is passed to the function. Setting high_precision=true
will convert to Float64
instead of Float32
. Note that the end part of the ds["gs1cspect"]
does not have any scale factors. Here the spectrum is just filled with 0.0
.
Example
julia> file_path = "test/testData/IASI_xxx_1C_M01_20240819103856Z_20240819104152Z_N_C_20240819112911Z"
julia> ds = MetopDataset(file_path, auto_convert = false);
julia> giadr = MetopDatasets.read_first_record(ds, MetopDatasets.GIADR_IASI_XXX_1C_V11)
julia> # Scale full spectrum.
julia> scaled_spectrum = MetopDatasets.scale_iasi_spectrum(ds["gs1cspect"], giadr)
julia> # Scale subset of spectrum.
-julia> scaled_spectrum_subset = MetopDatasets.scale_iasi_spectrum(ds["gs1cspect"][10:20,:,:,:], giadr, 10:20)
MetopDatasets.AbstractMetopDiskArray
— TypeAbstractMetopDiskArray{T, N} <: DiskArrays.AbstractDiskArray{T, N}
In most cases MetopDiskArray
is used but AbstractMetopDiskArray
allows defining additional DiskArray types to handle special corner cases.
MetopDatasets.DummyRecord
— TypeDummyRecord <:Record
The Dummy Measurement Data Record is a special case of the MDR. It is a generic record that is used to indicate the location of lost data within any product. One DMDR can replace a contiguous block of lost MDRs
MetopDatasets.IasiSpectrumDiskArray
— TypeIasiSpectrumDiskArray{T} <: AbstractMetopDiskArray{T, 4}
The IasiSpectrumDiskArray
is a wrapper around a MetopDiskArray
that enables the automatic scaling of the the IASI L1C spectrum using the GIADR_IASI_XXX_1C
record information.
MetopDatasets.IasiWaveNumberDiskArray
— TypeIasiWaveNumberDiskArray <: AbstractMetopDiskArray{Float64, 2}
The IasiWaveNumberDiskArray
is a disk array that computes the wave number of the IASI spectrum. The wave number is computed using :idefnsfirst1b
and :idefspectdwn1b
from each data record.
MetopDatasets.InternalPointerRecord
— TypeInternalPointerRecord <: Record
The Internal Pointer Records (IPR) specifies the start of each block of records in the file sharing the same record type. This can be used to find the locations of data records or dummy records.
MetopDatasets.MetopDiskArray
— TypeMetopDiskArray{T, N} <: AbstractMetopDiskArray{T, N}
Struct to handle lazy loading of a variable in a Metop product. The raw types in the product is mapped without any scaling. Auto conversion can be enabled for RecordSubType
e.g. converting VInteger
to Float64
.
MetopDatasets.MetopDiskArray
— MethodMetopDiskArray(file_pointer::IOStream,
+julia> scaled_spectrum_subset = MetopDatasets.scale_iasi_spectrum(ds["gs1cspect"][10:20,:,:,:], giadr, 10:20)
MetopDatasets.AbstractMetopDiskArray
— TypeAbstractMetopDiskArray{T, N} <: DiskArrays.AbstractDiskArray{T, N}
In most cases MetopDiskArray
is used but AbstractMetopDiskArray
allows defining additional DiskArray types to handle special corner cases.
MetopDatasets.DummyRecord
— TypeDummyRecord <:Record
The Dummy Measurement Data Record is a special case of the MDR. It is a generic record that is used to indicate the location of lost data within any product. One DMDR can replace a contiguous block of lost MDRs
MetopDatasets.IasiSpectrumDiskArray
— TypeIasiSpectrumDiskArray{T} <: AbstractMetopDiskArray{T, 4}
The IasiSpectrumDiskArray
is a wrapper around a MetopDiskArray
that enables the automatic scaling of the the IASI L1C spectrum using the GIADR_IASI_XXX_1C
record information.
MetopDatasets.IasiWaveNumberDiskArray
— TypeIasiWaveNumberDiskArray <: AbstractMetopDiskArray{Float64, 2}
The IasiWaveNumberDiskArray
is a disk array that computes the wave number of the IASI spectrum. The wave number is computed using :idefnsfirst1b
and :idefspectdwn1b
from each data record.
MetopDatasets.InternalPointerRecord
— TypeInternalPointerRecord <: Record
The Internal Pointer Records (IPR) specifies the start of each block of records in the file sharing the same record type. This can be used to find the locations of data records or dummy records.
MetopDatasets.MetopDiskArray
— TypeMetopDiskArray{T, N} <: AbstractMetopDiskArray{T, N}
Struct to handle lazy loading of a variable in a Metop product. The raw types in the product is mapped without any scaling. Auto conversion can be enabled for RecordSubType
e.g. converting VInteger
to Float64
.
MetopDatasets.MetopDiskArray
— MethodMetopDiskArray(file_pointer::IOStream,
record_chunks::Vector{RecordChunk},
- field_name::Symbol; auto_convert = true) -> MetopDiskArray
Constructor for MetopDiskArray that compute additional fields. auto_convert = true
will automatically convert custom RecordSubType
to commonly used data types e.g. converting VInteger
to Float64
.
MetopDatasets.MetopVariable
— TypeMetopVariable{T, N, R <: DataRecord, F} <: CommonDataModel.AbstractVariable{T, N}
MetopVariable
wraps AbstractMetopDiskArray
so it can be used with MetopDataset
.
MetopDatasets.RecordChunk
— TypeRecordChunk
Used to store the locations of different chunks of records in Native metop files.
MetopDatasets.RecordHeader
— TypeRecordHeader
Also known as GRH.
Settings
This document was generated with Documenter.jl version 1.8.0 on Friday 15 November 2024. Using Julia version 1.11.1.
Constructor for MetopDiskArray that compute additional fields. auto_convert = true
will automatically convert custom RecordSubType
to commonly used data types e.g. converting VInteger
to Float64
.
MetopDatasets.MetopVariable
— TypeMetopVariable{T, N, R <: DataRecord, F} <: CommonDataModel.AbstractVariable{T, N}
MetopVariable
wraps AbstractMetopDiskArray
so it can be used with MetopDataset
.
MetopDatasets.RecordChunk
— TypeRecordChunk
Used to store the locations of different chunks of records in Native metop files.
MetopDatasets.RecordHeader
— TypeRecordHeader
Also known as GRH.
Settings
This document was generated with Documenter.jl version 1.8.0 on Friday 15 November 2024. Using Julia version 1.11.1.