aecpack.c(3)
π NAME π
okay so bestie, this is aecpack.c(3) β a page straight outta the Library Functions Manual β and it does exactly one iconic thing:
aecpack.c β Pack array of float/double using AEC/CCSDS compression.
that's it. that's the whole vibe. packing arrays. slay. π
β¨ SYNOPSIS β¨
#include 'grib2_int.h'
#include <libaec.h>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
π«Ά Functions π«Ά
void aecpack (float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)β This function packs up a float array into a AEC code stream.static int aecpack_int (void *fld, int fld_is_double, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack, int verbose)β Pack a float or double array into a AEC/CCSDS code stream.int g2c_aecpackd (double *fld, size_t width, size_t height, int *idrstmpl, unsigned char *cpack, size_t *lcpack)β This function packs up a double array into a AEC code stream.int g2c_aecpackf (float *fld, size_t width, size_t height, int *idrstmpl, unsigned char *cpack, size_t *lcpack)β This function packs up a float array into a AEC code stream.
π DETAILED DESCRIPTION π
Pack array of float/double using AEC/CCSDS compression. no notes. periodt. π
π Author π
Eric Engle
π Date π
2023-09-10
π Program History Log π
2023-09-10β Engle β Initial; Adapted fromaecpack.c.2023-10-16β Engle β Added includelibaecto set default values for CCSDS parameters.
Definition in file aecpack.c.
π§ FUNCTION DOCUMENTATION π§
void aecpack (float * fld, g2int width, g2int height, g2int * idrstmpl, unsigned char * cpack, g2int * lcpack)
This function packs up a float array into a AEC code stream. So like β after the data are scaled, and the reference value is subtracted out, the data get handed over to the AEC encoder. that's the whole glow-up pipeline bestie β¨
This function also fills in GRIB2 Data Representation Template 5.42 with the appropriate values. it's giving multitasking queen.
Parameters
fldβ Pointer to the float data values to pack.widthβ The number of points in the x direction.heightβ The number of points in the y direction.idrstmplβ Contains the array of values for Data Representation Template Table 5.42.0β Reference value - ignored on input, set byaecpackroutine.1β Binary Scale Factor - used on input, unchanged byaecpackroutine.2β Decimal Scale Factor - used on input, unchanged byaecpackroutine.3β number of bits for each data value - ignored on input4β Original field type - currently ignored on input Data values assumed to be reals. Set to 0 on output.5β CCSDS compression options mask.6β Block size.7β Reference sample interval. May be modified in this function.
cpackβ A pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in thelcpackparameter. > no cap, allocate it FIRST or you're gonna have a bad time πlcpackβ Pointer that gets the length of packed field incpack. This must be set by the calling function to the size available incpack.
Author
Eric Engle (adapted from jpcpack)
Definition at line 297 of file aecpack.c.
References aecpack_int().
Referenced by g2_addfield().
int aecpack_int (void * fld, int fld_is_double, g2int width, g2int height, g2int * idrstmpl, unsigned char * cpack, g2int * lcpack, int verbose)
[static]
Pack a float or double array into a AEC/CCSDS code stream. yes she handles BOTH. versatile icon. π
Parameters
fldβ Pointer to the float or double data values to pack.fld_is_doubleβ If non-zero, thenfldpoints to array of doubles, otherwise an array of floats.widthβ The number of points in the x direction.heightβ The number of points in the y direction.idrstmplβ Contains the array of values for Data Representation Template Table 5.42. May be modified in this function.cpackβ A pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in thelcpackparameter.lcpackβ Pointer that gets the length of packed field incpack. This must also be set by the calling function to the size available incpack.verboseβ If non-zero, error messages will be printed in case of error. Otherwise, error codes will be return but no error messages printed. Calls to the originalg2cAPI may cause error messages to be printed in case of error. For the newg2c_API, no error messages will be printed - instead an error code will be returned. Callg2c_strerror()to get the error message for any error code.
Returns
G2C_NOERRORβ No error.G2C_EAECβ Error encoding/decoding AEC data.
Author
Eric Engle
Definition at line 52 of file aecpack.c.
References ALOG2, enc_aec(), G2C_EAEC, G2C_NOERROR, int_power(), LOG, mkieee(), and sbits().
Referenced by aecpack(), g2c_aecpackd(), and g2c_aecpackf().
int g2c_aecpackd (double * fld, size_t width, size_t height, int * idrstmpl, unsigned char * cpack, size_t * lcpack)
This function packs up a double array into a AEC code stream. After the data are scaled, and the reference value is subtracted out, the data are passed to the AEC encoder.
This function also fills in GRIB2 Data Representation Template 5.42 with the appropriate values.
This function is the V2 API version of aecpack() for floats.
Parameters
fldβ Pointer to the float data values to pack.widthβ The number of points in the x direction.heightβ The number of points in the y direction.idrstmplβ Contains the array of values for Data Representation Template Table 5.42.0β Reference value - ignored on input, set byaecpackroutine.1β Binary Scale Factor - used on input, unchanged byaecpackroutine.2β Decimal Scale Factor - used on input, unchanged byaecpackroutine.3β number of bits for each data value - ignored on input4β Original field type - currently ignored on input Data values assumed to be reals. Set to 0 on output.5β CCSDS compression options mask.6β Block size.7β Reference sample interval. May be modified in this function.
cpackβ A pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in thelcpackparameter.lcpackβ Pointer that gets the length of packed field incpack. This must be set by the calling function to the size available incpack.
Returns
G2C_NOERRORβ No error.G2C_EAECβ Error encoding/decoding AEC data.
Author
Eric Engle (adapted from jpcpack)
Definition at line 410 of file aecpack.c.
References aecpack_int(), and G2C_AEC_DRS_TEMPLATE_LEN.
int g2c_aecpackf (float * fld, size_t width, size_t height, int * idrstmpl, unsigned char * cpack, size_t * lcpack)
This function packs up a float array into a AEC code stream. After the data are scaled, and the reference value is subtracted out, the data are passed to the AEC encoder.
This function also fills in GRIB2 Data Representation Template 5.42 with the appropriate values.
This function is the V2 API version of aecpack() for floats.
Parameters
fldβ Pointer to the float data values to pack.widthβ The number of points in the x direction.heightβ The number of points in the y direction.idrstmplβ Contains the array of values for Data Representation Template Table 5.42.0β Reference value - ignored on input, set byaecpackroutine.1β Binary Scale Factor - used on input, unchanged byaecpackroutine.2β Decimal Scale Factor - used on input, unchanged byaecpackroutine.3β number of bits for each data value - ignored on input4β Original field type - currently ignored on input Data values assumed to be reals. Set to 0 on output.5β CCSDS compression options mask.6β Block size.7β Reference sample interval. May be modified in this function.
cpackβ A pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in thelcpackparameter.lcpackβ Pointer that gets the length of packed field incpack. This must be set by the calling function to the size available incpack.
Returns
G2C_NOERRORβ No error.G2C_EAECβ Error encoding/decoding AEC data.
Author
Eric Engle (adapted from jpcpack)
Definition at line 346 of file aecpack.c.
References aecpack_int(), and G2C_AEC_DRS_TEMPLATE_LEN.
π¦ AUTHOR π¦
Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.
and that's the whole page bestie π«Ά this beauty is NCEPLIBS-g2c, Version 2.3.0, filed under aecpack.c(3) β go pack some arrays, you got this πβ¨πΈ
π¦ where this page comes from
- ubuntu resolute: libg2c-dev 2.3.0-4 Β· LGPL-3.0-only
- ubuntu stonking: libg2c-dev 2.3.0-7 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms