ocssw
V2022
|
mscal_struc.c
Go to the documentation of this file.
9 * int crosscal_add(char *xcalfile, int32_t subsmpl, mscalstr *calstr, int32_t *npixs, int32_t *ngranuls)
48 int crosscal_readblocks(char *xcalfile, idDS *ds_id, int32_t *spix, int32_t *totalpixs, mscalstr *calstr);
49 int crosscal_writeblocks(char *xcalfile, idDS ds_id, int32_t *spix, mscalstr calstr, int32_t nfiles);
143 if (crosscal_readblocks(xcalfile, &ds_id_old, &spix_old, &total_old, &calstr_old) != LIFE_IS_GOOD) {
144 printf("-E- %s line %d: Cannot read already existing SDS data %s\n", __FILE__, __LINE__, xcalfile);
152 printf("-E- %s line %d: Attempt to write into a file whose data come from a different sensor %s\n", __FILE__, __LINE__, sensorName[calstr_old.sensorID]);
172 printf("-E- %s line %d: Cannot read already existing SDS data %s\n", __FILE__, __LINE__, tempname);
184 printf("-E- %s line %d: Cannot write existing SDS data into the temp file %s\n", __FILE__, __LINE__, tempname);
191 if (crosscal_readblocks(xcalfile, &ds_id_old, &spix_old, &total_old, &calstr_old) != LIFE_IS_GOOD) {
192 printf("-E- %s line %d: Cannot read already existing SDS data %s\n", __FILE__, __LINE__, xcalfile);
204 printf("-E- %s line %d: Cannot write new SDS data into the temp file %s\n", __FILE__, __LINE__, tempname);
228 printf("-E- %s line %d: Cannot write new SDS data into the file %s\n", __FILE__, __LINE__, xcalfile);
254 int crosscal_readblocks(char *xcalfile, idDS *ds_id, int32_t *spix, int32_t *totalpixs, mscalstr *calstr) {
298 printf("-E- %s line %d: Could not read HDF sensor attribute, %s .\n", __FILE__, __LINE__, xcalfile);
307 printf("-E- %s line %d: Error allocating memory to MScalmerge input parameter text.\n", __FILE__, __LINE__);
331 printf("-E- %s line %d: The rank of the requested parameter (%s) is incorrect\n", __FILE__, __LINE__, name);
388 if ((calstr->l2prods = (prname *) realloc((void *) calstr->l2prods, calstr->nprods * sizeof (prname))) == NULL) {
466 int crosscal_writeblocks(char *xcalfile, idDS ds_id, int32_t *spix, mscalstr calstr, int32_t nfiles) {
483 PTB(writeDS(ds_id, "fileID\0", (VOIDP) calstr.fileID, (int32) * spix, 0, 0, (int32) calstr.npixs, 1, 1));
484 PTB(writeDS(ds_id, "year\0", (VOIDP) calstr.year, (int32) * spix, 0, 0, (int32) calstr.npixs, 1, 1));
485 PTB(writeDS(ds_id, "day\0", (VOIDP) calstr.day, (int32) * spix, 0, 0, (int32) calstr.npixs, 1, 1));
486 PTB(writeDS(ds_id, "msec\0", (VOIDP) calstr.msec, (int32) * spix, 0, 0, (int32) calstr.npixs, 1, 1));
487 PTB(writeDS(ds_id, "iscan\0", (VOIDP) calstr.iscan, (int32) * spix, 0, 0, (int32) calstr.npixs, 1, 1));
488 PTB(writeDS(ds_id, "mside\0", (VOIDP) calstr.mside, (int32) * spix, 0, 0, (int32) calstr.npixs, 1, 1));
489 PTB(writeDS(ds_id, "detnum\0", (VOIDP) calstr.detnum, (int32) * spix, 0, 0, (int32) calstr.npixs, 1, 1));
490 PTB(writeDS(ds_id, "pixnum\0", (VOIDP) calstr.pixnum, (int32) * spix, 0, 0, (int32) calstr.npixs, 1, 1));
491 PTB(writeDS(ds_id, "lon\0", (VOIDP) calstr.lon, (int32) * spix, 0, 0, (int32) calstr.npixs, 1, 1));
int getDimsDS(idDS ds_id, const char sdsname[], int32_t dims[])
int crosscal_readblocks(char *xcalfile, idDS *ds_id, int32_t *spix, int32_t *totalpixs, mscalstr *calstr)
Definition: mscal_struc.c:254
int crosscal_create(char *xcalfile, idDS *ds_id, mscalstr calstr, int32_t npixs)
Definition: mscal_struc.c:51
int32_t alloc_calstr(int32_t nfiles, int32_t npixs, mscalstr *calstr)
Definition: mscal_struc.c:526
int createDS(idDS ds_id, int sensorId, const char *sname, int32_t dm[3], const char dm_name[3][80])
Definition: wrapper.c:344
int readAttr(idDS ds_id, const char *nam, void *data)
idDS startDS(const char *filename, ds_format_t format, ds_access_t accessmode, int32_t deflate)
Definition: wrapper.c:561
int writeDS(idDS ds_id, const char *name, const void *data, int32_t s0, int32_t s1, int32_t s2, int32_t e0, int32_t e1, int32_t e2)
Definition: wrapper.c:475
int readDS(idDS ds_id, const char *name, int32_t *start, int32_t *stride, int32_t *count, void *data)
Extra metadata that will be written to the HDF4 file l2prod rank
Definition: HOWTO_Add_a_product.txt:80
PARAM_TYPE_NONE Default value No parameter is buried in the product name name_prefix is case insensitive string compared to the product name PARAM_TYPE_VIS_WAVE The visible wavelength bands from the sensor are buried in the product name The product name is compared by appending and name_suffix ie aph_412_giop where prod_ix will be set to PARAM_TYPE_IR_WAVE same search method as PARAM_TYPE_VIS_WAVE except only wavelength above are looped through but prod_ix is still based ie aph_2_giop for the second and prod_ix set to PARAM_TYPE_INT name_prefix is compared with the beginning of the product name If name_suffix is not empty the it must match the end of the product name The characters right after the prefix are read as an integer and prod_ix is set to that number strncpy(l2prod->name_prefix, "myprod", UNITLEN)
Definition: dfutils.h:28
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")
int crosscal_writeblocks(char *xcalfile, idDS ds_id, int32_t *spix, mscalstr calstr, int32_t nfiles)
Definition: mscal_struc.c:466
a context in which it is NOT documented to do so subscript which cannot be easily calculated when extracting TONS attitude data from the Terra L0 files Corrected several defects in extraction of entrained ephemeris and and as HDF file attributes
Definition: HISTORY.txt:65
int32_t get_l2prod_index(const l2_prod &l2, const char *prodname)
Definition: l2bin.cpp:345