Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ecc 1467 float data values #83

Merged
merged 49 commits into from
Mar 13, 2023
Merged
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6a26e0f
ECC-1467: GRIB: Support data values array decoded as floats (Part 01)
shahramn Dec 28, 2022
78af61b
ECC-1467: GRIB: Support data values array decoded as floats (Part 02)
shahramn Dec 29, 2022
4dd790f
ECC-1467: Debugging
shahramn Dec 29, 2022
573f2f9
ECC-1467: First working version for simple packing
shahramn Dec 29, 2022
445798c
ECC-1467: Testing
shahramn Dec 29, 2022
8d55550
ECC-1467: GRIB: Support data values array decoded as floats (Part 03)
shahramn Dec 29, 2022
e0e4655
ECC-1467: GRIB: Support data values array decoded as floats (Part 04)
shahramn Dec 30, 2022
f16ba71
ECC-1467: GRIB: Support data values array decoded as floats (Part 04)
shahramn Dec 30, 2022
5fea28e
ECC-1467: Added test
shahramn Dec 30, 2022
ff77426
ECC-1467: Cleanup
shahramn Dec 30, 2022
4cb2e12
ECC-1467: Add grib_accessors_list_unpack_float
shahramn Dec 30, 2022
cc4ef5a
ECC-1467: Add codes_keys_iterator_get_float
shahramn Dec 30, 2022
c36ac36
ECC-1467: GRIB: Support data values array decoded as floats (Part 05)
shahramn Dec 30, 2022
6fcef54
ECC-1467: GRIB: Support data values array decoded as floats (Part 06)
shahramn Dec 31, 2022
ffc9f13
ECC-1467: cpplint warnings
shahramn Jan 2, 2023
d1275b0
ECC-1467: Placeholder for spherical harmonics (to be done)
shahramn Jan 2, 2023
dab6eef
ECC-1467: TODO items
shahramn Jan 2, 2023
e1beaac
Merge branch 'develop' into feature/ECC-1467-FloatDataValues
shahramn Jan 4, 2023
7f076a3
Merge branch 'develop' into feature/ECC-1467-FloatDataValues
shahramn Jan 6, 2023
19dbc00
Merge branch 'develop' into feature/ECC-1467-FloatDataValues
shahramn Jan 22, 2023
b669abf
ECC-1508: Set project language to be C++
shahramn Jan 29, 2023
a555f55
ECC-1508: Set C++ standard to 11 and re-enable test
shahramn Jan 30, 2023
1d3b074
Merge branch 'develop' into feature/ECC-1467-FloatDataValues
shahramn Jan 30, 2023
995ed22
ECC-1508: Change file extensions to '.cc'
shahramn Jan 30, 2023
2cad3be
ECC-1467: Complex packing single-precision
Jan 30, 2023
b8da4f1
ECC-1467: Minor changes
Jan 30, 2023
43f7faf
Merge branch 'feature/ECC-1467-FloatDataValues-Compression' into feat…
Jan 30, 2023
370f046
ECC-1467: Complex single-precision
Jan 30, 2023
213b250
ECC-1467: Cleanup debug output
Jan 30, 2023
c6717ff
ECC-1467: Basic shell constructs
Jan 30, 2023
0300878
Merge branch 'develop' into feature/ECC-1467-FloatDataValues
shahramn Feb 12, 2023
150c538
Remove unused variables
shahramn Feb 12, 2023
0a9d311
Merge branch 'develop' into feature/ECC-1467-FloatDataValues
Feb 17, 2023
687e3f4
ECC-1467: Single-precision implementation with the use of templates
Feb 20, 2023
9d5d888
Merge develop
shahramn Feb 26, 2023
b1f5856
ECC-1467: template for second order packing
Mar 1, 2023
9371a32
ECC-1467: typename check in templates
Mar 1, 2023
3079588
ECC-1467: Simplification of templates
Mar 6, 2023
8486b71
ECC-1467: Missing header file
Mar 6, 2023
3a300d7
Pseudo code
Mar 7, 2023
58ee3be
ECC-1467: Revert changes in the unpack_double_element_set() function
Mar 8, 2023
8425eeb
ECC-1467: Minor changes
Mar 8, 2023
d300abb
Merge branch 'develop' into feature/ECC-1467-FloatDataValues
joobog Mar 13, 2023
94f69da
Merge branch 'develop' into feature/ECC-1467-FloatDataValues
joobog Mar 13, 2023
b892ff1
ECC-1467: Fixed data run length class
joobog Mar 13, 2023
ce053e1
ECC-1467: Fixed data run length class
joobog Mar 13, 2023
97a007a
ECC-1467: Use __func__ in log messages
joobog Mar 13, 2023
c41518d
Merge branch 'feature/ECC-1467-FloatDataValues' of github.com:joobog/…
joobog Mar 13, 2023
46b6736
Merge branch 'develop' into feature/ECC-1467-FloatDataValues
shahramn Mar 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ECC-1467: Revert changes in the unpack_double_element_set() function
  • Loading branch information
Eugen Betke committed Mar 8, 2023
commit 58ee3be16582d71226b251f58ba59878a70c8984
51 changes: 8 additions & 43 deletions src/grib_accessor_class_data_ccsds_packing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -669,49 +669,14 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array
if (index_array[i] > size) return GRIB_INVALID_ARGUMENT;
}

//values = (double*)grib_context_malloc_clear(a->context, size * sizeof(double));
//err = grib_get_double_array(grib_handle_of_accessor(a), "codedValues", values, &size);
//if (err) {
// grib_context_free(a->context, values);
// return err;
//}
//for (i = 0; i < len; i++) {
// val_array[i] = values[index_array[i]];
//}

std::vector<size_t> rsi_table;

struct Redirection {
size_t buf_pos; // position in the buffer
size_t idx; // user-requested data
};

struct RsiBucket {
size_t rsi_idx;
std::vector<Redirection> redicrections;
};

unsigned char* buf = NULL;
size_t buflen = 0;

buflen = grib_byte_count(a);
buf = (unsigned char*)hand->buffer->data;
buf += grib_byte_offset(a);

size_t rsi_size = rsi * block_size;
std::vector<RsiBucket> buckets = create_buckets(index_array, rsi, block_size);

aec_stream strm;
strm.flags = ccsds_flags;
strm.bits_per_sample = bits_per_value;
strm.block_size = ccsds_block_size;
strm.rsi = ccsds_rsi;

for (auto bucket: buckets) {
unsigned char* rsi = aec_rsi_at(&strm, rsi_table[bucket.rsi_idx]);
for (auto r: bucket.redirections) {
values[bucket.pos] = rsi[bucket.idx - bucket.rsi_idx * rsi_size];
}
values = (double*)grib_context_malloc_clear(a->context, size * sizeof(double));
err = grib_get_double_array(grib_handle_of_accessor(a), "codedValues", values, &size);
if (err) {
grib_context_free(a->context, values);
return err;
}
for (i = 0; i < len; i++) {
val_array[i] = values[index_array[i]];
}

grib_context_free(a->context, values);
Expand Down