# A control file to test polynomial "filling" of spectra Arts2 { INCLUDE "general.arts" # ---- Species --------------------------------------------------------------- SpeciesSet( abs_species, [ "O3", "H2O" ] ) # ---- Atmospheric scenario -------------------------------------------------- # A pressure grid rougly matching 0 to 80 km in 1 km steps. VectorNLogSpace( p_grid, 81, 1.013e5, 1 ) AtmRawRead( t_field_raw, z_field_raw, vmr_field_raw, abs_species, "../atmosphere_data/tropical" ) AtmFieldsCalc # ---- Absorption ------------------------------------------------------------ ReadXML( abs_lines, "ozone_line.xml" ) abs_lines_per_speciesCreateFromLines abs_cont_descriptionInit # ---- Observation geometry -------------------------------------------------- NumericCreate( z_platform ) NumericCreate( za ) # Platform altitude NumericSet( z_platform, 50 ) # Zenith angle NumericSet( za, 60 ) MatrixSetConstant( sensor_pos, 1, 1, z_platform ) Copy( z_surface, sensor_pos ) MatrixSetConstant( sensor_los, 1, 1, za ) #--- Other stuff ------------------------------------------------------------- basics_checkedCalc cloudbox_checkedCalc StringSet( y_unit, "RJBT" ) # ---- Create fast f_grid ---------------------------------------------------- NumericCreate( v0 ) NumericCreate( fw ) IndexCreate( nlogpart ) NumericCreate( fw_fine ) NumericCreate( df_fine ) # Centre frequency NumericSet( v0, 1.108360400e+11 ) # One sided width of f_grid NumericSet( fw, 500e6 ) # Numer of points (on each side) of logarithmic part IndexSet( nlogpart, 35 ) # One sided width of fine grid at centre of f_grid NumericSet( fw_fine, 240e3 ) # Spacing of this fine grid NumericSet( df_fine, 40e3 ) # A logarithmically spaced grid between [fw_fine,fw] NumericCreate( f1 ) NumericCreate( f2 ) VectorCreate( flog ) Copy( f1, fw_fine ) Copy( f2, fw ) VectorNLogSpace( flog, nlogpart, f1, f2 ) # First part of f_grid is flog "mirrored" VectorFlip( f_grid, flog ) VectorScale( f_grid, f_grid, -1 ) # Append an equidistant grid between [-fw_fine+df_fine,fw_fine-df_fine] VectorCreate( feqd ) Copy( f1, fw_fine ) NumericScale( f1, f1, -1 ) NumericAdd( f1, f1, df_fine ) NumericScale( f2, f1, -1 ) VectorLinSpace( feqd, f1, f2, df_fine ) Append( f_grid, feqd ) # Append flog Append( f_grid, flog ) # Add v0 VectorAddScalar( f_grid, f_grid, v0 ) #-- Calculate spectrum for monochromatic grid and store as y1(x1) sensorOff yCalc VectorCreate( x1 ) VectorCreate( y1 ) Copy( x1, f_grid ) Copy( y1, y ) # WriteXML( output_file_format, x1 ) WriteXML( output_file_format, y1 ) # ---- Create reference f_grid ----------------------------------------------- Copy( f1, fw ) NumericScale( f1, f1, -1 ) VectorLinSpace( f_grid, f1, fw, 30e3 ) VectorAddScalar( f_grid, f_grid, v0 ) #-- Calculate spectrum for reference grid and store as ye(x2) sensorOff yCalc VectorCreate( x2 ) VectorCreate( ye ) Copy( x2, f_grid ) Copy( ye, y ) # WriteXML( output_file_format, x2 ) WriteXML( output_file_format, ye ) # ---- Create spectra with polynomial filling --------------------------------- Copy( f_grid, x1 ) FlagOn( sensor_norm ) sensor_responseInit sensor_responseFillFgrid( sensor_response, sensor_response_f, sensor_response_pol, sensor_response_za, sensor_response_aa, sensor_response_f_grid, sensor_response_pol_grid, sensor_response_za_grid, sensor_response_aa_grid, 3, 2 ) yCalc WriteXML( output_file_format, sensor_response_f_grid, "TestFgrid.x3.xml" ) WriteXML( output_file_format, y, "TestFgrid.y3.xml" ) sensor_responseInit sensor_responseFillFgrid( sensor_response, sensor_response_f, sensor_response_pol, sensor_response_za, sensor_response_aa, sensor_response_f_grid, sensor_response_pol_grid, sensor_response_za_grid, sensor_response_aa_grid, 5, 4 ) yCalc WriteXML( output_file_format, sensor_response_f_grid, "TestFgrid.x5.xml" ) WriteXML( output_file_format, y, "TestFgrid.y5.xml" ) }