Skip to content

Nowak 22 add support for FESOM files#52

Open
kacpnowak wants to merge 9 commits intonowak-22-add-support-for-fesom-files-origfrom
nowak-22-add-support-for-fesom-files
Open

Nowak 22 add support for FESOM files#52
kacpnowak wants to merge 9 commits intonowak-22-add-support-for-fesom-files-origfrom
nowak-22-add-support-for-fesom-files

Conversation

@kacpnowak
Copy link
Collaborator

Implement support for FESOM files, fix bugs occurring for data with resolution of 1 degree

@kacpnowak kacpnowak added the enhancement New feature or request label Oct 15, 2024
@kacpnowak kacpnowak requested a review from iluise October 15, 2024 12:46
@kacpnowak kacpnowak self-assigned this Oct 15, 2024
@clessig clessig self-requested a review October 21, 2024 14:50

filler_value = 0.0
months_per_file = 12
spatial_resolution = np.array([1., 1.]) # Degre
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameters related to the resolutions should come from the zarr input file as it is already the case for ERA5.

number_of_steps_per_degree = 1
# Number of mesh elements
lat_range = 170
long_range = 360
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lat_range and lon_range (not long_range) should also come from the data zarr file

trainer.model.net.decoder_to_tail = trainer.decoder_to_tail

str = 'Loaded model id = {}{}.'.format( model_id, f' at epoch = {epoch}' if epoch> -2 else '')
str = 'Do chuja wafla Loaded model id = {}{}.'.format( model_id, f' at epoch = {epoch}' if epoch> -2 else '')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be some erronous string here

cf = self.cf
devs = self.devices

# print(f"prepare batch xin {xin}")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove

def log_validate_forecast( self, epoch, batch_idx, log_sources, log_preds) :
'''Logging for BERT_strategy=forecast.'''

print("validating forecast")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove

self.lats = np.array( self.ds['lats'])
self.lons = np.array( self.ds['lons'])

if self.lons[0] < 0:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove

# handle periodicity of lon
assert not ((idx[1]-ns_2[2]) < 0. and (idx[1]+ns_2[2]) > 360.)
il, ir = (idx[1]-ns_2[2]-res[1]/2., idx[1]+ns_2[2])
il, ir = (idx[1]-ns_2[2], idx[1]+ns_2[2])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this change been verified with the 0.25 deg and 1.0 deg ERA5 data?

# try path used for logging training results and checkpoints
try :
fname = Path( config.path_results, '/models/id{}/model_id{}.json'.format(wandb_id,wandb_id))
print(config.path_results)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably a debug message? Otherwise it should use the logger.

def tokenize( data, token_size = [-1,-1,-1]) :

data_tokenized = data
# print(f'before: {data.shape} token shapee {token_size}')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants